Skip to content

Commit 5f4df1e

Browse files
committed
Add target to generate changebar pdfs
Add the "latexdiff" make target to generate a diff between the current build and the previous release of the document. Type "make latexdiff" to use this new target. This patch is inelegant since it hard codes the file name, but it works. It can be cleaned up to be more generic, but that isn't immediately necessary. Signed-off-by: Grant Likely <[email protected]>
1 parent 8ef8c37 commit 5f4df1e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8+
RELEASEDIR = release
89
BUILDDIR = build
10+
LATEXDIFF = latexdiff
911

1012
# User-friendly check for sphinx-build
1113
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -34,6 +36,7 @@ help:
3436
@echo " epub to make an epub"
3537
@echo " epub3 to make an epub3"
3638
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
39+
@echo " latexdiff to make LaTeX files including changebars against previous release"
3740
@echo " latexpdf to make LaTeX files and run them through pdflatex"
3841
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
3942
@echo " text to make text files"
@@ -138,6 +141,16 @@ latex:
138141
@echo "Run \`make' in that directory to run these through (pdf)latex" \
139142
"(use \`make latexpdf' here to do that automatically)."
140143

144+
.PHONY: latexdiff
145+
latexdiff:
146+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
147+
@echo "Generating LaTeX changebars..."
148+
$(LATEXDIFF) --type=CULINECHBAR $(RELEASEDIR)/latex/devicetree-specification.tex $(BUILDDIR)/latex/devicetree-specification.tex > $(BUILDDIR)/latex/devicetree-specification-changebars.tex
149+
@echo "Running LaTeX files through pdflatex..."
150+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
151+
@echo
152+
@echo "latexdiff finished; the PDF files are in $(BUILDDIR)/latex."
153+
141154
.PHONY: latexpdf
142155
latexpdf:
143156
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ Requirements:
1818

1919
On Ubuntu:
2020

21-
`# apt-get install python-sphinx texlive texlive-latex-extra texlive-humanities graphviz`
21+
```
22+
# apt-get install python-sphinx latexdiff texlive texlive-latex-extra \
23+
texlive-humanities texlive-generic-recommended graphviz
24+
```
2225

2326
If the version of python-spinx installed is too old, then an additional
2427
new version can be installed with the Python package installer:

0 commit comments

Comments
 (0)