I want to input a string "a"
in a LaTeX document using German (\documentclass[ngerman]{article}
), but I do not want "a
to be turned into ä
; what can I do? (I know \verb
works; are there any other solutions?) Thanks!
4 Answers
\dq a
should work. Note also that proper quotation marks would be
"`like this"'
i.e. "quotation backtick" and "quotation apostrophe". (Also see the csquotes package.)
Assuming that you really want the "straight" double quote: The correct command is \textquotedbl
but \string"
works too and is shorter:
\documentclass{article}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\begin{document}
\string"a\string"
\textquotedbl a\textquotedbl
\end{document}
other answers are appropriate if this is ordinary text. but if you want, for example, to indicate how to type something, you may want to use "typewriter" style, so
\verb+"a"+
should give you a suitable result.
- Maybe it's a good thing if you improve your knowledge about quotation, but
- for the moment simply write
"{}a{}"
-
1You assume that they want to quote something which is not stated in the question. Sep 27, 2016 at 9:07
-
I'm coming to the party pretty late, but regarding point 1, it might have been nice to include a link to the documentation. Jan 31, 2021 at 10:10