I have a document which is compiled under LuaTeX (a requirement of another package in the document, but not one which affects the fonts) and makes use of the romande
font package. My usual editor (TeXShop) is setup for utf-8 text entry and automatically changes dumb keyboard quotes to smart typographical quotes for me. However, since romande
is a T1 encoded font, it doesn't understand these smart characters but expects `` and '' to be used. Now, while I can turn off the smart quote replacement feature in TeXShop, it's slightly annoying to have to switch back and forth as I change between documents using this font package and ones which don't. To get around this I came up with the idea of turning the smart quote characters into active characters and then defining macros for those characters which insert the ASCII sequence which will result in the proper TeX ligature:
\catcode`\’=\active
\def’{'}
\catcode`\‘=\active
\def‘{`}
\catcode`\“=\active
\def“{``}
\catcode`\”=\active
\def”{''}
Now, I normally don't make much use of active characters like this, so I'm not familiar with what limitations/problems this technique might have. Can someone more familiar with TeX enlighten me as to whether this is a good idea or whether it will just create more headaches down the road than simply remembering to turn the smart quotes replacement feature on and off?
MWE:
\documentclass{article}
\usepackage{romande}
\catcode`\’=\active
\def’{'}
\catcode`\‘=\active
\def‘{`}
\catcode`\“=\active
\def“{``}
\catcode`\”=\active
\def”{''}
\begin{document}
Some `text' involving ``dumb'' quotes.
Some other ‘text’ making use of “smart” quotes.
\end{document}
fontspec
and standaed luatex conventions – David Carlisle Dec 13 '17 at 18:58fontspec
. – rpspringuel Dec 13 '17 at 19:32