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.

In russian babel, it's possible to write << to get a russian opening quote character. However, some fonts that have such character (like the one provided by anttor package) don't use that and end up with ugly output like << this is my quote>>. I tried making < active and saying something like

%\def << {\guillemotleft}%

but making < active messes the occasions where it is used not as a part of <<. I tried to search where << is defined in babel, but couldn't find it. So, is there an elegant way to make a sequence if characters active, s that one can \def them? Or, perhaps, there is a much more elegant solution to my problem of which I don't know...

share|improve this question

1 Answer 1

I suspect that << is defined as a ligature in those fonts, similarly as fi (to produce one glyph) or dashes -- and ---.

\makeatletter
% store `<` with the original catcode
\let\old@lt<
\let\old@gt>
% make `<` active
\catcode`\<\active
\catcode`\>\active
% test for 2nd `<` and if present, print quotation marks and gobble the 2nd `<`
\def<{\@ifnextchar<{\guillemotleft\@gobble}\old@lt}
\def>{\@ifnextchar>{\guillemotright\@gobble}\old@gt}
\makeatother

This is 100% surely breaking in beamer and probably corrupting the < and > table column specifications.

share|improve this answer

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.