mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
pdflatex doesn't accept using some UTF-8 chars, like "equal or less than" or "equal or greater than" chars. However, the media documents use them. So, we need to use XeLaTeX for conversion, and a font that accepts such characters. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
6045977465
commit
a682ec4ba1
2 changed files with 14 additions and 3 deletions
|
@ -29,7 +29,7 @@ else ifneq ($(DOCBOOKS),)
|
||||||
else # HAVE_SPHINX
|
else # HAVE_SPHINX
|
||||||
|
|
||||||
# User-friendly check for pdflatex
|
# User-friendly check for pdflatex
|
||||||
HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; else echo 0; fi)
|
HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else echo 0; fi)
|
||||||
|
|
||||||
# Internal variables.
|
# Internal variables.
|
||||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||||
|
@ -68,11 +68,11 @@ htmldocs:
|
||||||
|
|
||||||
pdfdocs:
|
pdfdocs:
|
||||||
ifeq ($(HAVE_PDFLATEX),0)
|
ifeq ($(HAVE_PDFLATEX),0)
|
||||||
$(warning The 'pdflatex' command was not found. Make sure you have it installed and in PATH to produce PDF output.)
|
$(warning The 'xelatex' command was not found. Make sure you have it installed and in PATH to produce PDF output.)
|
||||||
@echo " SKIP Sphinx $@ target."
|
@echo " SKIP Sphinx $@ target."
|
||||||
else # HAVE_PDFLATEX
|
else # HAVE_PDFLATEX
|
||||||
@$(call loop_cmd,sphinx,latex,.,latex,.)
|
@$(call loop_cmd,sphinx,latex,.,latex,.)
|
||||||
$(Q)$(MAKE) -C $(BUILDDIR)/latex
|
$(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex
|
||||||
endif # HAVE_PDFLATEX
|
endif # HAVE_PDFLATEX
|
||||||
|
|
||||||
epubdocs:
|
epubdocs:
|
||||||
|
|
|
@ -254,6 +254,10 @@ latex_elements = {
|
||||||
# Latex figure (float) alignment
|
# Latex figure (float) alignment
|
||||||
#'figure_align': 'htbp',
|
#'figure_align': 'htbp',
|
||||||
|
|
||||||
|
# Don't mangle with UTF-8 chars
|
||||||
|
'inputenc': '',
|
||||||
|
'utf8extra': '',
|
||||||
|
|
||||||
# Additional stuff for the LaTeX preamble.
|
# Additional stuff for the LaTeX preamble.
|
||||||
'preamble': '''
|
'preamble': '''
|
||||||
% Allow generate some pages in landscape
|
% Allow generate some pages in landscape
|
||||||
|
@ -281,6 +285,13 @@ latex_elements = {
|
||||||
\\end{graybox}
|
\\end{graybox}
|
||||||
}
|
}
|
||||||
\\makeatother
|
\\makeatother
|
||||||
|
|
||||||
|
% Use some font with UTF-8 support with XeLaTeX
|
||||||
|
\\usepackage{fontspec}
|
||||||
|
\\setsansfont{DejaVu Serif}
|
||||||
|
\\setromanfont{DejaVu Sans}
|
||||||
|
\\setmonofont{DejaVu Sans Mono}
|
||||||
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue