TransWikia.com

Exporting string with newline and tab symbols to LaTeX

Mathematica Asked by azerbajdzan on December 24, 2020

We have a string that has "tab" symbol between letters "B" and "C" and "newline" symbol between letters "C" and "D":

Input:

"A BtCnD"

Output:

enter image description here

The output is formatted accordingly to special symbols used.

But when I export the same string to LaTeX, the special symbols n and t are interpreted literally like so:

Input:

ExportString["A btcnd", "TeXFragment"]

Output:

[text{A b$backslash $tc$backslash $newlined}]

If you put this Latex code into some TeX file the document will display literally "A BtCnD" and without "tab" and "newline" symbols.

How to tell the Mathematica to export the special symbols into LaTeX accordingly?

One Answer

Does this work for you?

txt =
 "begin{verbatim}
 A btcnd
 end{verbatim}";
ExportString[txt, "Text"]

result

Answered by m_goldberg on December 24, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP