# Strange output when writing \texttt{"avg"} in spanish

I'm using pandoc, which parses markdown into LaTeX. In this case I configured pandoc to use babel in spanish and wrote "avg" which is translated by pandoc as \texttt{"avg"}.

When I do this I obtain the first string in the next image:

So I posted an Issue in pandoc's github. But it is unlikely to be solved if we don't know why LaTeX is behaving this way.

Any ideas?

I think the solution is related to this post, but I don't understand much LaTeX.

Thanks!

# Update

This is a minimized code which produces the output of the image:

\documentclass[spanish,]{article}
\usepackage[spanish]{babel}

\begin{document}

\texttt{"avg"}

\texttt{"a}

\verb|"a|

\end{document}

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. You might also want to add to your question how you're including the pdfs etc. Sep 26 '14 at 23:23
• Well, this problem has to do with the way are you writing the quotemarks, but not an issue of pandoc properly. In fact, for avoid this, you should write the quotation marks only accodring with the LaTeX way, it is:  for openning and '' for closing. Sep 26 '14 at 23:25
• I think it is an issue of pandoc, because when I paste some code between , then I expect to see the same code in the output. So maybe pandoc should translate the quotation marks so the text respects the LaTeX way of doing it. Sep 26 '14 at 23:42
• Perhaps could be an issue of Pandoc wih the quotation marks, but in fact, according to my experience in LaTeX, when you don't use the quotation marks right or use instad a package for mnage them, the result is the same you show above in your question. I use Sublime Text with regex for fix them all. Sep 27 '14 at 0:57

The behavior is readily explained by looking at Cuadro 2 in the documentation of babel-spanish:

"a "A "o "O Ordinals: 1.a 1.A 1.o 1.O

This means that an input such as

1"a


will be rendered as

1.a

but any appearance of "a will become .a (and similarly for "A, "o and "O).

You can globally disable this by using the es-noshorthands option

\usepackage[spanish,es-noshorthands]{babel}


but you can also just disable the " with

\usepackage[spanish]{babel}


If you want to keep the shorthands but disable them just for \ttfamily or \texttt you can do as follows

\documentclass[spanish,]{article}
\usepackage[spanish]{babel}

\usepackage{xpatch}

\begingroup\lccode~="
\lowercase{\endgroup
\xapptocmd\ttfamily{\let~"}{}{}
}

\begin{document}
\texttt{"avg"}

\texttt{"a}

\verb|"a|

\end{document}


that will redefine the active " only in a \ttfamily context to produce just ". In normal contexts, the " shortcuts will still be available.

In babel use also option es-noshorthand. Your minimal example will look like:

\documentclass{article}
\usepackage[spanish,es-noshorthands]{babel}

\begin{document}

\texttt{"avg"}

\texttt{"a}

\verb|"a|

\end{document}


And the output is:

More of this is here.