Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the difference between the symbols with decimal indices #45 and #127 from the T1 encoding? Character #45 seems to be the ordinary hyphen, but what about #127? The en-dash and em-dash are at positions #21 and #22, respectively.

This excellent answer to my question about which ligatures are contained in a font drew my attention to this matter. According to it, TeX will build a "ligature" that looks like a hyphen (presumably either #45 or #127) out of the character sequence #45-#127. (Why does it do that?)

share|improve this question

1 Answer 1

up vote 12 down vote accepted

Character 127 (hexadecimal "7F) is a "protruding hyphen", as is easily proved by the following test document.

\documentclass{article}
\usepackage[T1]{fontenc}

\showboxbreadth=\maxdimen % show completely the box contents
\showboxdepth=\maxdimen   % at every inner level

\begin{document}
\setlength{\parindent}{0pt} % just for the example

\sbox0{\char"2D}\the\wd0

\sbox0{\char"7F}\the\wd0

a\char"2D b

a\char"7F b

\begingroup
\setlength{\fboxsep}{-\fboxrule}
\fbox{\char"2D}\quad\fbox{\char"7F}
\endgroup

\sbox0{\char"2D \char"7F }\showbox0

\end{document}

Here is the output

enter image description here

It's evident that the normal hyphen is slightly asymmetric with respect to its bounding box and that the "protruding hyphen" has most of it outside its bounding box.

By setting \hyphenchar\font="7F (when the current font is T1 encoded) one gets these consequences

  1. Explicit hyphens (the normal character "2D) won't insert discretionaries, nor will the ligatures starting with it

  2. The hyphenation algorithm, when applied, would use the "protruding hyphen".

  3. If the language establishes hyphenation rules where the normal hyphen can be used as break point, there wouldn't be two characters: the - followed by the "protruding hyphen" added by the hyphenation procedure would be merged into a single protruding hyphen.

The last point is realized by the second ligature

(LABEL O 55)
(LIG O 55 O 25)
(LIG O 177 O 177)
(STOP)

pertaining to character "octal 55" (that is, decimal 45 and hexadecimal "2D), which is shown in the last bit of the example. The log file reports

> \box0=
\hbox(4.3045+0.0)x1.66626
.\T1/cmr/m/n/10 ^^? (ligature -^^?)

This character was included in the T1 encoding when microtypographical features were not even dreamt of (1990); as far as I know, it has never been really exploited. See M. Ferguson's article on TUGboat for more information.

share|improve this answer
    
Amazing! I couldn't imagine that such facts could be possible. Thanks. –  Sigur Apr 7 '13 at 12:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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