The Problem: I just want to print a sequence like this in plain text:
a (10)
_/ \_
/ \
(4) b c (4)
_/ \___
/ \
(8) d _ e _ (5)
/ \ / | \
f g h i j
(2) (4) (1) (1) (6)
I would like to avoid escaping all characters along the way, including special characters for preserving spaces. Essentially, I am drawing an ASCII picture!
Outside \verb , the first seven of them can be typeset by prepending a backslash; for the other three, use the macros \textasciitilde , \textasciicircum , and \textbackslash .
Bookmark this question. Show activity on this post. \ignore{^&%$###___} that outputs exactly ' ^&%$###___ ' in the pdf document?
If you simply want the character to be printed just as any other letter, include a \ in front of the character. For example, \$ will produce $ in your output. The exception to the rule is the \ itself because \\ has its own special meaning. A \ is produced by typing $\backslash$ in your file.
Write Text inside Math Mode: Tips + Examples 1 Method 1: \text {} command. In LaTeX, the command \text {} with package amsmath is used to add normal text in math in LaTeX. 2 Method 2: \textrm {} command. The command \textrm forces the roman font style for text and keeps font parameters from the current text font. 3 Method 3: \mbox {} command. ...
Just in case anyone is looking for another way to escape special characters, this can be done with the listings package. Since all characters will be displayed as they are, it is not possible to execute any command inside the block. Update: the inline listing \lstinline supports the math mode by including the mathescape option.
? Taking a closer look at the first two characters of “fraction” in math mode shows that LaTeX assigns them more space, giving the word a somewhat unnatural appearance. Here is another example where switching to normal text is desirable.
The following characters play a special role in LaTeX and are called"special printing characters", or simply "special characters". Whenever you put one of these special characters into your file, you aredoing something special. If you simply want the character to be printedjust as any other letter, include a \in front of the character.
For a pure ASCII-picture interpretation, use the verbatim
environment:
\documentclass{article}
\begin{document}
\begin{verbatim}
a (10)
_/ \_
/ \
(4) b c (4)
_/ \___
/ \
(8) d _ e _ (5)
/ \ / | \
f g h i j
(2) (4) (1) (1) (6)
\end{verbatim}
\end{document}
The verbatim
environment sets interprets spaces, line breaks and special characters as-is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With