In LaTeX documentation I read that only : # $ % & ~ # _ ^ \ { } are special characters. From that I deduce that all other characters from the input character set are taken literally, i.e. appear as themselves in the output. But apparently many if not most of the other ASCII punctuation characters also can serve as special characters. E.g. the input character sequence -- (two 'HYPHEN-MINUS' U+002D) become one 'EN DASH' U+2013 in the output, !` ('QUESTION MARK', 'GRAVE ACCENT') becomes one 'INVERTED EXCLAMATION MARK' U+00A1.

At least currently I don't know the exhaustive list of such special sequences which are not taken literally. I deem it difficult to never accidentally write a sequence of characters (other than : # $ % & ~ # _ ^ \ { }) which I mean to be taken literally but which really is interpreted as special sequence. What makes things worse is that I can potentially accidentally mess up an existing document by loading a package. E.g. for the sake of argument say my document contains the sequence "o which I really mean literally. When I now load the babel package for German, that sequence becomes the character 'LATIN CAPITAL LETTER O WITH DIAERESIS' U+00D6 without my knowing because I didn't knew that the package also, among the things I was really interested in, introduces that special sequence.

I don't want to use \verb|...| & Co. for every punctuation character sequence I am not absolutely sure that it is interpreted literally because I guess I had to use verb|...| too many times then.

How can I know in general and for sure which characters from my LaTeX document will appear literally, as intended, in the output? Or at least, where can I find an exhaustive list of special character sequences which are not taken literally?

  • Does thos not depend on the input and/or font encodings as well as on the editor encodings? – user31729 Nov 7 '14 at 16:58
  • The list of babel special combinations would be very long. – egreg Nov 7 '14 at 17:22
  • this is something that comes with time. it's a good idea to get in the habit of carefully reading your output, not just assuming that it's what you intended. – barbara beeton Nov 7 '14 at 19:39
  • Could you say for what purpose you are using things like "o which you want interpreted literally? I'm wondering if you are trying to do something which ought to be done in another way (or, at least, could more easily be done in another way). Usually, the substitutions TeX makes are what you want and expect - they are not supposed to make life harder and don't usually do so except in quite atypical scenarios. – cfr Nov 7 '14 at 21:16
  • crf - My question is of general nature, the examples were just made up to explain my question. I am just afraid that I use a special sequence by accident without knowing it. And I also don't like the idea from a markup language theoretical standpoint that apparently I never really can know whether a sequence of characters is taken literally or is interpreted specially. – Florian Kaufmann Nov 8 '14 at 7:52

This depends on the font encoding in use. For example in the classic OT1 font encoding < and > do not appear as themselves but as inverted ! and ?. -- becoming an en-dash is a ligature, implemented within the font, the same way that ff becomes an ff ligature. So your list of which characters print as themselves may or may not include f depending on how you define things. It is possible to turn off all babel shorthands if you wish to do that but other packages may make characters active for example it is quite common to set up | so that | zzzzz | is a shorthand for \verb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.