10000 Use Latexmk in a more efficient way for `'xelatex'` as `latex_engine` by jfbu · Pull Request #12636 · sphinx-doc/sphinx · GitHub
[go: up one dir, main page]

Skip to content

Use Latexmk in a more efficient way for 'xelatex' as latex_engine #12636

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use Latexmk in a more efficient way for 'xelatex' as latex_engine
  • Loading branch information
jfbu committed Jul 21, 2024
commit 2f7c71c4bf584859777bdcdea6ce346c4bcfd5ab
21 changes: 16 additions & 5 deletions sphinx/texinputs/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ALLDOCS = $(basename $(wildcard *.tex))
ALLPDF = $(addsuffix .pdf,$(ALLDOCS))
{% if latex_engine == 'xelatex' -%}
ALLDVI =
# but we do not know a way to let Latexmk produce the .xdv files
# as final targets, only as left-overs from a .pdf build
ALLXDV = $(addsuffix .xdv,$(ALLDOCS))
{% else -%}
ALLDVI = $(addsuffix .dvi,$(ALLDOCS))
Expand All @@ -16,10 +18,6 @@ ARCHIVEPREFIX =
# Additional LaTeX options (passed via variables in latexmkrc/latexmkjarc file)
export LATEXOPTS ?=
# Additional latexmk options
{% if latex_engine == 'xelatex' -%}
# with latexmk version 4.52b or higher set LATEXMKOPTS to -xelatex either here
# or on command line for faster builds.
{% endif -%}
LATEXMKOPTS ?=
{% if xindy_use -%}
export XINDYOPTS = {{ xindy_lang_option }} -M sphinx.xdy
Expand All @@ -40,9 +38,22 @@ FMT = pdf
# latexmkrc is read then overridden by latexmkjarc
LATEX = latexmk -r latexmkjarc -dvi
PDFLATEX = latexmk -r latexmkjarc -pdfdvi -dvi- -ps-
{% else -%}
{% endif -%}
{% if latex_engine == 'pdflatex' -%}
LATEX = latexmk -dvi
PDFLATEX = latexmk -pdf -dvi- -ps-
{% endif -%}
{% if latex_engine == 'xelatex' -%}
# No LATEX as it is used for .dvi targets which xelatex can't produce.
# The -pdf is not needed with current (2024) Latexmk but may have been
# in the distant past. It doesn't hurt.
PDFLATEX = latexmk -pdf -xelatex
{% endif -%}
{% if latex_engine == 'lualatex' -%}
LATEX = latexmk -dvilua
# The -pdf is not needed with current (2024) Latexmk but may have been
# in the distant past. It doesn't hurt.
PDFLATEX = latexmk -pdf -lualatex
{% endif %}

{% if latex_engine != 'xelatex' -%}
Expand Down
Loading
0