# How can I typeset a quote directly above a period?

Is there a way to typeset a right double quote directly above a period (if the quotation ends with a period)? Not to the left (for example, ."), not to the right (for example, ".), but directly above. The photo below is an example from Trees, maps and, theorems by Jean-luc Doumont.

• i know i've seen this somewhere ... can't find it in tex.sx, so maybe in tugboat ... basically, as i remember, one or the other was '\rlap'ped over the other, with some jiggering of the space until it looked good to the person doing the jiggering. (and one could do lots worse than follow jean0luc's example -- he's a "perfectionist's perfectionist", with a really good eye.) – barbara beeton Sep 23 '14 at 20:49
• It might be useful to create a macro, say \quo{…} that enquotes the content and does checks and behaves correctly depending on the last character. – Manuel Sep 23 '14 at 21:02
• Does the example text use this technique throughout or only (as shown) as an emergency measure att the end of a line? – Hagen von Eitzen Sep 24 '14 at 10:01
• @DavidRicherby -- when a period (logically) goes outside a quote, the visual space before the following text is very large, and upsets the "uniform gray" that is desirable on a well-composed and printed page. it probably doesn't matter so much in a math text, which is hopeless in that regard anyway, but in "straight text" it is pretty obvious. i'm sure you'll find this technique used in well-scribed manuscripts, before the restrictions of hard metal interposed themselves. – barbara beeton Sep 24 '14 at 13:23
• @HagenvonEitzen In this book, the technique is not only used at the end of a line but also in the middle of a line (the second paragraph of page 59, for example, if you have the book). – argentpepper Sep 24 '14 at 17:07

One way is to add some negative "kerning" between the quotation mark and the period:

\documentclass{article}
\begin{document}
Here is an unkerned quotation mark: \dots''.

Here is a kerned quotation mark: \dots''\kern-0.5em.
\end{document}


The TeX command \kern-0.5em inserts a negative space between the quotation mark and the following period. You will have to play a little with the exact spacing, but using a measure like -0.5em which will scale with the font size should work reasonably well.

# Automatic Kerning with LuaLaTeX

As others have suggested, you can do this with macros, but if you want to do this automatically, you appear to need to include this kerning information in the font specific kerning table. This can be done with LuaLaTeX as follows:

First create a file: Palatino.fea

languagesystem DFLT dflt;
languagesystem latn dflt;
feature kern {
pos  \quotedblright \period -1000;
} kern;


Now load this font information using fontspec:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[FeatureFile=Palatino.fea]{Palatino}

\begin{document}
Here is an automatically kerned quotation mark: \dots''.

Here is a manually kerned quotation mark: \dots''\kern-0.5em.
\end{document}


Note that you need to compile this with lualatex now, and that you will need to add the custom kerning information for every font you would like to use.

• This answer makes much more semantic sense than approaches based on \stack, \rlap, etc, I think. Logically, the period follows the close quotes; they are not to be read as a stack, they simply get placed as a stack, for visual reasons. And that’s exactly what kerning is about: altering the placement of characters, without affecting the intended logical sequence. – Peter LeFanu Lumsdaine Sep 24 '14 at 11:42
• This also works with character protrusion specified using the microtype package; both the period and the right double quote protrude into the right margin (this is what you see in the example photograph as well). – argentpepper Sep 24 '14 at 17:27
• Too bad this can't be done automatically with pdflatex, though (tex.stackexchange.com/a/10457/4430). – argentpepper Sep 24 '14 at 17:30
• although the closing quote appears to be "above" the period, if you look closely at the original, the positioning is very precise, so that the leading edge of the quote does not start to the left of the leading edge of the period. the kerning distance between the glyphs or leftward shift of the quote is probably font-specific, and maybe even size-specific. – barbara beeton Oct 29 '14 at 19:50
• @barbarabeeton True. I think part of the reason this works is because the period is larger than the dots in the ellipses, which makes it clear that the final dot is actually the sentence end. My example is certainly not properly tuned, but I suspect that this type of treatment might look funny with a font like Palatino where all dots are the same size. In any case, careful consideration must be applied in determining the kerning. – mforbes Oct 30 '14 at 18:18

I would set this merely as an \rlap-ed period (or, for LaTeX's sense, \makebox[0pt][l]), wrapped in a macro:

\documentclass{article}
\newcommand{\qperiod}{\rlap{.}}
\begin{document}
Some text: \dots''.

Some text: \dots''

Some text: \dots\qperiod''
\end{document}


The macro-wrapping allows for modification globally, when needed.

Here I use a stack. The stacktype is either "L" for Long or "S" for Short (default). If "L", the stacking "distance" is from baseline to baseline. By setting to 0pt, it says that the two components share the same baseline (in contrast, a short stack distance is the vertical gap between the top of the "anchor" and the bottom of the stacked item). The stackalignment defines horizontal alignment (default c=center). Here, I set it for left alignment.

\documentclass{article}
\usepackage{stackengine}
\renewcommand\stacktype{L}
\renewcommand\stackalignment{l}
\begin{document}
by \dots\stackon[0pt]{.}{''}
\end{document}


The same result can be achieved, bypassing all the parameter settings, by using the generic stackengine macro with 8 mandatory arguments:

by \dots\stackengine{0pt}{.}{''}{O}{l}{F}{F}{L}


The eight mandatory arguments are:

• stacking distance
• anchor item
• stacked item
• O(ver) or U(nder) stack
• l(eft) c(enter) or r(ight) horizontal alignment
• T/F for "quietstack" ("T" means created but not printed)
• T/F for "useanchorwidth" ("T" means the anchor width determines the overall stack width)
• S(hort) or L(ong) stack
• take a closer look at the original. the leading edge of the dot at the left of the closing quote is exactly aligned with the leading edge of the period. in your example, the quote is just a bit to the left. – barbara beeton Oct 29 '14 at 19:21
• @barbarabeeton That is true of all the answers given. I presume there is a font-dependence aspect to it. My period is left-aligned with the '' string, but how the font-designer lays those things out [horizontally] can vary. – Steven B. Segletes Oct 29 '14 at 19:29