2

I just ran into the fact that the ASCII vertical bar character is (unexpectedly and inexplicably) rendered as a long dash in LaTeX. So presumably there could be other such characters that aren’t “special” (in the sense of being non-text “control“ characters when unescaped) yet are rendered by LaTeX in a totally non-standard way

Is there a specification somewhere that lists these “non-standard rendering” characters?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
NikS
  • 121
  • 1
    Welcome to TeX.SE. Let me guess: the "vertical bar character" is being rendered in text mode, not math mode, right? (Other such characters are > and <.) To fix this issue, run the instruction \usepackage[T1]{fontenc} in the preamble. BTW, nothing in LaTeX is "inexplicable". The explanation can be challenging at times, though... – Mico Apr 04 '23 at 05:52
  • You should read about the different font encodings in TeX, how glyphs in fonts are mapped using TeX and also about the differences of the different TeX engines (PDFLaTeX, XeLaTeX, LuaLaTeX). If you use PDFLaTeX, | is parsed as codepoint 7C which results in an em-dash for the traditional Computer Modern text fonts (but maybe not for other fonts). See as well Q193216 . – Jasper Habicht Apr 04 '23 at 07:00
  • the default (old) encoding OT1 allows only 128 glyphs per fonts, and to squeeze all needed glyphs into the fonts the fonts have a number of oddities. The best is to use either an unicode engine (lualatex) or to switch to a larger encoding with \usepackage[T1]{fontenc} – Ulrike Fischer Apr 04 '23 at 09:08

0 Answers0