1

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}
  • 1
    using T1 encoded fonts in luatex is tricky (you have to disable almost everything to make things work more like pdftex) but as far as I can see that font set is available as opentype 1001fonts.com/romande-adf-font.html so you can use fontspec and standaed luatex conventions – David Carlisle Dec 13 '17 at 18:58
  • I see no real problem with this. – egreg Dec 13 '17 at 19:13
  • @DavidCarlisle, I feel a bit foolish now. The project I'm using this font on required me to install those font files in order to make them available to other programs whose results needed to look consistent with my TeX documents. I just never thought of switching the TeX document over to fontspec. – rpspringuel Dec 13 '17 at 19:32
2

You can use the csquotes package:

\documentclass{article}

\usepackage{csquotes}
\MakeAutoQuote{“}{”}
\MakeAutoQuote*{‘}{’}

\usepackage{romande}


\begin{document}

Some `text' involving ``dumb'' quotes.

Some other ‘text’ making use of “smart” quotes.

\end{document}

enter image description here

Be aware that T1-encoded fonts and lualatex don't go well together, hyphenation can be wrong and not every symbol will work. So use it with care.

  • the catcode settings will work in utf8 in luatex (as it's still a single character then) although you are correct that more or less everything else will be wrong... – David Carlisle Dec 13 '17 at 18:55
  • It's unclear to me what the antecedent to "It" is at the beginning of your answer. Do you mean my idea won't work if the file is utf-8 encoded, or that your answer won't work if the file is utf-8 encoded? – rpspringuel Dec 13 '17 at 18:56
  • Sorry. I meant if won't work if the file is utf8 encoded but was wrong as David corrected already. But csquotes is nevertheless a good idea. – Ulrike Fischer Dec 13 '17 at 18:58
1

Loading \usepackage[utf8]{luainputenc} also solves the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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