meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
programming:rst:symbols [2024/12/06 18:56] – created niziakprogramming:rst:symbols [2024/12/09 10:54] (current) niziak
Line 28: Line 28:
 .. |tick| unicode:: U+2714 .. |tick| unicode:: U+2714
 </code> </code>
 +
 +Conditional substitution:
 +<code rst>
 +.. only:: html
 +
 +   .. raw:: html
 +
 +      <a href="http://www.google.com">google</a>
 +
 +.. only:: latex
 +
 +   latex specific
 +</code>
 +
 +Workaround for different conditionals for ''html'' and ''latex''
 +<code rst>
 +.. |br| replace:: |br_html| |br_latex|
 +
 +.. |br_html| raw:: html
 +
 +   <br>
 +
 +.. |br_latex| raw:: latex
 +
 +   \newline
 +</code>
 +
 +Or Sphinx project wide:
 +
 +<file python conf.py>
 +rst_prolog = r"""
 +.. |br| replace:: |br_html| |br_latex|
 +
 +.. |br_html| raw:: html
 +
 +   <br />
 +
 +.. |br_latex| raw:: latex
 +
 +   \newline
 +"""
 +</file>
 +