tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

Spacing with `parskip` package not consistent with xelatex output

Open bjornbm opened this issue 6 years ago • 9 comments

When using the parskip package the spacing between section header and text differs compared to xelatex. Without parskip the whitespace is identical to the xelatex output. I assume this a bug?

Here is a test document (the papersize is there to make both tools produce the same output size, see #126):

\documentclass{article}
\usepackage[a5paper]{geometry}
\usepackage{parskip}

\begin{document}

\section{Hello}

Some text.

\end{document}

Here is a “visual diff” of the outputs from tectonic and xelatex highlighting the difference:

diff93172

bjornbm avatar May 06 '19 20:05 bjornbm

Just in case it matters, what do xelatex --version and tectonic --version show?

spl avatar May 07 '19 06:05 spl

Tectonic 0.1.11
XeTeX 3.14159265-2.6-0.99999 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 61.1; using 61.1
Compiled with zlib version 1.2.11; using 1.2.11
Compiled with FreeType2 version 2.9.0; using 2.9.0
Compiled with Graphite2 version 1.3.11; using 1.3.11
Compiled with HarfBuzz version 1.7.6; using 1.7.6
Compiled with libpng version 1.6.34; using 1.6.34
Compiled with poppler version 0.63.0
Using Mac OS X Core Text and Cocoa frameworks

bjornbm avatar May 07 '19 07:05 bjornbm

Does this happen with the US Letter paper size? Tectonic hardcodes US Letter in some aspects that I can imagine might affect things.

pkgw avatar May 09 '19 01:05 pkgw

If I comment out the geometry package I get US letter paper from tectonic and A4 paper from xelatex (#126), but it doesn't affect this spacing difference. If I \usepackage[letterpaper]{geometry} xelatex also produces letter but no difference for spacing. However…

bjornbm avatar May 09 '19 08:05 bjornbm

I took a look at the parskip documentation and decided to try the [=v1] option described in § 3 Differences to the original package. With this option xelatex produces the same output as tectonic (increased spacing between heading and test).

3 Differences to the original package

If the package is used without any options or just with the option parfill it behaves like the earlier version, except that now the spacing around headings is also adjusted (not adding extra \parskip). If this is not desirable when processing an old document it can be avoided by explicitly requesting version v1 as follows:

 \usepackage{parskip}[=v1]

Of course, the new options, etc. are then also not available.

Is tectonic using the older version of parskip? Here is the version info that should be applicable to my xelatex (same as on ctan):

$ tlmgr info --only-installed parskip
package:     parskip
category:    Package
shortdesc:   Layout with zero \parindent, non-zero \parskip
longdesc:    Simply changing \parskip and \parindent leaves a layout that is untidy; this package (though it is no substitute for a properly-designed class) helps alleviate this untidiness.
installed:   Yes
revision:    49730
sizes:       run: 13k
relocatable: No
cat-version: 2.0c
cat-date:    2019-01-16 16:42:25 +0100
cat-license: lppl1.3c
cat-topics:  layout parshape
cat-contact-bugs: https://github.com/FrankMittelbach/fmitex/issues
cat-contact-repository: https://github.com/FrankMittelbach/fmitex
collection:  collection-latexrecommended

tectonic on the other hand appear to use a 2001 version of parskip. Here is the head of $HOME/Library/Caches/Tectonic/files/b4/0f5523c2a160bc4586a0f928be28213dab3963e49ae405a41f08989f5f699c on my system:

% parskip.sty; last edited by Robin Fairbairns ([email protected]),
%              derived from:
%
% This is PARSKIP.STY by H.Partl, TU Wien, as of 19 Jan 1989.
%
% Package to be used with any document class at any size.
% It produces the following Paragraph Layout:
%     Zero Parindent and non-zero Parskip. The stretchable glue in \parskip
%     helps LaTeX in finding the best place for page breaks.
%
% This package is no more than quick fix; the `proper' way to achieve
% effects as far-reaching as this is to create a new class.  An
% example class is to be found in the ntgclass set: artikel3.cls

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{parskip}[2001/04/09 non-zero parskip adjustments]

So I guess that pinpoints and explains the discrepancy. Is an update to the newer version on the roadmap?

bjornbm avatar May 09 '19 09:05 bjornbm

Great find! I believe tectonic is providing TeX Live 2018 packages (via https://github.com/tectonic-typesetting/tectonic-staging). Could that account for the different parskip version?

spl avatar May 09 '19 09:05 spl

Also, since TeX Live 2019 was released in April, I'd like to try updating the package set (unless somebody else gets around to it first). But I've been in the middle of another project that's been keeping me busy at the moment.

spl avatar May 09 '19 09:05 spl

I think you are right regarding the staging. http://git.preining.info/texlive/ brought in the parskip rewrite in 2018-09-12, and I understand the tectonic packages haven't been updated too frequently and maybe it was just missed by this update.

Getting TeX Live 2019 parity would be great of course.

bjornbm avatar May 09 '19 09:05 bjornbm

Yes, we are due for an update! I am also pretty slammed these days, but @spl, if you encounter any issues with the docs about how to create a new TeXLive bundle, please flag me and I'll prioritize helping. I can also undertake the process myself, but it would actually be very nice to have someone else do it to uncover gaps and assumptions in the framework.

pkgw avatar May 09 '19 15:05 pkgw

Hey @bjornbm! Our TeX Live bundle is version 2022 as of tectonic 0.11.0, I'm running your code through tectonic and xelatex and can't see any spacing difference so I'd consider this solved, would you give it a try and see how it goes? Thx! 💛

Neved4 avatar Oct 07 '22 13:10 Neved4

@bjornbm How goes, any news on this?

Neved4 avatar Oct 29 '23 22:10 Neved4

Sorry, I haven't used tectonic in a while so haven't tested (the project I was working on completed). I'm not going to install tectonic right now to test, but I think it is fair to assume that the issues is resolved if tectonic is not on TeX Live 2022 and you are not seeing any difference. Thanks!

bjornbm avatar Oct 30 '23 08:10 bjornbm