Skip to content

Commit

Permalink
Support xelatex for PDF output
Browse files Browse the repository at this point in the history
- Now with Unicode character support
  • Loading branch information
stevepiercy committed May 16, 2018
1 parent a5dc961 commit d4be9a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html text web pickle htmlhelp latex latexpdf changes linkcheck epub doctest
.PHONY: help clean html text web pickle htmlhelp latex latexpdf changes linkcheck epub doctest xelatexpdf

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -30,6 +30,12 @@ help:
clean:
-rm -rf $(BUILDDIR)/*

xelatexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through xelatex..."
$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf
@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."

html:
mkdir -p $(BUILDDIR)/html $(BUILDDIR)/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
11 changes: 11 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ def nothing(*arg):
_PREAMBLE = r"""
\usepackage[]{geometry}
\geometry{bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}}
%XeLaTeX packages
\usepackage{xltxtra}
\usepackage{fontspec} %Font package
\usepackage{xunicode}
%Select fonts
\setmainfont[Mapping=tex-text]{nimbusserif}
\setsansfont[Mapping=tex-text]{nimbussans}
\setmonofont{nimbusmono}
\hypersetup{
colorlinks=true,
linkcolor=black,
Expand Down

0 comments on commit d4be9a5

Please sign in to comment.