Assume you have a reStructuredText document and want to export it in two formats using Sphinx 2.x: HTML and PDF.
You want to put some slightly different contents in the
This is a little clunky, but it works for me:
.. role:: latex(raw) :format: latex .. role:: html(raw) :format: html .. |foo| replace:: :latex:`LaTeX text`:html:`HTML text` .. |bar| replace:: :latex:`other latex text`:html:`other html text`