Text Formattinghow to enter backslash (\) in your text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ghantauke
Posts: 9
Joined: Wed Mar 02, 2011 2:50 am

how to enter backslash (\) in your text

Post by ghantauke »

Hi,

I want my pdf file to display the following line.

Blah blah \n blaah
Last edited by ghantauke on Mon Mar 14, 2011 3:35 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

how to enter backslash (\) in your text

Post by gmedina »

Hi,

the answer depends on the font that you want to use to display \n; some options

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}

% monospaced font
\verb+\n+

% monospaced font
\texttt{\symbol{92}n}

% monospaced font; requires T1 encoding
\texttt{\textbackslash n}

% current font
\textbackslash n

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
ghantauke
Posts: 9
Joined: Wed Mar 02, 2011 2:50 am

how to enter backslash (\) in your text

Post by ghantauke »

Code: Select all

\textbackslash n"
worked pefectly.

Many thanks to you. :)
Post Reply