tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.94k stars 160 forks source link

Tectonic defaults to US letter paper size #126

Open lluchs opened 7 years ago

lluchs commented 7 years ago

Outside of North America, it should use A4 paper per default instead :)

In the code, this decision is justified by referring to TexLive defaults:

https://github.com/tectonic-typesetting/tectonic/blob/99a028b70da778b34d740f31740049653dcc1e37/tectonic/dpx-dvipdfmx.c#L402-L407

...but a default TexLive installation actually default to A4 paper and not US letter. Apparently, it is possible to change that during installation - a configuration switch like this may work for tectonic as well?

pkgw commented 7 years ago

This might be surprising, I am actually a bit unsure as to how I want to proceed with this issue! One of my high-level goals is for Tectonic to create output that is extremely reproducible, in the sense that people running on very different computers can process the same file and get the exact same output. I am actually not very happy with the idea that two people processing the same file will get different results depending on whether their computer thinks they live in North America or not!

One relevant issue is that I don't fully understand the interaction between the engine defaults and the parameters that can be set once the TeX engine starts running. If you have a TeX document that specifies an A4 paper size in the usual way (whatever "usual" means for you), do you actually get A4 output as intended?

lluchs commented 7 years ago

A third option would be to have a paper size which is "obviously" wrong to everyone as default, so that you always have to set the paper size in your document explicitly. The main issue I have with US letter vs A4 is that it's easy to miss that you have the wrong paper size until you actually print the document. If the default document size was square or landscape, you'd immediately notice it on your screen.

If you have a TeX document that specifies an A4 paper size in the usual way (whatever "usual" means for you), do you actually get A4 output as intended?

I actually had difficulties finding the right way to do this. Some documentation suggests using

\documentclass[a4paper]{article}

...but that doesn't actually seem to do anything on both Tectonic or TexLive (it does produce A4 paper on TexLive because that's the default). On the other hand,

\usepackage[a4paper]{geometry}

...seems to work on both Tectonic and TexLive.

(You may notice that my LaTeX knowledge is mainly from copying random TeX snippets until the document looks like I want...)

drahnr commented 6 years ago

Can you maybe issue a warning if the default paper size is used? That way reproducibility is given but users also get information about which paper size is used. @lluchs ran into that trap myself - more than once.

ngirard commented 5 years ago

I wish to use Tectonic, but living in Europe, this issue is a blocker to me...

xarthurx commented 5 years ago

Coming from hacker news and tested the system. I'm a bit surprised that this issue is still not solved.

ralismark commented 3 years ago

657 adds -Z paper-size which allows the default to be changed from the command line - e.g. tectonic -Zpaper-size=a4 renders using a4 by default instead of letter.

pkgw commented 3 years ago

This new option was just released in version 0.2.0.

Neved4 commented 2 years ago

Idea: a configuration file for every project that allows a paper-size value.

This could be integrated with the current Tectonic.toml V2 architecture, and would make tectonic projects as closed bundles, so every file under a tectonic workspace can default to a config value.

Neved4 commented 2 years ago

In the TeX Live world, most classes have size options like letterpaper and a4paper, so you can directly specify it \documentclass[a4paper]{article} together with type of document.

Another choice, as @lluchs very well said, is to use a package designed for this purpose, like geometry, where you can change the paper size by passing it as a predefined parameter: \usepackage[a4paper]{geometry} and also allows you to design complex layouts and dimensions.

Finally, for any document that doesn't explicitly specify it's size, there’s a default in TeX Live for all those documents that don't explicitly tell LaTeX its paper size. This default has a global config option that can be shown by issuing tlmgr paperon any TeX Live installation, and can be changed as simply as: tlmgr paper letter.

Defaults are not much of a typesetting issue when the user is being explicit.

Neved4 commented 2 years ago

@lluchs passing a4paper to both the document class or the geometry package should work. You’re telling that the first of them doesn’t work for neither tectonic nor TeX Live, can you provide a test example of what your use case is? If you’re finding any issues that are not specific to tectonic and more to what you’re trying to achieve I’ve always had good luck asking outright in the #latex IRC channel.

@ngirard I’m sorry this is huge issue for you, may I suggest adding \usepackage[a4paper]{geometry} to all your document preambles as a working fix?

Neved4 commented 2 years ago

About the default, I know that letter is huge in some countries. It was huge when I was in Latin America and I'm aware that is in the U.S. too. Paper size fragmentation across the world is something we can safely acknowledge:

2560px-Prevalent_default_paper_size svg

(From https://en.wikipedia.org/wiki/Paper_size#/media/File:Prevalent_default_paper_size.svg)

@pkgw Would you consider changing the default once V2 is in place?

For the users who won't specify their paper size and want something à la tlmgr paper a4, how does a global configurable option for V2 sound?

lluchs commented 2 years ago

@lluchs passing a4paper to both the document class or the geometry package should work. You’re telling that the first of them doesn’t work for neither tectonic nor TeX Live, can you provide a test example of what your use case is? If you’re finding any issues that are not specific to tectonic and more to what you’re trying to achieve I’ve always had good luck asking outright in the #latex IRC channel.

It doesn't work if you don't also add \usepackage{geometry}. The following file will produce a default-paper-size document (i.e., letter in tectonic and A4 in TeX Live) despite specifying a4paper:

\documentclass[a4paper]{article}

\begin{document}
Hello world
\end{document}

And my point is not that it's particularly hard to get that to work, but that it's easy to assume that you did the right thing because the default paper size matched what you were trying to specify.

pkgw commented 2 years ago

Yeah, the Tectonic.toml approach is intended to provide a reproducible solution to exactly this sort of issue. When creating a new project, it should be straightforward to wire up the framework to default the paper size based on the current locale.

Furthermore, if there was demand for it, we could provide a locale papersize setting in the Tectonic.toml file that would choose the paper size based on the locale at build time, not just at document creation time. This would make the document build less-reproducible, but there might be use cases where people would want others to be able to build their document to their locale-specific paper size by default?

Anyway, this is one of those issues where I have been hoping that someone would step up and contribute an implementation. I am hopeful that it is a narrow sort of project that would make a good way for someone to learn more about the codebase.