Editing/Rendering OOFEM documentation

You need to install a LaTeX editor to modify and update the OOFEM manual source files.
Texmaker is one of the best editors for this purpose.
Installing Texmaker and libraries that OOFEM documentation needs to compile.
If you are here just to download the manuals I have compiled (April 2021) please scroll to the end of this post.

in Ubuntu:

  1. Open Ubuntu’s terminal
  2. Update APT packages list:
    sudo apt update
  3. In this step you need to install LaTex, you can install the complete texlive package, but his will be rather large, you will need large amount of disk space (5GB) and good download speed. As an alternative you can only install the common packages. Follow one of the following
    1. Opation A: install LaTex full (takes a while and is large):
      sudo apt install texlive-full
    2. Option B: install common packages one by one:
      sudo apt install texlive-binaries
      sudo apt install texlive-base
      sudo apt install texlive-latex-base
      sudo apt install texlive-latex-recommended
      sudo apt install texlive-bibtex-extra
  4. Installing Latex2html (required library):
    sudo apt install latex2html
  5. User and Theory manuals require Sphinx:
    sudo apt install python3-sphinx
  6. Sometimes latexmk is needed for Sphinx to work correctly (optional):
    sudo apt install latexmk
    if you don’t install latexmk you may get the following error when making some PDF files that require Sphinx:
    latexmk: Command not found
  7. Install Texmaker (this is for editing and not required for generating):
    sudo apt install texmaker
    (this will take a while to download)

You can now start Texmaker by “texmaker” command on terminal.

Please note that even though you can generate the PDF inside the Texmaker, the generated images may not look correctly. Make sure to generate the final files using the terminal.

Generating the manuals outside of Texmaker using terminal:

Make sure you have copied the doc file in another place that is different from the cloned directory to avoid changing the source files.

For making each manual open that directory in terminal.

For some manuals you can use “make pdf” command.

For some others that use Sphinx, such as “oofem input“, “theorymanual 2” and the “user manual” you have to use “make latexpdf“.

If you get error contents.rst not found, you have to explicitly tell Sphinx to use index file. To do that you have to open conf.py and add the following line:

master_doc = 'index'

Issue with “input manual” generation:

You may encounter this error:

convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF’

This issue is caused by security policy defined in “/etc/ImageMagick-6/policy.xml”.

It is required to add “read|write” permission to “PDF” pattern in “coder” domain of “policymap” tags. Since this may compromise the device security I will not cover this any further.

For more information see:

Contents.rst not found error on Stackoverflow

ReadMe file in the doc directory of OOFEM

ImageMagic 6 PDF error

OOFEM officially rendered documentations

OOFEM Manuals that I compiled on April 8th 2021

Leave a comment

Design a site like this with WordPress.com
Get started