0

This is related to the question about line-break using "::" .

Our document is in ReStructuredText and I generate PDFs using LaTeX.

I would like to use one of the solutions given there, to force a line-break when a double colon (::) in encountered near the end of the line. I have used the definition of the new command \cppstring in my sphinxmanual.cls file and it builds without errors.

Could you please guide me as to how to use the "\cppstring" command within my .rst file ?

I tried using the "raw" directive as follows:

.. raw:: latex

\cppstring{lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum::lorem::ipsum}

And of course, does not work. It errors out saying "!Undefined Control Sequence".

regards,

Kedar

Kedar
  • 1
  • You should also include the definition of the command in your document, i.e., the part from \ExplSyntaxOn to \ExplSyntaxOff (including those two lines). Include this definition inside a raw directive as well, similar to the current content. – Marijn Dec 28 '21 at 13:54
  • Thanks a lot! It works. Unfortunately, this solution is not acceptable. We are not allowed to have .. raw:: latex blocks in our RST files.

    Is there a way where we can declare the command \texttt in the sphinxmanual.cls file, and apply it all over the document (I mean, all the RST files involved) in one go?

    – Kedar Dec 29 '21 at 05:44

0 Answers0