zips icon indicating copy to clipboard operation
zips copied to clipboard

Make the spec build correctly with LuaLaTeX and XeLaTeX

Open daira opened this issue 6 years ago • 4 comments

The protocol spec does build under LuaLaTeX and XeLaTeX, using the -lualatex or -xelatex option to latexmk. (XeTeX doesn't support the interpolate option to \includegraphics, but it builds if that is removed.) However the output has some problems:

  • line spacing is consistently too tight;
  • some fonts are substituted (with knock-on effects for spacing);
  • the "square plus" and "diamond plus" operators used for signature key homomorphisms are much too small;
  • some other constructed symbols have positioning problems, e.g. the R that should be above some arrows is too low;
  • \introlist doesn't seem to work;

Building correctly with LuaLaTeX and XeLaTeX is useful not so much for its own sake, but because some (not all) of these issues probably indicate areas where we are relying on bug-for-bug compatibility with pdflatex.

daira avatar Jul 08 '19 07:07 daira

interpolate no longer seems to make any appreciable difference, so I've removed it. I think that when I originally added it, the images were too low resolution, and/or pdfsizeopt (which is no longer used) was reducing them too much.

daira avatar Jul 08 '19 08:07 daira

The font substitutions were fixed by adding \fontencoding{T1} to places where I explicitly select the font using \selectfont, a described at https://tex.stackexchange.com/a/426300/78411 . (As pointed out by David Carlisle here, XeLaTeX is designed for use with TU fonts and so T1 works less well for things like hyphenation, but as it happens, I don't need line-breaking anywhere I'm using \selectfont.)

This didn't work for the use of \fontseries{b} in the \textbnx macro, but \textbnx was negligibly different fom \textbf so I replaced it with the latter.

daira avatar Jul 08 '19 16:07 daira

The rest of the spacing and size issues seem to be due to the main document font, Quattrocento, being given incorrect metrics by the quattrocento package when loaded by LuaLaTeX or XeLaTex. In LuaLaTeX this can be worked around to some extent as described here. I've added a variant of this workaround, and now the spec mostly builds correctly in LuaLaTeX.

daira avatar Jul 08 '19 18:07 daira

Further changes (4eed11f9256e176ccf4c20a8977e2f9e43d1373e) were needed to make this work under TeXLive 2019. (The -lualatex and -xelatex options apparently regressed and no longer work, so alternative options were required.)

daira avatar Jul 12 '19 16:07 daira