-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathHowtoDeployLatexDocs-EN.tex
231 lines (197 loc) · 6.85 KB
/
HowtoDeployLatexDocs-EN.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{listings}
\usepackage{ifxetex,ifluatex}
\addtolength{\voffset}{-35pt}
\addtolength{\hoffset}{-35pt}
\addtolength{\textheight}{+70pt}
\addtolength{\textwidth}{+70pt}
\usepackage{color}
\definecolor{mygray}{rgb}{0.4,0.4,0.4}
\definecolor{mygreen}{rgb}{0,0.8,0.6}
\definecolor{myorange}{rgb}{1.0,0.4,0}
\definecolor{myblue}{rgb}{0.2,0.4,1}
\definecolor{mylightgray}{rgb}{0.98,0.98,0.98}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\lstset{
literate={UNfN17F/m8PSbbU53/xHGqySzA/pyyrWIc42o6Mnb3EzOMlAhTLsHvnOTw8L27KEeszyZJp8TcyG0PCnFfTgzV3gWMc1tweLnPBwWYj+qFWqQyqc8pkG4xfMrEAfbFk20sYGQYoRnaws85uc/nCcXNhVKvcFMCaZUYcxJKV/Kdass4rsfc205nRqvXa3unWlg51YzNtAB2glGbhe9/Rw6SeeTJiUmcjWKPDEhTfCTF8X0d4QaM6RiDly+Vfzv9POf+FRk8HWrmiImxguxepHhb5Ellz7hPZlTQ6iEb+igzde7jxxUKc4otFSrDG45TLoQ8BKsf32AMUo/JjXMT29H2alEF3P/6pSaev2M9gyVsQbzCfxUQOUn5HilY0D3khEIiT1smK0LrQPrQcarldN4BLJm/WG9pzsjKOp3PZQ6Afy1TOG2LPJv+xOIJFhYHNQSp+jjRaPLxbDwcZfxGFPPTDJ2xJvPEoNjL3vT1bdppGgopZxShqmxxzolBMoG0Y+H87DKu7Zv8u3yyjxneP1dhb+StsTLS7GzahD3J2WjHos9UYZV2BGitMyy2j7GJQ5+oPBH3HdoiLjU8BcTOOQ7ZX6xDxBaA9MyT+Q6pYFuxpZkbmB/7GZFnizP7Hpf5WExGVIqlIeYM6zZSaha49SPWxdQSHDLZTUHVGcG4tDbLY=}{{$...$}}1 {<}{$\langle$}{1} {>}{$\rangle$}{1},
backgroundcolor=\color{mylightgray},
basicstyle=\footnotesize,
breaklines=true,
captionpos=b,
commentstyle=\small\color{mygreen},
deletekeywords={...},
escapeinside={\%*}{*)},
extendedchars=true,
keepspaces=true,
keywordstyle=\color{myblue},
otherkeywords={*,os:,language:,sudo:,apt_packages:,script:,after_success:,deploy:,provider:,api_key:,secure:,file:,skip_cleanup:,on:,repo:,...},
numbers=left,
numbersep=5pt,
numberstyle=\tiny\color{mygray},
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=1,
stringstyle=\color{myorange},
tabsize=2,
title=\lstname
}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else
\ifxetex
\usepackage{mathspec}
\usepackage{xltxtra,xunicode}
\else
\usepackage{fontspec}
\fi
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\euro}{€}
\fi
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath}
}{}
\ifxetex
\usepackage[setpagesize=false,
unicode=false,
xetex]{hyperref}
\else
\usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
bookmarks=true,
pdfauthor={},
pdftitle={},
colorlinks=true,
citecolor=blue,
urlcolor=blue,
linkcolor=magenta,
pdfborder={0 0 0}}
\urlstyle{same}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}
\providecommand{\tightlist}{
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\date{}
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\title{HowTo Deploy LaTeX Documents}
\author{Simon Waldherr}
\begin{document}
\section{Deploy \LaTeX \ as PDF via GitHub and TravisCI}\label{deploy-latex-as-pdf-via-github-and-travisci}
\parskip 42pt
This document will explain how to automatically convert \LaTeX -documents
into PDFs and can publish them via the services
\href{https://github.com/}{GitHub} and
\href{https://travis-ci.org/}{TravisCI}. The advantage of this method
over the local transformation (Eg via git hooks) and insertion into the
repository, among other things are:
\begin{itemize}
\tightlist
\item
No binary data in the repo
\item
Check the code at each commit
\item
Testing of pull requests
\item
Independence from the local system
\end{itemize}
Of course, this can be extended to cover the conversion of Markdown by
using \textbf{pandoc}.
In the instructions, I assume that it is a public document. Therefore
free accounts can be used at \href{https://github.com/}{GitHub} and
\href{https://travis-ci.org/}{TravisCI}. There are no costs through the
use.
\parskip 12pt
\parindent 0pt
\newpage
\subsection{Step by step}\label{step-by-step}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
Creation of a \textbf{git}-Repository
\begin{itemize}
\tightlist
\item
\href{https://github.com/SimonWaldherr/golang-examples\#fork-destination-box}{fork
this repo} \emph{or}
\item
\href{https://github.com/new}{create a new repo on GitHub}
\end{itemize}
\item
\texttt{git\ clone} the repo (\emph{yes, you could also edit online,
but we ignore it this time})
\item
for configuration, we use \textbf{Travis.yml-YAML file} (more details
below)
\begin{itemize}
\tightlist
\item
in line 18 is sample code to see howto use Markdown as input format
\item
in line 22 and 24 is the call of the \texttt{pdflatex} program for converting
.tex to .pdf
\item
in line 27 and 28, the PDF gets converted to a
\href{https://en.wikipedia.org/wiki/DjVu}{DjVu document}
\item
in line 31 you can see how to transfer the generated data via wget
\item
the at line 36 defined provider \textbf{releases} stands for
\textbf{GitHub releases}
\item
in line 40 the required \textbf{oauth} string for
\href{http://docs.travis-ci.com/user/deployment/releases/}{storing
releases} is saved, it can be generated with different commands
\begin{itemize}
\tightlist
\item
\texttt{travis\ setup\ releases} generates the full
\emph{deploy}-block (33-51)
\item
\texttt{travis\ encrypt\ ***\$OAUTH\_STRING***} generates only the
encrypted part in row 40
\end{itemize}
\item
in lines 44 to 48 the files to upload are defined
\end{itemize}
\item
to activate the repo for Travis builds it may be necessary to refresh
the list of repos in your
\href{https://travis-ci.org/profile}{TravisCI profile}.
\item
now the \LaTeX \ or Markdown-files are to be created (remember to update
the filenames in \textbf{.travis.yml})
\item
at every \texttt{git\ push} a GNU/Linux VM will be started
automatically at TravisCI which generates the PDF and DjVu files and
publishes them as GitHub release. \emph{This file was created exactly
this way, each step can be viewed in the
\href{https://travis-ci.org/SimonWaldherr/HowTo-Deploy-LaTeX-Documents}{TravisCI
logfile}.}
\end{enumerate}
\newpage
\subsection{Travis Config (YAML)}\label{travis-config-yaml}
\lstinputlisting[language=PHP]{.travis.yml}
\newpage
\subsection{Terms of Use}\label{terms-of-use}
All Rights Reserved. No guarantee for completeness or actuality. All
content of this Repository is licensed under a
\href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
Attribution - Share Alike 4.0 License International}.
\end{document}