7

I have this code:

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{DejaVu Serif}
"Heading"
\end{document}

(run with LuaLaTeX, texlive2105) which gives this result:

heading with italic quotes

But I'd like to have upright quotes. The font contains the upright quotes (glyph id 5), so it should be technically possible.

  • You mean ‘typewriter quotes’? – Bernard Jun 26 '16 at 12:24
  • @Bernard yes, the ones that look like an equal sign rotated 90 degrees. – topskip Jun 26 '16 at 12:30
  • @topskip \rotatebox{90}{=} ;-) – Henri Menke Jun 26 '16 at 12:31
  • @topskip I image this to be quite hard, because in recent LuaTeX/luaotfload the syntax for font adjustments changed heavily and the usage of feature files has been abolished. If you find out how to replace single glyphs, I'd be happy if you write an answer in this thread of mine. – Henri Menke Jun 26 '16 at 12:34
  • 1
    Copy ``Heading". See if that works – user 170039 Jun 26 '16 at 15:04
3

You want to disable the automatic Ligatures=TeX feature:

\documentclass{article}
\usepackage{fontspec}

\defaultfontfeatures[\rmfamily]{}
\setmainfont{DejaVu Serif}

\begin{document}

"Heading"

\end{document}

enter image description here

  • This also disables -- and --- (and perhaps others I'm not aware of). – Henri Menke Jun 26 '16 at 12:44
  • @HenriMenke Yes, of course. If one wants only some TeX standard ligatures, a new map file is needed. – egreg Jun 26 '16 at 12:47
  • I knew about the TeX ligatures, but I did not know that they were activated by default and how to disable them. This ansers my question (including the -- and --- ligatures). Thanks! – topskip Jun 26 '16 at 13:15
6

With the new luaotfload syntax for the definition of extra font features (from v2.7 on, I guess). Basically, we condone ligaturing the " to , but then have a font feature which substitutes back to ". It might also be possible to hook into the ligaturing callback to prevent this particular ligature.

Disclaimer: I have no idea what I'm doing.

\documentclass{article}
\usepackage{fontspec}
\directlua{
fonts.handlers.otf.addfeature {
    name = "altquot",
    {
        type = "substitution",
        data = {
            ["”"] = "\string\"",
        }
    }
}
}
\begin{document}
\setmainfont[RawFeature=+altquot]{DejaVu Serif}
"Heading" -- ---
\end{document}

enter image description here

  • This also disables \enquote{fobar} (package csquotes). – topskip Jun 26 '16 at 20:13
  • @topskip Well, it simply substitutes all occurences of to ", no matter where they come from. It is not a question of input, but a question of output. The substitution is applied on typesetting, i.e., everything that typesets as will be converted to ". – Henri Menke Jul 4 '16 at 7:22
3

@topskip: Start using ConTeXt again! Other TeX ligatures (-- and ---) are enabled by default, quotes are not!

\setupbodyfont[dejavu]
\starttext
"Heading"
\stoptext

enter image description here

  • I like ConTeXt and this project would benefit from using ConTeXt. But I am not the only one involved in it, I won't be able to persuade others to participate... – topskip Jun 26 '16 at 20:15

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.