File tree 4 files changed +21
-13
lines changed
4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
1
title = '高速上手 C++11/14/17'
2
2
filename = 'modern-cpp-tutorial'
3
3
outputname ='modern-cpp-tutorial'
4
+ revision = $(shell git describe --always --tags)
4
5
5
- all : pdf
6
+ all : revision pdf
7
+
8
+ revision :
9
+ @echo ' % Autogenerated, do not edit' > revision.tex
10
+ @echo ' \\newcommand{\\revision}{' $(revision ) ' }' >> revision.tex
6
11
7
12
pdf : markdown
8
13
@echo " Compiling PDF file..."
9
- @pandoc -s $(filename ) .md -o $(filename ) .pdf \
14
+ @pandoc -f markdown+smart - s $(filename ) .md -o $(filename ) .pdf \
10
15
--title-prefix $(title ) \
11
16
--listings -H meta/cpp-listings.tex \
12
17
--template=meta/template.tex \
13
- --normalize \
14
- --smart \
15
- --latex-engine=` which xelatex`
18
+ --pdf-engine=` which xelatex`
16
19
@echo " Done."
17
- @rm * .md
20
+ @rm * .md revision.tex
18
21
19
22
markdown :
20
23
@echo " Copy markdown files..."
@@ -23,6 +26,6 @@ markdown:
23
26
@python3 aggregator.py
24
27
25
28
clean :
26
- rm -rf * .md * .pdf
29
+ rm -rf revision.tex * .md * .pdf
27
30
28
31
.PHONY : markdown pdf clean
Original file line number Diff line number Diff line change 152
152
\setlength {\parskip }{1ex}
153
153
\setlength {\parskip }{0.5\baselineskip }
154
154
155
+ \input {revision }
155
156
156
- \begin {document }
157
+ % fix build, see https://github.com/laboon/ebook/issues/139#issuecomment-408696480
158
+ \newcommand {\passthrough }[1]{\lstset {mathescape=false}#1\lstset {mathescape=true}}
157
159
160
+ \begin {document }
158
161
\newcommand {\tightlist }{%
159
- \setlength {\itemsep }{0pt}\setlength {\parskip }{0pt}}
162
+ \setlength {\itemsep }{0pt}\setlength {\parskip }{0pt}}
160
163
161
164
\thispagestyle {plain}
162
165
\begin {center }
163
-
166
+
164
167
{\LARGE \textbf {高速上手 C++11/14/17 }}
165
-
168
+
166
169
\vspace {1em}
167
170
{\large 欧长坤 (hi@changkun.us)}
168
-
171
+
169
172
\vspace {1ex}
170
- 最后更新 \today
173
+ 最后更新 \today - \revision
171
174
172
175
\vspace {1em}
173
176
\textbf {\large 版权声明 }
Original file line number Diff line number Diff line change
1
+ % Autogenerated, do not edit
2
+ \newcommand {\revision }{v1.0.1-91-g6f6531f}
You can’t perform that action at this time.
0 commit comments