Skip to content

Inline math expressions with mathjax do not render #85

@sebascert

Description

@sebascert

mkdocs.yml.txt

Image

I'm attempting to convert this repo to a pdf via this plugin, which uses material for mkdocs, pymdownx.arithmatex and mathjax, I attached the full mkdocs.yml but here are the relevant parts to it:

extra_javascript:
  - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js

markdown_extensions:
  - pymdownx.arithmatex:
      generic: true
      tex_inline_wrap: ["$", "$"]
      tex_block_wrap: ["$$", "$$"]

plugins:
  - to-pdf:
      enabled: !ENV [MKDOCS_ENABLE_TO_PDF, False]
      render_js: true
      headless_chrome_path: !ENV MKDOCS_TO_PDF_CHROME_PATH

Which seems fine acording to the docs of material for mkdocs on math, it's just missing javascripts/mathjax.js but i've tested it including it and it's the same.

Im on Ubuntu 24.04.2 and using mkdocs-to-pdf==0.10.1

This is the building output:

$ mkdocs build
INFO    -  git-committers plugin DISABLED
INFO    -  [macros] - No default module `main` found
INFO    -  git-committers: loading authors cache file
INFO    -  git-committers: saving authors cache file
INFO    -  [macros] - Config variables: ['extra', 'config',
           'environment', 'plugin', 'git', 'analytics', 'macros', 'filters',
           'filters_builtin']
INFO    -  [macros] - Config macros: ['context', 'macros_info', 'now',
           'fix_url']
INFO    -  [macros] - Config filters: ['pretty', 'relative_url']
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory:
           /home/yoaquin/projects/cp-algorithms/public
INFO    -  Doc file 'algebra/discrete-log.md' contains a link
           'phi-function.md#toc-tgt-2', but the doc 'algebra/phi-function.md'
           does not contain an anchor '#toc-tgt-2'.
INFO    -  Number headings up to level 3.
INFO    -  Generate a table of contents up to heading level 2.
INFO    -  Generate a cover page with "default_cover.html.j2".
INFO    -  Converting <img> alignment(workaround).
INFO    -  Rendering on `Headless Chrome`(execute JS).
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1753126385.893415  150530 voice_transcription.cc:58] Registering VoiceTranscriptionCapability
[150512:150535:0721/133306.293222:ERROR:google_apis/gcm/engine/registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT
Created TensorFlow Lite XNNPACK delegate for CPU.
Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#-1 is a dynamic-sized tensor).
INFO    -  Rendering for PDF.
INFO    -  Output a PDF to
           "/home/yoaquin/projects/cp-algorithms/public/pdf/document.pdf".
'created' timestamp seems very low; regarding as unix timestamp
INFO    -  Converting 166 articles to PDF took 243.6s
INFO    -  Documentation built in 263.64 seconds

Another issue I have is that the copyright clause is being rendered literally in the final pdf, is there any way for it to be rendered properly?

copyright: Text is available under the <a href="https://github.com/cp-algorithms/cp-algorithms/blob/main/LICENSE">Creative Commons Attribution Share Alike 4.0 International</a> License<br/>Copyright &copy; 2014 - 2025 by <a href="https://github.com/cp-algorithms/cp-algorithms/graphs/contributors">cp-algorithms contributors</a>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions