3

I have a XeLaTeX document that uses Palatino Linotype as main font, which looks quite nice, and I'm using the csquotes package to effect proper quotation, which works; however, at the same time this looks horrible due to Palatino's "distinctive" choice in glyphs.

Is there a way to make csquotes use a different font for its quotation replacement? I went through the manual but couldn't find anything obvious (if it requires overriding environments or writing plain TeX, that's a thing I've not done in over a decade and I no longer have any idea what would be involved)

Reduced example:

\documentclass[11pt, lettersize, oneside]{book}
\usepackage{tocloft}
\usepackage{relsize}
\usepackage{fancyhdr}

\usepackage{csquotes}
\MakeOuterQuote{"}

\pagestyle{plain}
\usepackage{xltxtra}
\setmainfont{Palatino Linotype}
\usepackage[b5paper, bindingoffset=0mm, inner=23mm, outer=23mm, top=21mm, bottom=24mm]{geometry}
\usepackage[xetex, pdfborder=0 0 0]{hyperref}

\begin{document}

    The first words were: "these glyphs are not particularly good looking.",
  and one had to agree. They looked all angular and terrible.

\end{document}

And corresponding screenshot:

enter image description here

Personal notions of aesthetics aside, for the purposes of this particular document Palatino's quotation are quite poor, and I am looking for a way to use a different font specifically only for these quotation glyphs.

  • certainly, I've added a reduced example to the question. The problem is that it doesn't do anything odd with the fonts, so it just uses the font set up as main font. Which has terribly looking quotation glyphs, and I want it to use a different font specifically for the quotes csquotes introduces. – Mike 'Pomax' Kamermans Mar 22 '17 at 20:48
  • I (and probably many others) don't have Palatino Linotype: can you add a scrrenshoot? (Using texgyrepagella-regular.otf, the TeX Gyre Palatino clone, looks OK.) – Joseph Wright Mar 22 '17 at 20:52
  • Ah, perhaps you mean you don't like the glyph shape for quote marks in Palatino ... I have a feeling that's come up before. – Joseph Wright Mar 22 '17 at 20:58
  • Yes, I believe that's what I said in the post ("Is there a way to make csquotes use a different font for its quotation replacement?"). I have the same feeling, but no amount of google or stackexchange searching yielded information as to how to effect different glyphs – Mike 'Pomax' Kamermans Mar 22 '17 at 20:59
  • @JosephWright -- you're right! For an earlier posting on the topic at hand, see Palatino displays wrong opening quotes. – Mico Mar 22 '17 at 21:16
  • @Mico no, that is a completely unrelated issue, asking about how to fix the wrong glyphs from the right font being used. In my case, the quotes that csquotes selects are perfectly correct (the opening and closing quotes are exactly what they should be) but they look horrible and I need a different font used specifically for the quote replacement effected by csquotes. – Mike 'Pomax' Kamermans Mar 22 '17 at 21:29
  • 1
    @Mike'Pomax'Kamermans - Please re-read the posting to which I provided a link. In both your current posting and in the earlier posting, the main issue is that the OPs don't like the opening quote marks (and possibly the closing quote marks too). My personal view is that if you choose Palatino for your document, you need to accept all of its aspects -- including the shape of the quotation marks. If, after a while, you still can't stand Palatino's quotation marks, do start looking for a different font. Aldus is quite similar overall to Palatino, but has more dominant-looking quote marks. – Mico Mar 22 '17 at 21:56
  • @mico I did - the question you link to is about "I've realized the opening quotes are all rendered as closing quotes", and the accepted answer is "use TeX style backtick-and-double-singles quotation". Neither of those are applicable to this question. Did you link the wrong question? As for "if you pick X, you're stuck with it", that's patent nonsense. I use XeLaTeX exactly because it puts me in control of typesetting: if I don't like an aspect of a typeface, XeLaTeX through packages like fontspec, ucharclasses, etc. let me overrule them. – Mike 'Pomax' Kamermans Mar 22 '17 at 22:14
  • 1
    @Mike'Pomax'Kamermans - "Did you link the wrong question?" Absolutely not. The earlier posting starts off with the OP being confused about the shape of Palatino's opening quotation marks (and thinking that they're the same as the closing quotation marks). Eventually, though, the fog clears and everyone agrees that Palatino's quotation marks are, well, quite unique and distinctive. – Mico Mar 22 '17 at 22:19
  • fair point - and they are indeed rather distinctive. – Mike 'Pomax' Kamermans Mar 22 '17 at 22:28

4 Answers4

5

The code in csquotes works on the basis that language-dependent quotation styles map to logical mark up for quotes (see csquotes.def). In particular, for English the standard mapping is to use \textquotedblleft and \textquotedblright as the quote symbols. One could therefore redefine these to use some some font/symbol combination. Could do with more refinement, but for example

\documentclass{article}

\usepackage{csquotes}
\MakeOuterQuote{"}
\usepackage{fontspec}
\setmainfont{texgyrepagella-regular.otf}
\DeclareTextCommand{\textquotedblleft}{TU}{%
  {\fontfamily{ptm}\selectfont ``}%
}
\DeclareTextCommand{\textquotedblright}{TU}{%
  {\fontfamily{ptm}\selectfont ''}%
}
\begin{document}
    The first words were: "these glyphs are not particularly good looking.",
  and one had to agree. They looked all angular and terrible.

\end{document}

would work.

(Note that this is really nothing specific to csquotes, which quite deliberately uses logical markup for the quote symbols taken from a lower level.)

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • I've not really tided up the encoding, etc., but hopefully the 'point of attach' is clear. – Joseph Wright Mar 22 '17 at 21:22
  • Very much so: this is perfect, thank you very much. – Mike 'Pomax' Kamermans Mar 22 '17 at 21:41
  • This will change the quotes also for the sans and the mono family. Imho it would be better to declare a "TU-for-pagella"-encoding with such declarations and use it only for the main font. – Ulrike Fischer Mar 22 '17 at 21:46
  • 1
    It's just as well that you didn't post a screenshot to reveal the resulting crime against typography. Using Palatino as the text font together with Times Roman-based quotation marks looks all wrong... – Mico Mar 22 '17 at 22:21
  • @UlrikeFischer good point, although in this case the document is a purely plain text document, so even if additional families are affected, this won't be visible in the rendered text itself. If there's a more targeted form (not specific to TeX Gyre Pagella of course) that you would recommend, I will be happy to accept a rewritten form as answer. – Mike 'Pomax' Kamermans Mar 22 '17 at 22:35
  • 2
    +1 for the answer because it does what it wants. But I really want some sort of booster to assent to Mico's complaint that this is a recipe for crimes against typography. Mixing quotes from one font and letters from another is crazy. Are you going to change the commas? The apostrophes? A font hangs together as a whole, and you're about to make some sort of honey and pickle sandwich. – Paul Stanley Mar 22 '17 at 22:58
  • @JosephWright would you also happen to know which command is used for the apostrophe? (I tried \textquoteright and \textquotesingle but unlike the double quotes these had no effect) – Mike 'Pomax' Kamermans Mar 24 '17 at 00:25
  • Not able to use this for \textquoteright and \textquoteleft in the british style. It produces weird output. – Niranjan Apr 13 '23 at 06:01
1

There is more than one "Palatino" font out there. The one you appear to have picked -- "Palatino Linotype" -- indeed has the "squattest" and "stubbiest" (short, barely curved) double-quotation marks among the various Palatino candidates. Not only that, it's also the most cramped-looking of all Palatino variants I'm familiar with.

Before you engage in what amounts to a type crime spree, by mixing-and-mismatching quotation marks from other font families, I believe you owe it to yourself to consider other fonts that are either in the Palatino clan or are somewhat recognizable as relatives. The following screenshot shows six candidates, starting with Palatino Linotype (your current favorite); all font specimens are scaled so that they have the exact same x-heights.

enter image description here

As this screenshot demonstrates (I hope...), there is quite some variation among the fonts' double-quotation marks. If you really can't stand the double-quotation marks of Palatino Linotype, you may want to contemplate making a switch to either Palatino nova or to Aldus, or, if you feel really bold, to Dante.

% !TeX program = xelatex
\documentclass{article}
\usepackage{fontspec,csquotes}
\newcommand\hello{\enquote{Hello World}}

\begin{document}
\setmainfont{Palatino Linotype}
\hello --- Palatino Linotype (Zapf)

\setmainfont[Scale=MatchLowercase]{Palatino}
\hello --- Palatino (Zapf)

\setmainfont[Scale=MatchLowercase]{TeX Gyre Pagella}
\hello --- Pagella (Palatino clone)

\setmainfont[Scale=MatchLowercase]{Palatino nova Regular}
\hello --- Palatino nova (Zapf \& Kobayashi)

\setmainfont[Scale=MatchLowercase]{Aldus LT Std}
\hello --- Aldus (Zapf)

\setmainfont[Scale=MatchLowercase]{Dante MT Std}
\hello --- Dante (Mardersteig)
\end{document}
Mico
  • 506,678
  • 1
    @Mike'Pomax'Kamermans - I'm sorry that you're evidently unable to get the points I tried to make. Your claim, "we are in control, and we control all aspects of typesetting", is not so much a tenet as a painful parody of what TeX and friends is really all about. But, you're evidently an adult, and you can do whatever you want as long as you don't hurt others. Best wishes. – Mico Mar 23 '17 at 00:28
  • 1
    @Mike'Pomax'Kamermans - Does what you claim to be the "most basic tenet of TeX", viz., "we are in control, and we control of all aspects of typesetting", not also imply that there can be no such thing as type crime -- at least not as long as the document is typeset with (XeLa)TeX and the source code is "beautiful", i.e., "easy to read" and "clear in its intention"? I would certainly have to disagree with such a view. Incidentally, nowhere did I "demand [you] stick to a single font", as my answer gave several examples of alternatives to Palatino Linotype. Why the polemics and hyperbole? – Mico Mar 23 '17 at 07:54
  • My apologies for the headbutting - we both have very different ways of working and very different thoughts on both how one "should" use TeX and whether the integrity of typefaces should be respected. But, that's no excuse for not carefully reading what you took time for to write up. I may very well use one of these typefaces in the future, thank you for the suggestions. – Mike 'Pomax' Kamermans Mar 23 '17 at 15:25
1

As a specific-to-XeLaTeX solution, this can be done by relying on XeTeX's ability to inject active tokens between characters from specific character classes, with macro substitution for those tokens:

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{SomeFont}
\newfontfamily{\QuoteFont}{SomeOverrideFont}[Ligatures=TeX]

\usepackage{csquotes}
\MakeOuterQuote{"}

% enable inter-character token insertion and token triggers
\XeTeXinterchartokenstate=1

% A collection of active glyphs for this purpose. Assigning a class
% for characters that already belong to a class simply reassigns them.
\newXeTeXintercharclass\Quotes
\XeTeXcharclass`'=\Quotes
\XeTeXcharclass`"=\Quotes
\XeTeXcharclass`,=\Quotes
\XeTeXcharclass`’=\Quotes
\XeTeXcharclass`’=\Quotes
\XeTeXcharclass`“=\Quotes
\XeTeXcharclass`”=\Quotes

% transitions from/to Basic Latin
\XeTeXinterchartoks 0 \Quotes = {\begingroup\selectfont\QuoteFont}
\XeTeXinterchartoks \Quotes 0 = {\endgroup}

% transitions from/to word boundaries
\XeTeXinterchartoks 4095 \Quotes = {\begingroup\selectfont\QuoteFont}
\XeTeXinterchartoks \Quotes 4095 = {\endgroup}

Putting this in the preamble (or saving as some quotestyle.tex and then using \input{quotestyle.tex} in the preamble of course) results in text typeset with the main font, and formatted with smart quote replacement through csquotes but using a secondary font for the quote glyphs.

(Also note that for older versions of XeTeX, the boundary class is 255 rather than 4095)

This worked better for me than Joseph Wright's answer, as this allowed me to override more than just double qoutes, but if you need a generic every-LaTeX answer for just double quotes, his suggestion works quite well.

0

As an alternate solution to the problem of Palatino's quotation marks, I have modified Tex Gyre Pagella X to use the quotations from Tex Gyre Termes X (ie the end result is identical to Palatino with Times New Roman quotation marks), and threw in some extra Greek and Cyrillic coverage from Domitian. The result, Tex Gyre Parliamentary—so named because identical to the `Book Antiqua Parliamentary' typeface used for drafting UK legislation— can be downloaded from my Github.

It produces the following result:

\documentclass{standalone}
\usepackage{fontspec}
\setmainfont{TeX Gyre Parliamentary}
\begin{document}
    ``Hello world.'' --- \TeX\ Gyre Parliamentary
\end{document}

type in TGP

ezgranet
  • 564