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.

Ulrike Fischer showed how Linux Libertine's special ligatures are accessible. Even though she also pointed me at a chapter of the LaTeX Graphics Companion, I'm not really sure how to get these ligatures automatically, probably because I'm by no means well versed in fonts and I'm not likely to ever be. What I'm eventually looking for is something like

\newligature{tt}{\libertineGlyph{uniE03C}}

which assigns the glyph at 0xeo3c (tt-ligature) to the input letter combination tt.

I'm assuming there is no package that can do this, but if it's possible, this could be a great addition to the list of packages that originated at tex.sx! Perhaps somebody who knows their way around the guts of (La)TeX could try to imitate the way the standard ligatures like ff are produced?

The code points of the Libertine ligatures are listed on page 87 of Libertine's German documentation for XeTeX, but I hope this solution will work for about any font. Obviously, using the ligatures with XeLaTeX is trivial, but I like being independent of fonts installed on my system, and with the solution desired here, you could specify exactly which ligatures you want.

share|improve this question
    
You can create a virtual font with a tt ligature. Some work, but IMO the only way to do that with these pesky 8-bit systems :) –  topskip Oct 9 '11 at 12:39
    
Now, where is the obligatory ConTeXt \translateinput or LuaLaTeX solution yet? –  Andrey Vihrov Oct 9 '11 at 12:52
    
@AndreyVihrov doncherry asked explicitly for pdftex. It should be easy to create a virtual font with LuaTeX on the fly so a TeX only solution is possible. –  topskip Oct 9 '11 at 13:16
    
@Patrick: I don't quite understand. Is LuaTeX "TeX only"? And there's "TeX only" that doesn't work with pdfTex? Generally, I guess I wouldn't mind a LuaTeX solution if it's impossible with pdfLaTeX. –  doncherry Oct 9 '11 at 13:21
3  
@doncherry PDFTeX can't do this, it has to be done with virtual fonts. LuaTeX can create virtual fonts during a TeX run and use them directly. Perhaps I'll make a proof-of-concept. –  topskip Oct 9 '11 at 13:38
add comment

2 Answers 2

up vote 11 down vote accepted

This is not possible at LaTeX level; ligatures are defined in the .tfm file for the font and there's no way to change them (pdftex has only the possibility of clearing the list of ligatures for a particular font).

The strategy of making the t active in order to check if another t follows can work for limited amounts of text only, as it would break all command names containing a t.

share|improve this answer
add comment

The luatex-proof-of-concept I have promised is easier than I thought, because:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\begin{document}
Whatt?
\end{document}

already uses the tt-ligature.

But assume you want the fancy s_t ligature without enabling the Ligatures=Historic feature in fontspec, you can use a .fea-file:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[FeatureFile=myligatures.fea]{Linux Libertine O}
\begin{document}
strict
\end{document}

where the myligatures.fea is:

languagesystem DFLT dflt ;
languagesystem latn dflt ;
feature liga {
   sub s t  by s_t ;
} liga ;

This is an example (first line with regular ligatures + the myligatures.fea file and the second line with the Ligatures=Historic fontspec feature:

feature file fontspec

share|improve this answer
add comment

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.