I don't know how to fix this problem, when I use "> in a listings I see a weird double > as result.

See this example, where the following section of my article:

De esta forma si el título ingresado por el astrónomo es \textit{Stars survey}, el resultado en el \textit{resource descriptor} será \code{<resource schema="stars\_survey">}.

Get the following result:

enter image description here

And when I use simple quotes there's no problem:

enter image description here

So, how can I fix the problem? I want to be able to write a "> in the listings!

BTW, I declared my code command like this:


closed as off-topic by siracusa, Raaja, Henri Menke, Sebastiano, TeXnician Jul 22 at 8:01

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    "> is a babel shorthand for spanish (goes for », as you found out). You can use \shorthandoff{">} before your listings code and then re-enable it later with \shorthandon{">}. Alternatively you could for "\textgreater. – gusbrs May 8 '18 at 3:56
  • 2
    You could also look into listings or other packages that really treat their argument verbatim. Then you can write "stars_survey" directly and don't need to escape the _ as in "stars\_survey". Verbatim is tricky, so it is possible that you can't get exactly what you want here. – moewe May 8 '18 at 5:25
  • 4
    I'm voting to close this question as off-topic because it was solved in the comments – siracusa Jul 22 at 4:05