简体   繁体   中英

Is it possible to include LaTeX into Sphinx?

The Sphinx Titlepage can be customized in conf.py with "latex_elements" and the "preamble" directive but i cant find a solution to include normal latex source code into sphinx. The reason is that i want to customize some pages of the document with latex.

Is there a way to include Latex-Code in the body of an document?

(I've define a latex-"newcommand" in the preamble in conf.py but dont know how to call it in sphinx)

You can do it 2 ways:

The first way is that you can define it when you use it:

My raw code:
.. raw:: latex

     code here

The other way is that you can define it at the end of the file and use it:

My raw code: |rawcode|

.. |rawcode| raw::

     codehere

In conf.py you can define a new command like /newcommand{\newCom}{...} .

In a sphinx text file this command can be referenced with:

.. raw:: latex

        \newCom

Crucial was the newline after the ".. raw:: latex" command, it seems as if omitting that was the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM