Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF output: usage of PAPER environment variable is broken since Sphinx 1.5 #5234

Closed
jfbu opened this issue Jul 30, 2018 · 4 comments
Closed

Comments

@jfbu
Copy link
Contributor

jfbu commented Jul 30, 2018

Description of problem

Since Sphinx 1.5, more precisely probably commit 72b76ab, and the deprecation of former configuration variable latex_paper_size in favour of latex_elements['papersize'], the usage of PAPER env variable is broken: LaTeX document is created with a4 or letter option where it should be a4paper or letterpaper.

This breaks old projects Makefiles following our documentation which says to use a4 or letter.

Expected results

Setting PAPER=a4 or PAPER=letter works.

Reproducible project / your project

Any project.

Environment info

  • OS: Mac
  • Python version: 3.6.4
  • Sphinx version: 1.5.x and later
  • LaTeX
@jfbu
Copy link
Contributor Author

jfbu commented Jul 31, 2018

As an example of a broken project consider the CPython documentation: https://github.com/python/cpython/blob/9c18b1ae527346bc178250ad1ca07bffdacde5dd/Doc/Makefile#L1-L1

@jfbu
Copy link
Contributor Author

jfbu commented Jul 31, 2018

The CPython Doc/Makefile contains

ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \
                $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)

build:
	-mkdir -p build
[...cut lines...]
	$(SPHINXBUILD) $(ALLSPHINXOPTS)
	@echo


[...]

latex: BUILDER = latex
latex: build
	@echo "Build finished; the LaTeX files are in build/latex."
	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
	      "run these through (pdf)latex."

[...]

dist:

[...]

	# archive the A4 latex
	rm -rf build/latex
	make latex PAPER=a4
	-sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
	(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)

This creates LaTeX files with wrong a4 option, in place of a4paper. It seems this Makefile was updated on model of Sphinx ("old") Makefile at 1.5, at any rate after deprecation of the latex_paper_size configuration variable. I will make PR at their project to fix this particular Makefile (updating Sphinx will not help that project if they keep same Makefile.)

@jfbu
Copy link
Contributor Author

jfbu commented Jul 31, 2018

See python/cpython#8585 for fix to CPython Doc/Makefile.

@jfbu
Copy link
Contributor Author

jfbu commented Jul 31, 2018

Fixed at 077e9af

@jfbu jfbu closed this as completed Jul 31, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant