+3 votes
94 views
in Office by (242k points)
reopened
LaTeX: insert backslash - that's how it works

1 Answer

+4 votes
by (1.6m points)
 
Best answer

How to insert a backslash in LaTeX

Do you need a backslash in your LaTeX document? Then find out how to insert it here..

image image

Since the backslash is an important sign in LaTeX to initiate any commands and environments, it is not possible to enter it with a stand-alone \. In this tipps + tricks article, we will show you how you can insert a backslash in LaTeX anyway. We will also give you a minimal example so that you can easily insert a backslash into your document.

How to insert a backslash in LaTeX

Creating a backslash is very simple. To do this, just enter the following command:

\textbackslash

This gives LaTeX the command to express a backslash in text. Entering " \ " alone would result in an error, since LaTeX always expects a command after " \ ". If you would like a minimal example for your LaTeX document, copy the following code:

\documentclass[a4paper, 12pt]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
So fügen Sie einen Backslash \textbackslash in LaTeX ein.
\end{document}


...