Merge lp:~ubuntu-manual/ubuntu-manual/main into lp:~jflaker/ubuntu-manual/FixBug1358406

Proposed by Jeffrey Flaker
Status: Superseded
Proposed branch: lp:~ubuntu-manual/ubuntu-manual/main
Merge into: lp:~jflaker/ubuntu-manual/FixBug1358406
Diff against target: 1235736 lines (has conflicts)
Conflict adding file .bzrignore.  Moved existing file to .bzrignore.moved.
Conflict adding file Makefile.  Moved existing file to Makefile.moved.
Conflict adding file backmatter.  Moved existing file to backmatter.moved.
Conflict adding file frontmatter.  Moved existing file to frontmatter.moved.
Conflict adding file graphics.  Moved existing file to graphics.moved.
Conflict adding file installation.  Moved existing file to installation.moved.
Conflict adding file langcodes.txt.  Moved existing file to langcodes.txt.moved.
Conflict adding file learning-more.  Moved existing file to learning-more.moved.
Conflict adding file pkgs.  Moved existing file to pkgs.moved.
Conflict adding file po.  Moved existing file to po.moved.
Conflict adding file po4a.conf.  Moved existing file to po4a.conf.moved.
Conflict adding file screenshots.  Moved existing file to screenshots.moved.
Conflict adding file titlepage.  Moved existing file to titlepage.moved.
Conflict adding file troubleshooting.  Moved existing file to troubleshooting.moved.
Conflict adding file tufte-book.cls.  Moved existing file to tufte-book.cls.moved.
Conflict adding file tufte-common.def.  Moved existing file to tufte-common.def.moved.
Conflict adding file ubuntu-manual.cls.  Moved existing file to ubuntu-manual.cls.moved.
Conflict adding file um-arabic.clo.  Moved existing file to um-arabic.clo.moved.
Conflict adding file um-bengali.clo.  Moved existing file to um-bengali.clo.moved.
Conflict adding file um-czech.clo.  Moved existing file to um-czech.clo.moved.
Conflict adding file um-dutch.clo.  Moved existing file to um-dutch.clo.moved.
Conflict adding file um-farsi.clo.  Moved existing file to um-farsi.clo.moved.
Conflict adding file um-german.clo.  Moved existing file to um-german.clo.moved.
Conflict adding file um-greek.clo.  Moved existing file to um-greek.clo.moved.
Conflict adding file um-hebrew.clo.  Moved existing file to um-hebrew.clo.moved.
Conflict adding file um-hindi.clo.  Moved existing file to um-hindi.clo.moved.
Conflict adding file um-japanese.clo.  Moved existing file to um-japanese.clo.moved.
Conflict adding file um-marathi.clo.  Moved existing file to um-marathi.clo.moved.
Conflict adding file um-tamil.clo.  Moved existing file to um-tamil.clo.moved.
Conflict adding file um-telugu.clo.  Moved existing file to um-telugu.clo.moved.
Conflict adding file um-template.clo.  Moved existing file to um-template.clo.moved.
Conflict adding file um-thai.clo.  Moved existing file to um-thai.clo.moved.
Conflict adding file um-vietnamese.clo.  Moved existing file to um-vietnamese.clo.moved.
To merge this branch: bzr merge lp:~ubuntu-manual/ubuntu-manual/main
Reviewer Review Type Date Requested Status
Jeffrey Flaker Pending
Review via email: mp+232844@code.launchpad.net

Description of the change

there is a single place where "Ubuntu Software Center" was called "Ubuntu Software centre". To be consistent with many other mentions of Ubuntu Software Center, it was changed

To post a comment you must log in.

Unmerged revisions

935. By Kevin Godby

* Updating Galician translation.

934. By Kevin Godby

Dutch wrap-around cover:
* Fixed logo file path.
* Updated spine text.
* Generated PDF for Lulu.com.

933. By Kevin Godby

* Added code-page info to the langcodes.txt file.

932. By Kevin Godby

More work on the Dutch translation:
* Pulled in Hannie's quotation marks fixes.
* Fixed some index entries (removed duplicates).

931. By Kevin Godby

* Still working on the Dutch translation:
  * Fixed running head style.
  * Fixed some errors that Hannie found.

930. By thorwil

Dutch Lulu cover SVG ready.

929. By thorwil

Add Dutch Lulu cover SVG.

928. By Kevin Godby

* Adding half-title page to the Dutch translation (print version).

927. By Kevin Godby

* Rejiggered polyglossia and glossaries packages so that they work together better.
* Fixed the TOC entry for the Dutch glossary.

926. By Kevin Godby

* Translated "License" to Dutch.
* Translated colophon text to Dutch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2014-09-01 04:44:23 +0000
@@ -0,0 +1,30 @@
1*.aux
2*.d
3*.dvi
4*.fls
5*.glg
6*.glo
7*.gls
8*.idx
9*.ilg
10*.ind
11*.log
12*.make
13*.nav
14*.out
15*.pdf
16*.ps
17*.snm
18*.toc
19*.xdy
20revision.tex
21test-*.tex
22titlepage/cover-proposal 2.svg
23titlepage/preview.png
24titlepage/renders
25titlepage/trash
26ubuntu-manual-*
27ccicons
28coverpage.pdf
29*.tdo
30titlepage/titlepage-*.svg
031
=== renamed file '.bzrignore' => '.bzrignore.moved'
=== added file '.gcfunctions'
--- .gcfunctions 1970-01-01 00:00:00 +0000
+++ .gcfunctions 2014-09-01 04:44:23 +0000
@@ -0,0 +1,15 @@
1make_translation:
2 name: Make Translated PDF
3 command: make show-mylang
4 show-in: any
5 offline: True
6make_release:
7 name: Make PDF
8 command: make show
9 show-in: any
10 offline: True
11make_clean:
12 name: Make Clean
13 command: make clean
14 show-in: any
15 offline: True
016
=== added directory 'Help'
=== added directory 'Help/godbyk'
=== added directory 'Help/godbyk/latex-handout'
=== added file 'Help/godbyk/latex-handout/Makefile'
--- Help/godbyk/latex-handout/Makefile 1970-01-01 00:00:00 +0000
+++ Help/godbyk/latex-handout/Makefile 2014-09-01 04:44:23 +0000
@@ -0,0 +1,15 @@
1all: latex-handout.pdf
2
3.PHONY: all clean show
4
5latex-handout.pdf: latex-handout.tex
6 xelatex latex-handout
7 xelatex latex-handout
8 xelatex latex-handout
9
10show: latex-handout.pdf
11 evince $< &
12
13clean:
14 -for F in aux log dvi pdf out toc glo idx bbl blg; do rm -fr *.$${F}; done
15
016
=== added symlink 'Help/godbyk/latex-handout/graphics'
=== target is u'../../../graphics/'
=== added file 'Help/godbyk/latex-handout/latex-handout.tex'
--- Help/godbyk/latex-handout/latex-handout.tex 1970-01-01 00:00:00 +0000
+++ Help/godbyk/latex-handout/latex-handout.tex 2014-09-01 04:44:23 +0000
@@ -0,0 +1,433 @@
1\documentclass{ubuntu-manual}
2
3\hypersetup{colorlinks}
4
5\usepackage{booktabs}
6\usepackage{hyphenat}
7
8\title{Ubuntu Manual: \protect\LaTeX{} for Authors and Translators}
9\author{Kevin Godby}
10
11
12\newcommand{\email}[1]{\href{mailto:#1}{#1}}
13
14\newcommand{\parg}[1]{$\langle$\textrm{\textit{#1}}$\rangle$}
15\newcommand{\oarg}[1]{\texttt{[\parg{#1}]}}
16\newcommand{\marg}[1]{\texttt{\{\parg{#1}\}}}
17\newcommand{\cmd}[1]{\texttt{\textbackslash#1}}
18\newcommand{\cs}[1]{\texttt{\textup{\textbackslash#1}}}
19
20\newcommand{\highlight}[1]{\textcolor{important}{#1}}
21\newcommand{\tr}[1]{\textcolor{important}{#1}}
22\newcommand{\ntr}[1]{#1}
23\newcommand{\tmarg}[1]{\marg{\tr{#1}}}
24\newcommand{\toarg}[1]{\oarg{\tr{#1}}}
25\newcommand{\tparg}[1]{\parg{\tr{#1}}}
26
27
28\newenvironment{example}{%
29 \begin{quote}%
30 \setlength{\parindent}{0pt}%
31 \setlength{\parskip}{\baselineskip}%
32 \raggedright\sloppy\language\langwohyphens
33}{%
34 \end{quote}%
35}
36
37\begin{document}
38
39\maketitle
40
41\tableofcontents
42
43\chapter{Introduction}
44
45The \href{http://wiki.ubuntu.com/ubuntu-manual/}{Ubuntu Manual} project has set out to produce a beginner's guide for Ubuntu, covering everything from installation to commonly used applications. The manual will be provided in \smallcaps{PDF} format in a variety of languages and will be freely available. To generate the \smallcaps{PDF}s, we use \LaTeX.
46
47\LaTeX{} is a typesetting system that has been around for over twenty years. Since \LaTeX{} is a large (and sometimes complex) system this guide will only cover what you need to know to write, edit, and translate the contents of the Ubuntu Manual.
48
49If you have questions or run into any problems that this guide doesn't cover, feel free to email the Ubuntu Manual mailing list at \email{ubuntu-manual@lists.launchpad.net}.
50
51\chapter{The Basics}
52
53\section{Getting Started}\label{sec:getting-started}
54
55% Add pointers to getting the source code and using Rosetta.
56
57As an author or editor, you will be modifying the Ubuntu Manual source files directly. The source files for \LaTeX{} have a \texttt{.tex} extension. You can edit the source files using your favorite text editor such as emacs, vim, or GEdit. \LaTeX{} code is similar to \smallcaps{HTML} in that most of the ``code'' is simply the text of the manual with a few formatting commands sprinkled in.
58
59Translators should also familiarize themselves with the basics of \LaTeX{} formatting and read the special translator notes starting on page~\ref{sec:notes-for-translators}.
60
61\section{Organization of Files}
62
63Each of the chapters of the manual has its own subdirectory:
64
65\begin{center}
66 \begin{tabular}{ll}
67 \toprule
68 Chapter & Directory name \\
69 \midrule
70 Prologue & \texttt{prologue} \\
71 1. Installation & \texttt{installation} \\
72 2. Around Your Desktop & \texttt{around-desktop} \\
73 3. Default Applications & \texttt{default-apps} \\
74 4. Preferences and Hardware & \texttt{prefs-hardware} \\
75 5. Software and Packaging & \texttt{software-packaging} \\
76 6. System Maintenance & \texttt{maintenance} \\
77 7. The Command Line & \texttt{command-line} \\
78 8. Security & \texttt{security} \\
79 9. Troubleshooting & \texttt{troubleshooting} \\
80 10. Learning More About Linux & \texttt{learning-more} \\
81 \bottomrule
82 \end{tabular}
83\end{center}
84
85Once you've selected a chapter that you'd like to help write or edit, you will find a \texttt{.tex} file in that chapter's directory. Some chapters will have all of their text in that one file, while other chapters have split each section into its own file. If you see a bunch of \verb|\input| commands in the file, then you will have to look in the appropriate \texttt{.tex} file for the text of that section.
86
87
88
89
90\chapter{Style Guide}\label{ch:style-guide}
91
92%\section{Writing Style}\label{sec:writing-style}% Not LaTeX-related
93
94
95\section{Formatting Text}\label{sec:formatting-text}
96\subsection{Punctuation}\label{sec:punctuation}
97
98\paragraph{Quotation marks} Quotation marks in \LaTeX{} are entered as \verb|``| and \verb|''|, \emph{not} as \verb|"|.
99Single quotation marks are entered as \verb|`| and \verb|'|. Quotation marks for other languages are entered as their Unicode characters.% TODO This may change if we use csquotes.
100
101\paragraph{Indicating sudden breaks} To indicate a sudden break in thought---like this---use an em dash. To enter an em dash in the manual, use the \cmd{dash} command. This command will print an em dash without spaces---like this---for US English, but can be set to print an en dash with spaces\,--\,like this\,--\,for other languages such as UK English.
102
103\paragraph{Indicating a range} If you wish to indicate a range (such as: pages 37--40 or 2005--2007), use an en dash. An en dash is entered in \LaTeX{} as two hyphens: \verb|--|. Do not put spaces before of after the en dash when used to indicate a range.
104
105\paragraph{Special characters} There are a few characters that \LaTeX{} considers special (used for its own syntax). To typeset these characters, precede the character with a backslash (\texttt{\textbackslash}). The special characters are:
106
107\begin{example}
108 \centering \$ \qquad \% \qquad \_ \qquad \{ \qquad \} \qquad \& \qquad \#
109\end{example}
110The above line was typed like this:
111\begin{example}
112 \centering \ttfamily \cmd{\$} \qquad \cmd{\%} \qquad \cmd{\_} \qquad \cmd{\{} \qquad \cmd{\}} \qquad \cmd{\&} \qquad \cmd{\#}
113\end{example}
114Finally, to type a backslash character, use the \cmd{textbackslash} command.
115
116\section{GUI Elements}
117
118\paragraph{Menu items} To give a sequence of menu items that should be selected, use the \verb|\menu| and \verb|\then| commands. For example:
119\begin{example}
120 To open the Calculator application, click \menu{Applications\then Accessories\then Calculator}.
121\end{example}
122is typeset by:
123\begin{example}
124 \ttfamily To open the Calculator application, click \string\menu\string{Applications\string\then\space Accessories\string\then\space Calculator\string}.
125\end{example}
126
127Use the \cmd{menu} command for single menu items as well:
128\begin{example}
129 Pull down the \menu{File} menu and then click \menu{Quit}.
130\end{example}
131
132\paragraph{Other \smallcaps{GUI} elements} There are commands for other \smallcaps{GUI} elements as well:
133
134\medskip
135\begin{center}
136 \begin{tabular}{lll}
137 \toprule
138 \smallcaps{GUI} element & Command & Appearance \\
139 \midrule
140 Button & \verb|button| & \button{Cancel} \\
141 Tab & \verb|\tab| & \tab{Advanced} \\
142 Drop-down list & \verb|\dropdown| & \dropdown{Country} \\
143 Checkbox & \verb|\checkbox| & \checkbox{Remember my password} \\
144 Window title & \verb|\window| & \checkbox{Preferences} \\
145 Keyboard key(s) & \verb|\keystroke| & \keystroke{Ctrl+Q} \\
146 Radio button & \verb|\radiobutton| & \radiobutton{Single click to open items} \\
147 Text box & \verb|\textfield| & \textfield{Full name} \\
148 \bottomrule
149 \end{tabular}
150\end{center}
151
152\paragraph{Application names} The names of applications should be typeset with the \verb|\application| command. This will add the application to the index automatically. For command-line--based applications, use the \verb|\commandlineapp| command instead.
153
154\paragraph{User input} When quoting what a user should type, use the \verb|\userinput| command. If you're just having the user press a key on the keyboard, use the \verb|\keystroke| command instead. For example:
155\begin{quotation}
156 \ttfamily Type \string\userinput\string{Hello, world!\string} and press \string\keystroke\string{Enter\string}.
157\end{quotation}
158is typeset as:
159\begin{quotation}
160 Type \userinput{Hello, world!} and press \keystroke{Enter}.
161\end{quotation}
162
163\paragraph{Cross-referencing} In a manual of this size, it's often helpful to point the reader to another chapter or section for more information on a related topic. There are few commands that can help you do that. To cross-reference another chapter, use the \verb|\chaplink| command. Similarly, to cross-reference a section of a chapter, use the \verb|\seclink| command. The \verb|\chaplink| command will insert the text ``Chapter \parg{X}: \parg{Chapter Title}'' and link it to the beginning of that chapter. The \verb|\seclink| command will insert the name of the section and link it to that section.% TODO provide examples
164
165% TODO provide actual command references
166
167
168\section{Graphics}\label{sec:graphics}
169
170If a screenshot should be added at some point, make a note of it using the \verb|\screenshotTODO| command. Provide a description of what the screenshot should depict. This will add a warning notice in the \smallcaps{PDF} and will add that screenshot to the to do list.
171
172\screenshotTODO{Firefox web browser window}
173
174% TODO Write about how to insert a screenshot into the document.
175
176\section{Other document elements}
177
178\paragraph{Paragraphs} To start a new paragraph in \LaTeX{}, just add a blank line. You don't need to indent the paragraphs as \LaTeX{} will take care of this for you.
179
180\paragraph{Margin notes} The manual uses margin notes to provide definitions, tips, and pointers to more information. To add a margin note, use the \cmd{marginnote} command:
181\begin{example}
182 \ttfamily \cmd{marginnote}\marg{Margin note text}
183\end{example}
184
185\paragraph{Comments} If you want to add a note to yourself (or others) in the \texttt{.tex} file, just type a percent sign (\%) followed by your note. \LaTeX{}
186ll ignore everything on the line after the percent sign.
187\begin{example}
188 \ttfamily This text will appear in the PDF. \% But this text won't!
189\end{example}
190
191Remember, if you want a percent sign to actually appear in the \smallcaps{PDF}, you'll need to precede it with a backslash:
192\begin{example}
193 \ttfamily Linux users are 50\cmd{\%} smarter than non-Linux users.
194\end{example}
195
196\paragraph{Terminal commands} There are also special commands for typesetting text that appears or is entered into a terminal. An example will illustrate the commands:
197\begin{example}
198 \parskip0pt\obeylines
199 \ttfamily The \cmd{commandlineapp}\{fortune\} program works like this:
200 \cmd{begin}\{terminal\}
201 \cmd{prompt} \cmd{userinput}\{fortune\}
202 What we have to learn to do we learn by doing.
203 \ \ \ -- Aristotle, Ethica Nicomachea II (c. 325 BC)
204 \cmd{end}\{terminal\}
205\end{example}
206The above generates the following output:
207\begin{example}
208 The \commandlineapp{fortune} program works like this:
209 \begin{terminal}
210 \prompt \userinput{fortune}
211 What we have to learn to do we learn by doing.
212 \ \ \ -- Aristotle, Ethica Nicomachea II (c. 325 BC)
213 \end{terminal}
214\end{example}
215
216The \cmd{prompt} command will print a \smallcaps{BASH}-style user prompt (\prompt). The \cmd{rootprompt} command will print a \smallcaps{BASH}-style root prompt (\rootprompt). The \cmd{userinput} command should contain any text that the user types in.
217
218While the \texttt{terminal} environment is handy for multiple lines of terminal input/output, if you want to put terminal text inline with your paragraph text, you can use the \cmd{userinput} and \cmd{code} commands.
219
220\paragraph{Warnings and notices for advanced instructions} While the instructions in this manual should be as safe as possible, we sometimes mention commands or programs that can potentially do damage if not used correctly. To draw attention to these rare circumstances, you can put a note in the \cmd{warning} command. This will set the text off so it's more eye-catching.
221
222Similarly, there is a \cmd{advanced} command for notes to advanced users.
223
224\paragraph{Lists} There are two types of lists that we use in the manual: numbered lists and bulleted lists. Both lists work the same way, they just have different names.
225
226 \begin{minipage}{0.4\textwidth}
227 \parskip0.5\baselineskip
228 \parindent0pt
229 \begin{flushleft}
230 \ttfamily
231 \string\begin\{itemize\}\\
232 \ \ \string\item\ First list item\\
233 \ \ \string\item\ Second list item\\
234 \ \ \string\item\ Third list item\\
235 \string\end\{itemize\}
236 \end{flushleft}
237 produces:\\
238 \begin{flushleft}
239 \rmfamily
240 \begin{itemize}
241 \item First list item
242 \item Second list item
243 \item Third list item
244 \end{itemize}
245 \end{flushleft}
246 \end{minipage}
247 \hfill
248 \begin{minipage}{0.4\textwidth}
249 \parskip0.5\baselineskip
250 \parindent0pt
251 \begin{flushleft}
252 \ttfamily
253 \string\begin\{enumerate\}\\
254 \ \ \string\item\ First list item\\
255 \ \ \string\item\ Second list item\\
256 \ \ \string\item\ Third list item\\
257 \string\end\{enumerate\}
258 \end{flushleft}
259 produces:
260 \begin{flushleft}
261 \rmfamily
262 \begin{enumerate}
263 \item First list item
264 \item Second list item
265 \item Third list item
266 \end{enumerate}
267 \end{flushleft}
268 \end{minipage}
269
270
271\chapter{Notes for Translators}\label{sec:notes-for-translators}
272
273\LaTeX{} commands are preceded by a backslash character (\texttt{\textbackslash}). While the command names should not be translated, their arguments sometimes should be.
274
275In the following list of commands, the \tr{red} text should be translated and the black text should not be translated.
276
277\section{Document headings}
278\begin{itemize}\ttfamily
279 \item \cs{title}\tmarg{book title}
280 \item \cs{author}\tmarg{book authors}
281 \item \cs{part}\tmarg{part heading}
282 \item \cs{chapter}\tmarg{chapter heading}
283 \item \cs{section}\tmarg{section heading}
284 \item \cs{subsection}\tmarg{subsection heading}
285 \item \cs{subsubsection}\tmarg{subsubsection heading}
286 \item \cs{paragraph}\tmarg{paragraph heading}
287 \item \cs{subparagraph}\tmarg{subparagraph heading}
288\end{itemize}
289
290\section{Formatting commands}
291\begin{itemize}\ttfamily
292 \item \cs{marginnote}\tmarg{margin note text}
293 \item \cs{textbf}\tmarg{bold text}
294 \item \cs{textit}\tmarg{italic text}
295 \item \cs{emph}\tmarg{italic text}
296 \item \cs{smallcaps}\tmarg{acronym}
297 \item \cs{application}\tmarg{application name}
298 \item \cs{commandlineapp}\tmarg{command-line application name}
299 \item \cs{menu}\marg{\tparg{menu name} \cs{then} \tparg{submenu name} \cs{then} \tparg{menu item}}
300 \item \cs{button}\tmarg{button name}
301 \item \cs{checkbox}\tmarg{checkbox name}
302 \item \cs{tab}\tmarg{tab name}
303 \item \cs{dropdown}\tmarg{drop-down list name}
304 \item \cs{window}\tmarg{window name}
305 \item \cs{textfield}\tmarg{text box name}
306 \item \cs{keystroke}\tmarg{Keyboard key names separated by \texttt{+}}
307 \item \cs{userinput}\tmarg{stuff the user types}
308 \item \cs{code}\tmarg{terminal output}
309 \item \cs{begin}\marg{terminal} \tparg{output from the terminal} \cs{end}\marg{terminal}
310 \item \cs{warning}\marg{warning text}
311 \item \cs{advanced}\marg{advanced usage text}
312 \item \cs{screenshot}\marg{filename}\marg{label}\tmarg{caption}
313\end{itemize}
314
315\noindent The following formatting commands should \emph{not} be translated:
316\begin{itemize}\ttfamily
317 \item \cs{dash}
318 \item \cs{url}\marg{URL}
319 \item \cs{prompt}
320 \item \cs{rootprompt}
321\end{itemize}
322
323\section{Lists}
324The only part of lists that need to be translated is the text of the list items themselves.
325
326\begingroup\ttfamily\parindent=0pt\parskip=0pt\noindent
327\cs{begin}\marg{itemize}\quad\textit{or}\quad\cs{begin}\marg{enumerate}\par
328\space\space\cs{item} \tparg{list item text}\par
329\space\space\cs{item} \tparg{another list item}\par
330\cs{end}\marg{itemize}\quad\textit{or}\quad\cs{begin}\marg{enumerate}\par
331\endgroup
332
333\section{Author and editor notes}
334Do not translate any of the following commands:
335\begin{itemize}\ttfamily
336 \item \cs{todo}\marg{notes to appear in PDF margin}
337 \item \cs{screenshotTODO}\marg{description of screenshot}
338 \item \cs{begin}\marg{comment} \parg{notes to authors/editors} \cs{end}\marg{command}
339\end{itemize}
340
341
342\section{Glossary-related commands}
343
344\begin{itemize}\ttfamily
345 \item \cs{newglossaryentry}\marg{\ntr{keyword}}\{name=\marg{\tr{term}},description=\marg{\tr{definition}}\}
346 \item \cs{gls}\marg{\ntr{keyword}}
347 \item \cs{glspl}\marg{\ntr{keyword}}
348 \item \cs{Gls}\marg{\ntr{keyword}}
349 \item \cs{Glspl}\marg{\ntr{keyword}}
350\end{itemize}
351
352\section{Cross-referencing commands}
353Do not translate any of these commands:
354\begin{itemize}\ttfamily
355 \item \cs{label}\marg{label}
356 \item \cs{ref}\marg{label}
357 \item \cs{pageref}\marg{label}
358 \item \cs{nameref}\marg{label}
359 \item \cs{chaplink}\marg{label}
360 \item \cs{seclink}\marg{label}
361\end{itemize}
362
363\section{Other document commands}
364Do not translate any of the following:
365\begin{itemize}\ttfamily
366 \item \cs{frontcover}
367 \item \cs{mainmatter}
368 \item \cs{appendix}
369 \item \cs{backmatter}
370 \item \cs{providecommand}\marg{command name}\marg{command definition}
371 \item \cs{documentclass}\oarg{options}\marg{document type}
372 \item \cs{include}\marg{file}
373 \item \cs{begin}\marg{environment}
374 \item \cs{end}\marg{environment}
375 \item \cs{printglossaries}
376 \item \cs{printindex}
377 \item \cs{LoadLicenseFile}
378\end{itemize}
379
380
381\chapter{Notes for Editors}
382
383\section{Obsolete commands}
384
385There are a few commands that were used in the beginning of the project that have since been replaced. If you encounter any of these obsolete commands, please replace them with the updated command.
386
387\begin{description}
388 \item[\cs{menuitem}] This command should be replaced by the \cs{menu} command.
389 \item[\cs{nav}] This command should be replaced by the \cs{menu} command.
390 \item[\texttt{-{}-{}-}] This em dash command should be replaced by the \cs{dash} command.
391\end{description}
392
393
394\chapter{Installing \protect\TeX{} Live 2009}
395
396We're using a number of features that require the latest version of \TeX{} Live (2009). Unfortunately, the version of \TeX{} Live that comes with Ubuntu 9.10 is \TeX{} Live 2007. To install \TeX{} Live 2009, follow these steps:
397
398\begin{enumerate}
399 \item Uninstall all the Ubuntu TeX Live packages: \texttt{sudo apt-get remove texlive-*}
400 \item Download the TeX Live 2009 install script: \url{http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz}
401 \item Unpack the tarball: \texttt{tar -zxvf install-tl-unx.tar.gz}
402 \item Change to the newly-unpacked directory: \texttt{cd install-tl-*}
403 \item Run the script: \texttt{sudo ./install-tl}
404 \item Select where you'd like to install everything, and any other options you prefer. I highly recommend enabling the ``create symlinks to standard directories'' option.
405 \item To compile a translation, run: \texttt{make ubuntu-manual-\parg{lang}.pdf} where \parg{lang} is the language code (see the \texttt{po/} directory for a list of supported languages).
406\end{enumerate}
407
408Note that not all languages are supported yet (especially those requiring non-Latin scripts).
409
410If you have any questions or run into any problems, feel free to contact me. I'm usually in \smallcaps{IRC} as ``godbyk'' and can, of course, be contacted via email.
411
412
413\chapter{Word List}\label{ch:word-list}
414
415This chapter contains a list of words with their proper spelling and capitlization.
416
417\begin{multicols}{3}
418\obeylines%
419Bluetooth
420dial-up
421Ethernet
422gedit
423GNOME
424GNU/Linux
425KDE
426Red Hat
427session menu
428shut down
429Wi-Fi
430\end{multicols}
431
432
433\end{document}
0434
=== added symlink 'Help/godbyk/latex-handout/tufte-book.cls'
=== target is u'../../../tufte-book.cls'
=== added symlink 'Help/godbyk/latex-handout/tufte-common.def'
=== target is u'../../../tufte-common.def'
=== added symlink 'Help/godbyk/latex-handout/ubuntu-manual.cls'
=== target is u'../../../ubuntu-manual.cls'
=== added directory 'Help/godbyk/latex-slides'
=== added file 'Help/godbyk/latex-slides/Makefile'
--- Help/godbyk/latex-slides/Makefile 1970-01-01 00:00:00 +0000
+++ Help/godbyk/latex-slides/Makefile 2014-09-01 04:44:23 +0000
@@ -0,0 +1,15 @@
1all: latex-slides.pdf
2
3.PHONY: all clean show
4
5latex-slides.pdf: latex-slides.tex
6 xelatex latex-slides
7 xelatex latex-slides
8 xelatex latex-slides
9
10show: latex-slides.pdf
11 evince $< &
12
13clean:
14 -for F in aux log dvi pdf out toc glo idx bbl blg nav snm; do rm -fr *.$${F}; done
15
016
=== added file 'Help/godbyk/latex-slides/latex-slides.tex'
--- Help/godbyk/latex-slides/latex-slides.tex 1970-01-01 00:00:00 +0000
+++ Help/godbyk/latex-slides/latex-slides.tex 2014-09-01 04:44:23 +0000
@@ -0,0 +1,388 @@
1\documentclass[t,unicode,color={usenames,dvipsnames},xcolor={usenames,dvipsnames}]{beamer}
2
3\usepackage{xltxtra}
4\usepackage{polyglossia}
5\setromanfont[Mapping=tex-text,Numbers=OldStyle]{Linux Libertine O}
6\setsansfont[Mapping=tex-text,Numbers=OldStyle]{Linux Biolinum O}
7\setmonofont[Mapping=text-text,Scale=MatchLowercase]{DejaVu Sans Mono}
8
9
10\usepackage{graphics}
11%\usepackage{graphicx}
12
13\usepackage{xcolor}
14
15\hypersetup{
16 colorlinks,
17 pdftitle={LaTeX for Ubuntu Manual Authors and Translators},
18 pdfauthor={Kevin Godby},
19 pdfcreator={XeLaTeX},
20 pdfkeywords={latex, ubuntu, ubuntu manual, authors, editors, translators, tex, xelatex}
21}
22
23%\usepackage{handoutWithNotes}
24%\pgfpagesuselayout{4 on 1 with notes}[letterpaper,border shrink=5mm]
25
26\mode<presentation>
27{
28 %\usetheme{Dresden}
29 %\usetheme[
30 % titlebackgroundimagefile=./images/title-background,
31 % normalbackgroundimagefile=./images/main-background,
32 % opacity=0
33 %]{HCI}
34 %\setbeamercovered{transparent}
35}
36
37\setbeamertemplate{bibliography item}[article]
38
39\usepackage{pifont} % circles and boxes (for survey dingbats)
40\usepackage{bbding} % circles and boxes (for survey dingbats)
41
42\usepackage[overlay]{textpos} % for absolute positioning
43\setlength{\TPVertModule}{\the\paperheight}
44\setlength{\TPHorizModule}{\the\paperwidth}
45
46\usepackage{ummacros}
47
48\title{\LaTeX{} for Ubuntu Manual Authors and Translators}
49\author{Kevin Godby}
50%\institute{HCI 522: Scientific Methods of Human--Computer Interaction\\Human--Computer Interaction Program\\Iowa State University}
51\date{22--23 February 2010}
52
53\definecolor{important}{HTML}{980101}% same as accent deep red
54\newcommand{\highlight}[1]{\textcolor{important}{#1}}
55
56\usepackage{textcase}
57\newcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{#1}}}
58
59\renewenvironment{center}{\par\vskip-0.5\baselineskip\centering}{\par\vskip-0.5\baselineskip}
60\renewenvironment{flushleft}{\par\vskip-0.5\baselineskip\raggedright}{\par\vskip-0.5\baselineskip}
61\renewenvironment{flushright}{\par\vskip-0.5\baselineskip\raggedleft}{\par\vskip-0.5\baselineskip}
62
63\begin{document}
64
65\setlength{\parindent}{0pt}
66\setlength{\parskip}{\baselineskip}
67
68\begin{frame}
69 \titlepage
70\end{frame}
71
72\begin{frame}
73 \frametitle{Contents}
74 \tableofcontents
75\end{frame}
76
77\section{Introduction}
78
79\begin{frame}
80 \frametitle{What is the Ubuntu Manual project about?}
81 \textit{Getting Started with Ubuntu 10.04} aims to be a complete
82 beginner's manual for Ubuntu, featuring comprehensive guides, how-tos and
83 information on anything one needs to know after first installing Ubuntu.
84
85 Designed to be as user-friendly and easy-to-follow as possible, it will
86 provide the first point of reference to any Ubuntu newcomer with lots of
87 information in one easy-to-access \smallcaps{PDF}. Plus, every six months there will
88 be a new revision released to coincide with each new release of Ubuntu.
89\end{frame}
90
91\begin{frame}
92 \frametitle{What is \LaTeX?}
93 \LaTeX\ is the typesetting system we're using to create the manual's
94 \smallcaps{PDF}. It's similar to \smallcaps{HTML} in that the text is marked
95 up with special codes to denote the style of the text, but unlike
96 \smallcaps{HTML} it's also a complete programming language.
97
98 As authors, editors, and translators, you won't have to worry about the
99 programming side, just the markup side.
100\end{frame}
101
102\section{\protect\LaTeX{} for Authors and Editors}
103
104\begin{frame}
105 \frametitle{What does \LaTeX{} code look like?}
106 All of the \LaTeX{} code is stored in \texttt{.tex} files. These files are
107 regular text files that may be edited with your favorite text editor (e.g.,
108 vim, emacs, gedit).
109
110 The markup commands in \LaTeX{} begin with a backslash (\textbackslash). For example,
111 \begin{center}
112 \ttfamily My name is \highlight{\string\textbf\string{Kevin\string}}.
113 \end{center}
114 will be typeset as:
115 \begin{center}
116 \rmfamily My name is \highlight{\textbf{Kevin}}.
117 \end{center}
118\end{frame}
119
120\begin{frame}
121 \frametitle{What does \LaTeX{} code look like?}
122 \vskip\baselineskip%
123 \begin{center}
124 \ttfamily My name is \highlight{\string\textbf\string{}Kevin\highlight{\string}}.
125 \end{center}
126 The \texttt{\string\textbf} command tells \LaTeX{} to print the text in
127 \textbf{boldface} type. The braces (\texttt{\string{\string}}) tell \LaTeX{}
128 when to start and stop using bold text.
129
130 We avoid using these low-level commands, however, preferring instead to use
131 \emph{semantic markup.} Semantic markup means that, instead of telling
132 \LaTeX{} how something should look, we tell it what something \emph{means}.
133\end{frame}
134
135\begin{frame}
136 \frametitle{Semantic Markup}
137 For example, instead of typing:
138 \begin{center}
139 \ttfamily Pull down the \highlight{\string\textbf\string{Help\string}} menu and click \highlight{\string\textbf\string{About\string}}.
140 \end{center}
141 we would say:
142 \begin{center}
143 \ttfamily Pull down the \highlight{\string\menu\string{Help\string}} menu and click \highlight{\string\menu\string{About\string}}.
144 \end{center}
145 This ensures that all the menu items are formatted consistently throughout
146 the manual and also allows us to modify the formatting of the menu items in
147 one place, instead of editing each file.
148
149 We'll see a list of these semantic markup commands soon.
150\end{frame}
151
152\begin{frame}
153 \frametitle{Special Characters in \LaTeX{}}
154 Most text can be typed just as you'd expect, and everything will work great. There are, however, a few characters that need special handling.
155
156 \LaTeX{} knows the difference between opening and closing quotation marks. So instead of using the normal quotation marks (\texttt{\string"}), you will need to use two acute accents (``backticks'') for opening quotation marks, and two apostrophes for closing quotation marks:
157 \begin{center}
158 \ttfamily Kevin said, \highlight{\string`\string`}Quotation marks are special.\highlight{\string'\string'}
159 \end{center}
160 To interrupt a sentence, use the \highlight{\ttfamily\string\dash} command. This allows us to automatically use the appropriate dash based on the language. (US English uses an em dash without space---like this---while UK English uses an en dash with space\,--\,like this.)
161\end{frame}
162
163\begin{frame}
164 \frametitle{More Special Characters in \LaTeX{}}
165 There are a few more characters that \LaTeX{} considers special because it uses them in its programming language. They are:
166 \begin{center}
167 \ttfamily \$\qquad\%\qquad\_\qquad\{\qquad\}\qquad\&\qquad\#
168 \end{center}
169 If you want one of these characters to appear in the typeset document, put a backslash (\textbackslash) in front of that character. The above line was typed like this:
170 \begin{center}
171 \ttfamily \textbackslash\$\qquad\textbackslash\%\qquad\textbackslash\_\qquad\textbackslash\{\qquad\textbackslash\}\qquad\textbackslash\&\qquad\textbackslash\#
172 \end{center}
173 Finally, to type a backslash character, use the \texttt{\string\textbackslash} command.
174\end{frame}
175
176\begin{frame}
177 \frametitle{Document Structure}
178 \textit{Getting Started} has two parts, over ten chapters, and a slew of sections and subsections. Each of these heading levels has its own \LaTeX{} command that formats the heading and automatically adds it to the table of contents.
179
180 \begin{tabular}{ll}
181 \ttfamily\string\part & \ttfamily\string\chapter \\
182 \ttfamily\string\section & \ttfamily\string\subsection \\
183 \ttfamily\string\subsubsection
184 \end{tabular}
185
186 If you want to add a new section on how to install Frozen Bubble, for example, you would write:
187 \begin{center}
188 \ttfamily \string\section\string{Frozen Bubble\string}
189 \end{center}
190 and \LaTeX{} would print the section heading and add it to the table of contents at the front of the manual.
191\end{frame}
192
193\begin{frame}
194 \frametitle{Paragraphs and margin notes}
195 To start a new paragraph in \LaTeX{}, just add a blank line. You don't need to indent the paragraphs as \LaTeX{} will take care of this for you.
196
197 The manual uses margin notes to provide definitions, tips, and pointers to more information. To add a margin note, use the \texttt{\string\marginnote} command:
198 \begin{flushleft}
199 \ttfamily \highlight{\string\marginnote}\string{This text will appear in the\\
200 \hspace{10em} margin of the manual.\string}
201 \end{flushleft}
202\end{frame}
203
204\begin{frame}
205 \frametitle{Comments}
206 If you want to add a note to yourself (or others) in the \texttt{.tex} file,
207 just type a percent sign (\%) followed by your note. \LaTeX{} will ignore
208 everything on the line after the percent sign.
209 \begin{flushleft}
210 \ttfamily This text will appear in the PDF.
211 \highlight{\% But this text won't!}
212 \end{flushleft}
213
214 Remember, if you want a percent sign to actually appear in the \smallcaps{PDF}, you'll need to precede it with a backslash:
215 \begin{flushleft}
216 \ttfamily Linux users are 50\highlight{\textbackslash\%} smarter than non-Linux users.
217 \end{flushleft}
218\end{frame}
219
220\begin{frame}
221 \frametitle{GUI Elements}
222 The instructions we write often contain the names of \smallcaps{GUI} elements
223 such as menu items, buttons, check boxes, drop-down lists, etc. Each of
224 these elements has its own special formatting. To simplify the formatting of
225 these elements, we've created some new markup commands for them.
226
227 If you want to direct the user to choose a menu item, you would write:
228 \begin{flushleft}
229 \ttfamily
230 Click \highlight{\string\menu\string{Applications\string\then\space Accessories\string\then\space Calculator\string}} to start the \highlight{\string\application\string{Calculator\string}} application.
231 \end{flushleft}
232 which produces:
233 \begin{flushleft}
234 \rmfamily
235 Click \highlight{\menu{Applications\then Accessories\then Calculator}} to start the \highlight{\application{Calculator}} application.
236 \end{flushleft}
237\end{frame}
238
239\begin{frame}
240 \frametitle{GUI Elements}
241 The list of current commands for \smallcaps{GUI} elements follows:
242
243 \begingroup\ttfamily
244 \begin{tabular}{ll}
245 \string\button & \string\tab \\
246 \string\dropdown & \string\checkbox \\
247 \string\window & \string\keystroke \\
248 \string\radiobutton & \string\textfield \\
249 \string\application & \string\commandlineapp
250 \end{tabular}
251 \endgroup
252
253 There are a few antiquated commands used in the manual that should be updated if you see them:
254
255 Both \texttt{\string\menuitem} and \texttt{\string\nav} should be changed to \texttt{\string\menu}.
256
257 \texttt{\string\option} should be changed to \texttt{\string\checkbox}.
258\end{frame}
259
260\begin{frame}
261 \frametitle{Terminal Commands}
262 There are also special commands for typesetting text that appears or is entered into a terminal. An example will illustrate the commands:
263
264 \begin{flushleft}
265 \ttfamily
266 The \string\commandlineapp\{fortune\} program works like this:\par
267 \textbackslash begin\{terminal\}\\
268 \space\space \textbackslash prompt\space\textbackslash userinput\{fortune\}\\
269 What we have to learn to do we learn by doing.\\
270 \ \ \ -- Aristotle, Ethica Nicomachea II (c. 325 BC)
271 \textbackslash end\{terminal\}
272 \end{flushleft}
273
274 The above generates the following output:
275
276 \begin{flushleft}
277 \rmfamily
278 The \commandlineapp{fortune} program works like this:\par
279 \begingroup
280 \parindent1em\parskip0pt\ttfamily\obeylines\obeyspaces
281 \prompt \userinput{fortune}\par
282 What we have to learn to do we learn by doing.\par
283 \ \ \ -- Aristotle, Ethica Nicomachea II (c. 325 BC)
284 \endgroup
285 \end{flushleft}
286\end{frame}
287
288\begin{frame}
289 \frametitle{Lists}
290 There are two types of lists that we use in the manual: numbered lists and bulleted lists. Both lists work the same way, they just have different names.
291
292 \begin{minipage}{0.4\textwidth}
293 \parskip\baselineskip
294 \parindent0pt
295 \begin{flushleft}
296 \ttfamily
297 \string\begin\{itemize\}\\
298 \ \ \string\item\ First list item\\
299 \ \ \string\item\ Second list item\\
300 \ \ \string\item\ Third list item\\
301 \string\end\{itemize\}
302 \end{flushleft}
303
304 produces:
305
306 \begin{flushleft}
307 \rmfamily
308 \begin{itemize}
309 \item First list item
310 \item Second list item
311 \item Third list item
312 \end{itemize}
313 \end{flushleft}
314 \end{minipage}
315 \hfill
316 \begin{minipage}{0.4\textwidth}
317 \parskip\baselineskip
318 \parindent0pt
319 \begin{flushleft}
320 \ttfamily
321 \string\begin\{enumerate\}\\
322 \ \ \string\item\ First list item\\
323 \ \ \string\item\ Second list item\\
324 \ \ \string\item\ Third list item\\
325 \string\end\{enumerate\}
326 \end{flushleft}
327
328 produces:
329
330 \begin{flushleft}
331 \rmfamily
332 \begin{enumerate}
333 \item First list item
334 \item Second list item
335 \item Third list item
336 \end{enumerate}
337 \end{flushleft}
338 \end{minipage}
339\end{frame}
340
341\begin{frame}
342 \frametitle{Cross-Referencing}
343 You can refer the read to other chapters or sections for further information by using the \texttt{\string\chaplink} and \texttt{\string\seclink} commands.
344
345 \begin{flushleft}
346 \ttfamily
347 Please see \highlight{\string\chaplink\{ch:installation\}} for more information on installing Ubuntu.
348 \end{flushleft}
349
350 generates:
351
352 \begin{flushleft}
353 \rmfamily
354 Please see \highlight{\textbf{Chapter 1: Installation}} for more information on installing Ubuntu.
355 \end{flushleft}
356
357 The argument to the \texttt{\string\chaplink} and \texttt{\string\seclink} is a \emph{label}. The label is set using the \texttt{\string\label} command immediately after the \texttt{\string\chapter} or \texttt{\string\section} command.
358\end{frame}
359
360\section{\protect\LaTeX{} for Translators}
361
362\begin{frame}
363 \frametitle{Notes for Translators}
364 \LaTeX{} commands are preceded by a backslash character (\texttt{\textbackslash}). While the command names should \emph{not} be translated, their arguments sometimes should be.
365
366 In the following example, the red text should be translated, but the black text should be left as is:
367
368 \begin{flushleft}
369 \ttfamily
370 \highlight{Click} \string\menu\{\highlight{Applications}\string\then\ \highlight{Accessories}\string\then\ \highlight{Calculator}\} \highlight{to start the} \string\application\{\highlight{Calculator}\} \highlight{application.}
371 \end{flushleft}
372
373 The labels in the \texttt{\string\chaplink}, \texttt{\string\seclink}, and \texttt{\string\ref} commands should never be translated.
374\end{frame}
375
376\section{For More Information}
377
378\begin{frame}
379 \vfill
380 \begin{center}
381 \Huge Questions?
382 \end{center}
383 \vfill
384\end{frame}
385
386\end{document}
387
388
0389
=== added file 'Help/godbyk/latex-slides/ummacros.sty'
--- Help/godbyk/latex-slides/ummacros.sty 1970-01-01 00:00:00 +0000
+++ Help/godbyk/latex-slides/ummacros.sty 2014-09-01 04:44:23 +0000
@@ -0,0 +1,217 @@
1%
2% Idenfification
3%
4
5\NeedsTeXFormat{LaTeX2e}[1994/06/01]
6
7\ProvidesClass{ummacros}[2010/02/21 v0.0.1 Ubuntu manual macros]
8
9%
10% Load packages
11%
12
13\RequirePackage{xifthen}
14\RequirePackage[load=abbr,mode=text,alsoload=binary]{siunitx}% proper spacing and names for units
15
16% A command that prints an interrupting dash. Varies per language. (For example, US is ``---'' without spacing, UK is `` -- '' with space.)
17\newcommand{\dash}{\unskip\penalty0---\ignorespaces}
18
19%
20% Format the document style
21%
22
23% Ubuntu color palette
24\definecolor{UbuntuOrange} {HTML}{FF6309}% Ubuntu orange
25\definecolor{UbuntuYellow} {HTML}{FFB515}% Ubuntu yellow
26\definecolor{UbuntuRed} {HTML}{C90016}% Ubuntu red
27\definecolor{OrangeHilight} {HTML}{EEC73E}% oranges
28\definecolor{Orange} {HTML}{F0A513}
29\definecolor{OrangeBase} {HTML}{FB8B00}
30\definecolor{OrangeShadow} {HTML}{F44800}
31\definecolor{AccentYellowHilight} {HTML}{FDFF99}% yellows
32\definecolor{Yellow} {HTML}{FFFF00}
33\definecolor{AccentYellowBase} {HTML}{FDCA01}
34\definecolor{AccentYellowShadow} {HTML}{986601}
35\definecolor{AccentOrange} {HTML}{F44800}% reds
36\definecolor{AccentRed} {HTML}{FD3301}
37\definecolor{AccentRedBase} {HTML}{D40000}
38\definecolor{AccentDeepRed} {HTML}{980101}
39\definecolor{HumanHighlight} {HTML}{FDD99B}% skin tones
40\definecolor{Human} {HTML}{D9BB7A}
41\definecolor{HumanBase} {HTML}{816647}
42\definecolor{EnvironmentalShadow} {HTML}{565248}
43\definecolor{EnvironmentalBlueHighlight}{HTML}{AACCEE}% environmental blues
44\definecolor{EnvironmentalBlueMedium} {HTML}{6699CC}
45\definecolor{EnvironmentalBlueBase} {HTML}{336699}
46\definecolor{EnvironmentalBlueShadow} {HTML}{003366}
47\definecolor{AccentBlueHighlight} {HTML}{B3DEFD}% accent blues
48\definecolor{AccentBlue} {HTML}{0197FD}
49\definecolor{AccentBlueBase} {HTML}{0169C9}
50\definecolor{AccentBlueShadow} {HTML}{013397}
51\definecolor{AccentGreenHiglight} {HTML}{CCFF99}% greens
52\definecolor{AccentGreen} {HTML}{98FC66}
53\definecolor{AccentGreenBase} {HTML}{339900}
54\definecolor{AccentGreenShadow} {HTML}{015A01}
55\definecolor{UbuntuToner} {HTML}{002B3D}% toner
56\definecolor{AccentMagentHighlight} {HTML}{FF9BFF}% magentas
57\definecolor{AccentMagenta} {HTML}{FF00FF}
58\definecolor{AccentDarkViolet} {HTML}{6600CC}
59
60\definecolor{important}{HTML}{980101}% same as accent deep red
61
62%
63% Define useful macros
64%
65
66\newcommand{\notecallout}[2][Note]{%
67 \marginnote{\textbf{#1:} #2}
68}
69
70\newcommand{\marginnote}[1]
71{%
72 \marginpar{%
73 %\begin{minipage}{\marginparwidth}%
74 \raggedright\sffamily\footnotesize%
75 \hspace{0pt}#1%
76 %\end{minipage}%
77 }%
78}
79
80
81% An environment for displaying terminal output
82% po4a: environment terminal
83\newenvironment{terminal}{%
84 \begin{quotation}
85 \unskip\noindent\ttfamily\parskip0pt\parindent0pt\obeylines\ignorespaces%
86}{%
87 \end{quotation}%
88}
89
90% An environment to set the list of credits (names) in three columns.
91% po4a: environment credits
92\newenvironment{credits}[1][]{%
93 \begin{multicols}{3}[#1]%
94 \parskip0pt%
95 \parindent0pt%
96 \let\item\par%
97 \small%
98}{%
99 \end{multicols}%
100}
101
102% Macros to distinguish prompts and user input from program output in terminal displays
103\newcommand{\prompt}{\texttt{\$}~}
104\newcommand{\rootprompt}{\texttt{\#}~}
105\newcommand{\userinput}[1]{{\ttfamily\textcolor{AccentDeepRed}{#1}}}% FIXME we'll adjust this formatting later -- red for easy editing at the moment
106\newcommand{\code}[1]{{\ttfamily#1}}
107
108% Macro for advanced usage notes
109\newcommand{\advanced}[1]{%
110 \smallskip%
111 \begin{center}
112 \noindent%
113 \hspace{\parindent}%
114 \begin{minipage}[t]{0.25in}%
115 % FIXME \vspace{-\baselineskip}\includegraphics[width=0.25in]{warning.eps}\vspace{0pt}
116 \centering\Huge\textcolor{AccentDeepRed}{\textbf{!!}}
117 \end{minipage}%
118 \hfill%
119 \begin{minipage}[t]{\linewidth-0.5in}%
120 \vspace{-\baselineskip}\small\em#1%
121 \end{minipage}%
122 \hspace{\parindent}%
123 \end{center}
124 \smallskip\par%
125}
126
127% Macro for warning notes
128\newcommand{\warning}[1]{%
129 \smallskip%
130 \begin{center}
131 \noindent%
132 \hspace{\parindent}%
133 \begin{minipage}[t]{0.25in}%
134 % FIXME \vspace{-\baselineskip}\includegraphics[width=0.25in]{warning.eps}\vspace{0pt}
135 \centering\Huge\textcolor{AccentDeepRed}{\textbf{!}}
136 \end{minipage}%
137 \hfill%
138 \begin{minipage}[t]{\linewidth-0.5in}%
139 \vspace{-\baselineskip}\small\em#1%
140 \end{minipage}%
141 \hspace{\parindent}%
142 \end{center}
143 \smallskip\par%
144}
145
146
147% Macro for typesetting menu selection sequences.
148% \nav{Menu \then Submenu \then Subsubmenu} would generate text looking like
149% ``Menu --> Submenu --> Subsubmenu''.
150%\newcommand{\smallarrow}{\raisebox{0.333ex}{\scalebox{0.5}{\ding{228}}}}
151\@ifpackageloaded{fontspec}{%
152 \newcommand{\smallarrow}{‣}%
153}{%
154 \newcommand{\smallarrow}{\raisebox{0.250ex}{\scalebox{0.5}{\ding{228}}}}
155}
156\newcommand{\nav}[1]{%
157 \begingroup%
158 %\def\then{\unskip\ensuremath{\,\rightarrow\,}\ignorespaces}%
159 \def\then{\unskip\,\smallarrow\,\allowbreak\ignorespaces}%
160 \textbf{#1}%
161 \endgroup%
162}
163
164% Macro to format application names and index them
165\newcommand{\application}[1]{%
166 \textbf{#1}%
167 \index{#1}\index{applications!#1}%
168}
169
170% Macro to format command line programs and index them
171\newcommand{\commandlineapp}[1]{%
172 \textbf{#1}%
173 \index{#1}\index{command line!#1}%
174}
175
176% Macro to simplify linking to chapters
177\newcommand{\chaplink}[1]{%
178 % not using \autoref here because I don't want to fix the case of \chapterautorefname for individual languages --godbyk
179 \IfBeforeSubStringEmpty{ch:}{#1}{\hyperref[#1]{\@chapapp~}\ref{#1}\hyperref[#1]{: }\nameref{#1}}{\hyperref[ch:#1]{\@chapapp~}\ref{ch:#1}\hyperref[ch:#1]{: }\nameref{ch:#1}}%
180}
181
182% Macro to simplify linking to sections
183\newcommand{\seclink}[1]{%
184 %\IfBeforeSubStringEmpty{sec:}{#1}{\autoref{#1}\hyperref[#1]{: }\nameref{#1}}{\autoref{sec:#1}\hyperref[sec:#1]{: }\nameref{sec:#1}}%
185 \IfBeforeSubStringEmpty{sec:}{#1}{\nameref{#1}}{\nameref{sec:#1}}%
186}
187
188% Macros to format UI elements
189\newcommand{\button}[1]{\textbf{#1}}
190\newcommand{\tab}[1]{\textbf{#1}}
191\newcommand{\dropdown}[1]{\textbf{#1}}
192\newcommand{\checkbox}[1]{\textbf{#1}}
193\newcommand{\menuitem}[1]{\textbf{#1}}
194\newcommand{\window}[1]{``#1''}
195\newcommand{\keystroke}[1]{\texttt{#1}}
196\newcommand{\radiobutton}[1]{\textbf{#1}}
197\newcommand{\textfield}[1]{\textbf{#1}}
198\newcommand{\option}[1]{\enquote{#1}}
199\let\menu\nav
200
201% Screenshot placeholder
202\newcommand*{\screenshotslog}{screenshots.log}
203\newwrite\screenshots
204\newcommand{\screenshotTODO}[1]{%
205 \immediate\write\screenshots{Chapter \thechapter, page \thepage: #1}%
206 %\immediate\closeout\screenshots%
207 \par\noindent\parbox{\linewidth}{\begin{center}\sffamily\bfseries\color{important} M~I~S~S~I~N~G~~~S~C~R~E~E~N~S~H~O~T\par\medskip\footnotesize\normalcolor#1\end{center}}\par%
208}
209\AtBeginDocument{\immediate\openout\screenshots=\screenshotslog}% open the screenshots.log file
210\AtEndDocument{\immediate\closeout\screenshots}% close the screenshots.log file
211
212%
213% All done!
214%
215
216\endinput
217
0218
=== added file 'Help/groundcontrol.pdf'
1Binary files Help/groundcontrol.pdf 1970-01-01 00:00:00 +0000 and Help/groundcontrol.pdf 2014-09-01 04:44:23 +0000 differ219Binary files Help/groundcontrol.pdf 1970-01-01 00:00:00 +0000 and Help/groundcontrol.pdf 2014-09-01 04:44:23 +0000 differ
=== added file 'Help/intro.pdf'
2Binary files Help/intro.pdf 1970-01-01 00:00:00 +0000 and Help/intro.pdf 2014-09-01 04:44:23 +0000 differ220Binary files Help/intro.pdf 1970-01-01 00:00:00 +0000 and Help/intro.pdf 2014-09-01 04:44:23 +0000 differ
=== added file 'Help/launchpad.pdf'
3Binary files Help/launchpad.pdf 1970-01-01 00:00:00 +0000 and Help/launchpad.pdf 2014-09-01 04:44:23 +0000 differ221Binary files Help/launchpad.pdf 1970-01-01 00:00:00 +0000 and Help/launchpad.pdf 2014-09-01 04:44:23 +0000 differ
=== added file 'Help/socialmedia.pdf'
4Binary files Help/socialmedia.pdf 1970-01-01 00:00:00 +0000 and Help/socialmedia.pdf 2014-09-01 04:44:23 +0000 differ222Binary files Help/socialmedia.pdf 1970-01-01 00:00:00 +0000 and Help/socialmedia.pdf 2014-09-01 04:44:23 +0000 differ
=== added file 'Help/writingstyle.pdf'
5Binary files Help/writingstyle.pdf 1970-01-01 00:00:00 +0000 and Help/writingstyle.pdf 2014-09-01 04:44:23 +0000 differ223Binary files Help/writingstyle.pdf 1970-01-01 00:00:00 +0000 and Help/writingstyle.pdf 2014-09-01 04:44:23 +0000 differ
=== added file 'Makefile'
--- Makefile 1970-01-01 00:00:00 +0000
+++ Makefile 2014-09-01 04:44:23 +0000
@@ -0,0 +1,242 @@
1LATEXFILE=main
2
3.PHONY: translations clean show all mylang show-mylang
4SHELL=/bin/bash
5
6all: $(LATEXFILE).pdf
7
8CHAPTERS=\
9 frontmatter/*.tex \
10 around-desktop/*.tex \
11 backmatter/*.tex \
12 command-line/*.tex \
13 credits/*.tex \
14 default-apps/*.tex \
15 installation/*.tex \
16 learning-more/*.tex \
17 maintenance/maintenance.tex \
18 prefs-hardware/*.tex \
19 prologue/*.tex \
20 security/*.tex \
21 software-packaging/*.tex \
22 troubleshooting/*.tex
23
24
25$(LATEXFILE).pdf: $(LATEXFILE).tex ubuntu-manual.cls $(CHAPTERS) revinfo
26 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
27 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
28 makeglossaries -L english $(LATEXFILE)
29 makeindex $(LATEXFILE)
30 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
31 makeglossaries -L english $(LATEXFILE)
32 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
33 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
34 xelatex --output-driver="xdvipdfmx -V 5" $(LATEXFILE)
35 $(color_tex) $(LATEXFILE).log
36
37check: $(LATEXFILE).pdf
38 $(color_tex) $(LATEXFILE).log
39
40style-guide.pdf: style-guide.tex ubuntu-manual.cls
41 xelatex --output-driver="xdvipdfmx -V 5" style-guide
42 xelatex --output-driver="xdvipdfmx -V 5" style-guide
43 makeglossaries -L english style-guide
44 makeindex style-guide
45 xelatex --output-driver="xdvipdfmx -V 5" style-guide
46 makeglossaries -L english style-guide
47 xelatex --output-driver="xdvipdfmx -V 5" style-guide
48 xelatex --output-driver="xdvipdfmx -V 5" style-guide
49 xelatex --output-driver="xdvipdfmx -V 5" style-guide
50 $(color_tex) style-guide.log
51
52
53# Handle translations
54TRANSLATIONS=$(shell for PO in po/*.po; do basename $$PO .po; done) # list of languages in the po/ dir
55TRANSLATIONS_TEX=$(foreach PO, $(TRANSLATIONS), ubuntu-manual-$(shell basename $(PO) .po).tex) # list of .tex files to be generated
56TRANSLATIONS_PDF=$(foreach PO, $(TRANSLATIONS), ubuntu-manual-$(shell basename $(PO) .po).pdf) # list of .pdf files to be generated
57
58# Default translation is en_US
59ubuntu-manual-en_US.pdf: $(LATEXFILE).pdf
60 cp $(LATEXFILE).pdf $@
61
62# Compile all translations at once
63translations: $(TRANSLATIONS_PDF) ubuntu-manual.cls
64
65LLANG=$(shell echo $${LANG} | sed -e 's/\..*$$//g')
66SLANG=$(shell echo $${LANG} | sed -e 's/_.*$$//g')
67MYLANG=$(shell for PO in ${TRANSLATIONS}; do if [ "$${PO}" == "${LLANG}" ]; then echo ${LLANG}; exit 0; elif [ "$${PO}" == "${SLANG}" ]; then echo ${SLANG}; exit 0; fi; done; echo "en_US")
68
69# Compile the pdf for the current system language (if there's an appropriate translation)
70mylang: ubuntu-manual-${MYLANG}.pdf
71
72%.tex: revinfo
73 po4a-translate --master-charset=utf8 -f latex -m main.tex -p $(subst .tex,.po,$(subst ubuntu-manual-,po/,$@)) -l $@ -k 0
74
75%.tex: %.po ubuntu-manual.cls revinfo
76 po4a-translate --master-charset=utf8 -f latex -m main.tex -p $< -l ubuntu-manual-$(shell basename $< .po).tex -k 0
77
78%.pdf: POLANG=$(shell basename $(subst ubuntu-manual-,,$<) .tex)
79%.pdf: TEXFILE=$(shell basename $< .tex)
80%.pdf: XINDYLANG=$(shell grep -v "^#" langcodes.txt | grep "^${POLANG}" | awk '{ print $$3 }' || echo -n "general")
81
82%.pdf: %.tex ubuntu-manual.cls revinfo
83 #$(call generate_titlepage,${POLANG})
84 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode "\def\polang{${POLANG}}\input{${TEXFILE}}"
85 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode "\def\polang{${POLANG}}\input{${TEXFILE}}"
86 makeglossaries -L ${XINDYLANG} ${TEXFILE}
87 #texindy -L ${XINDYLANG} -C utf8 ${TEXFILE}.idx
88 xindy -C utf8 -M texindy -L ${XINDYLANG} ${TEXFILE}.idx
89 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode '\def\polang{$(POLANG)}\input{$(TEXFILE)}'
90 makeglossaries -L ${XINDYLANG} $(TEXFILE)
91 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode '\def\polang{$(POLANG)}\input{$(TEXFILE)}'
92 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode '\def\polang{$(POLANG)}\input{$(TEXFILE)}'
93 xelatex --output-driver="xdvipdfmx -V 5" -interaction nonstopmode '\def\polang{$(POLANG)}\input{$(TEXFILE)}'
94 $(color_tex) $(TEXFILE).log
95
96revinfo:
97 bzr version-info --custom --template="\\\noindent\\\revinfo{{revno}}{{date}}" > revision.tex
98
99
100generate_titlepage = \
101 inkscape --export-text-to-path --export-pdf=titlepage/titlepage-$(1).pdf titlepage/titlepage-$(1).svg
102
103#titlepage/titlepage-%.pdf: titlepage/titlepage-%.svg
104# inkscape --export-text-to-path --export-pdf=$(subst .svg,.pdf,$<) $<
105
106%.pdf: %.asy
107 asy -f pdf $<
108
109%.pdf: %.svg
110 inkscape --export-text-to-path --export-pdf=$@ $<
111 #pdfcrop $@ $@
112
113%.png: %.dot
114 dot -v -Tpng $< -o $@
115
116show: $(LATEXFILE).pdf
117 evince $<
118
119show-mylang: ubuntu-manual-${MYLANG}.pdf
120 evince $<
121
122clean:
123 -rm -fr $(LATEXFILE).aux $(LATEXFILE).log $(LATEXFILE).nav $(LATEXFILE).out $(LATEXFILE).pdf $(LATEXFILE).snm $(LATEXFILE).toc
124 -rm -fr $(LATEXFILE).idx $(LATEXFILE).ilg $(LATEXFILE).ind $(LATEXFILE).lof $(LATEXFILE).lot
125 -rm -fr $(LATEXFILE).glg $(LATEXFILE).glo $(LATEXFILE).gls $(LATEXFILE).xdy
126 -rm -f missfont.log
127 -rm -f */*.aux
128 -rm -f */*.log
129 -rm -f *.bbl *.blg */*.bbl */*.blg # biblio files
130 -rm -f *.ptc # titletoc
131 -rm -f ubuntu-manual-* # translated files
132
133
134#
135# From Chris Monson's LaTeX Makefile
136#
137
138SED ?= sed
139TPUT ?= tput
140
141tput = $(shell $(TPUT) $1)
142
143black := $(call tput,setaf 0)
144red := $(call tput,setaf 1)
145green := $(call tput,setaf 2)
146yellow := $(call tput,setaf 3)
147blue := $(call tput,setaf 4)
148magenta := $(call tput,setaf 5)
149cyan := $(call tput,setaf 6)
150white := $(call tput,setaf 7)
151bold := $(call tput,bold)
152uline := $(call tput,smul)
153reset := $(call tput,sgr0)
154
155#
156# User-settable definitions
157#
158LATEX_COLOR_WARNING ?= magenta
159LATEX_COLOR_ERROR ?= red
160LATEX_COLOR_INFO ?= green
161LATEX_COLOR_UNDERFULL ?= magenta
162LATEX_COLOR_OVERFULL ?= red bold
163LATEX_COLOR_PAGES ?= bold
164LATEX_COLOR_BUILD ?= blue
165LATEX_COLOR_GRAPHIC ?= yellow
166LATEX_COLOR_DEP ?= green
167LATEX_COLOR_SUCCESS ?= green bold
168LATEX_COLOR_FAILURE ?= red bold
169
170# Gets the real color from a simple textual definition like those above
171# $(call get-color,ALL_CAPS_COLOR_NAME)
172# e.g., $(call get-color,WARNING)
173get-color = $(subst $(space),,$(foreach c,$(LATEX_COLOR_$1),$($c)))
174
175#
176# STANDARD COLORS
177#
178C_WARNING := $(call get-color,WARNING)
179C_ERROR := $(call get-color,ERROR)
180C_INFO := $(call get-color,INFO)
181C_UNDERFULL := $(call get-color,UNDERFULL)
182C_OVERFULL := $(call get-color,OVERFULL)
183C_PAGES := $(call get-color,PAGES)
184C_BUILD := $(call get-color,BUILD)
185C_GRAPHIC := $(call get-color,GRAPHIC)
186C_DEP := $(call get-color,DEP)
187C_SUCCESS := $(call get-color,SUCCESS)
188C_FAILURE := $(call get-color,FAILURE)
189C_RESET := $(reset)
190
191
192
193color_tex := \
194 @$(SED) \
195 -e '$${' \
196 -e ' /^$$/!{' \
197 -e ' H' \
198 -e ' s/.*//' \
199 -e ' }' \
200 -e '}' \
201 -e '/^$$/!{' \
202 -e ' H' \
203 -e ' d' \
204 -e '}' \
205 -e '/^$$/{' \
206 -e ' x' \
207 -e ' s/^\n//' \
208 -e ' /Output written/{' \
209 -e ' s/.*(\([^)]\{1,\}\)).*/Success! Wrote \1/' \
210 -e ' s/[[:digit:]]\{1,\}/$(C_PAGES)&$(C_RESET)/g' \
211 -e ' s/Success!/$(C_SUCCESS)&$(C_RESET)/g' \
212 -e ' b end' \
213 -e ' }' \
214 -e ' /! *LaTeX Error:.*/{' \
215 -e ' s/.*\(! *LaTeX Error:.*\)/$(C_ERROR)\1$(C_RESET)/' \
216 -e ' b end' \
217 -e ' }' \
218 -e ' /.*Warning: Marginpar on page [0-9]\+ moved\./{' \
219 -e ' s//$(C_RESET)&$(C_RESET)/' \
220 -e ' b end' \
221 -e ' }' \
222 -e ' /.*Warning: Reference .*/{' \
223 -e ' s//$(C_ERROR)&$(C_RESET)/' \
224 -e ' b end' \
225 -e ' }' \
226 -e ' /.*Warning:.*/{' \
227 -e ' s//$(C_WARNING)&$(C_RESET)/' \
228 -e ' b end' \
229 -e ' }' \
230 -e ' /Underfull.*/{' \
231 -e ' s/.*\(Underfull.*\)/$(C_UNDERFULL)\1$(C_RESET)/' \
232 -e ' b end' \
233 -e ' }' \
234 -e ' /Overfull.*/{' \
235 -e ' s/.*\(Overfull.*\)/$(C_OVERFULL)\1$(C_RESET)/' \
236 -e ' b end' \
237 -e ' }' \
238 $(if $(VERBOSE),,-e ' d') \
239 -e ' :end' \
240 -e ' G' \
241 -e '}' \
242
0243
=== renamed file 'Makefile' => 'Makefile.moved'
=== added file 'Makefile.orig'
--- Makefile.orig 1970-01-01 00:00:00 +0000
+++ Makefile.orig 2014-09-01 04:44:23 +0000
@@ -0,0 +1,3142 @@
1# Copyright 2004 Chris Monson (shiblon@gmail.com)
2# Latest version available at http://www.bouncingchairs.net/oss
3#
4# This file is part of ``Chris Monson's Free Software''.
5#
6# ``Chris Monson's Free Software'' is free software; you can redistribute it
7# and/or modify it under the terms of the GNU General Public License as
8# published by the Free Software Foundation, Version 2.
9#
10# ``Chris Monson's Free Software'' is distributed in the hope that it will
11# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13# Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with ``Chris Monson's Free Software''; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19# It is also available on the web at http://www.gnu.org/copyleft/gpl.html
20#
21# Note that using this makefile to build your documents does NOT place them
22# under the GPL unless you, the author, specifically do so. In other words,
23# I, Chris Monson, the copyright holder and author of this makefile,
24# consider it impossible to ``link'' to this makefile in any way covered by
25# the GPL.
26#
27# TO OBTAIN INSTRUCTIONS FOR USING THIS FILE, RUN:
28# make help
29#
30fileinfo := LaTeX Makefile
31author := Chris Monson
32version := 2.1.40
33#
34# If you specify sources here, all other files with the same suffix
35# will be treated as if they were _include_ files.
36#onlysources.tex ?= main.tex
37#onlysources.tex.sh ?=
38#onlysources.rst ?=
39#onlysources.fig ?=
40#onlysources.gpi ?=
41#onlysources.dot ?=
42#onlysources.xvg ?=
43#onlysources.svg ?=
44#onlysources.eps.gz ?=
45#onlysources.eps ?=
46#
47# If you list files here, they will be treated as _include_ files
48#includes.tex ?= file1.tex file2.tex
49#includes.tex.sh ?=
50#includes.rst ?=
51#includes.fig ?=
52#includes.gpi ?=
53#includes.dot ?=
54#includes.xvg ?=
55#includes.svg ?=
56#includes.eps.gz ?=
57#includes.eps ?=
58#
59# If you list files or wildcards here, they will *not* be cleaned - default is
60# to allow everything to be cleaned.
61#neverclean ?= *.pdf
62#
63# Alternatively (recommended), you can add those lines to a Makefile.ini file
64# and it will get picked up automatically without your having to edit this
65# Makefile.
66-include Makefile.ini
67
68# TODO:
69# * Sometimes we get
70# "mv: cannot stat '*.dvi.1st.make': No such file or directory"
71# on the second build (if nothing triggered a .d rebuild, but
72# the .dvi rule fired anyway). To reproduce in the
73# dissertation directory:
74#
75# make clean
76# make byumsphd-example
77# make byumsphd-example
78#
79# KNOWN ISSUES:
80# * The following occurs:
81# file with: \usepackage{named}\bibliographystyle{named}
82# Compile
83# change to: \usepackage{apalike}\bibliographystyle{apalike}
84# Compile again -- BARF!
85#
86# The workaround: make clean-nographics; make
87#
88# Note that we may not be able to fix this. LaTeX itself barfs
89# on this, not the makefile. The very first invocation of LaTeX
90# (when something like this has happened) reads the existing .aux
91# file and discovers invalid commands like \citeauthoryear that
92# are only valid in the package that was just removed. It then
93# tries to parse them and explodes. It's not at all clear to me
94# how to fix this. I tried removing the .aux files on the first
95# run of LaTeX, but that necessarily requires more subsequent
96# rebuilds on common edits. There does not appear to be a
97# graceful solution to this issue.
98#
99# CHANGES:
100# Chris Monson (2009-12-01):
101# * Bumped version to 2.1.40
102# * issue 36: build all indices (for e.g., splitidx usage)
103# * issue 59: clean up all generated files (including indices)
104# Chris Monson (2009-11-23):
105# * Bumped version to 2.1.39
106# * issue 57: change ps2pdf invocations to just use gs directly
107# Chris Monson (2009-11-19):
108# * Bumped version to 2.1.38
109# * issue 57: Added some limited support for Cygwin (spaces in filenames)
110# Chris Monson (2009-11-15):
111# * Bumped version to 2.1.37
112# * Removed svninfo, since this is now managed by mercurial
113# * Fixed typo in changelist
114# * Issue 52: added jpg->eps conversion (thanks to brubakee)
115# * Issue 54: fix missing Overfull colorization due to lack of a blank
116# line preceding the first error.
117# * Issue 51: remove head.tmp and body.tmp in make clean invocation
118# * Issue 56: maintain multiple versions of log files (for debugging)
119# Chris Monson (2009-11-14):
120# * Bumped version to 2.1.36
121# * Issues 53 and 49: added .brf, .mtc, and .maf to the cleanables
122# Chris Monson (2009-11-05):
123# * Bumped version to 2.1.35
124# * Added nomenclature support (see issue 48)
125# Chris Monson (2009-10-29):
126# * Bumped version to 2.1.34
127# * Fixed _out_ creation bug introduced in 2.1.33 (it was always created)
128# * Fixed erroneous help output for $HOME in BINARY_TARGET_DIR
129# * Changed contact email address - bring on the spam!
130# Chris Monson (2009-10-21):
131# * Bumped version to 2.1.33
132# * Fixed issue 46, adding support for dot2tex (thanks to fdemesmay)
133# * Made all_files.* settable in Makefile.ini (using ?= instead of :=)
134# * Fixed issue 47, thanks to fdemesmay: add binary copy directory, copy
135# dvi, pdf, and ps if it exists
136# Chris Monson (2009-09-25):
137# * Bumped version to 2.1.32
138# * Fixed so that a changed lol file will cause a rebuild
139# * Added .lol files to the cleanable list
140# Chris Monson (2009-09-08):
141# * Bumped version to 2.1.31
142# * Closed issue 43: evince doesn't notice pdf change w/out touch
143# Chris Monson (2009-08-28):
144# * Bumped version to 2.1.30
145# * Closed issue 39: Capture multi-line log warnings/errors to output
146# Chris Monson (2009-08-26):
147# * Bumped version to 2.1.29
148# * Closed issue 42: add svg support using inkscape
149# Chris Monson (2009-08-17):
150# * Bumped version to 2.1.28
151# * Patch from paul.biggar for issue 38: package warnings are overlooked
152# Chris Monson (2009-08-07):
153# * Bumped version to 2.1.27
154# * Included patch for issue 37 - removes pdf/ps files before copying,
155# allowing some broken viewers to see changes properly.
156# Chris Monson (2009-05-15):
157# * Bumped version to 2.1.26
158# * Included patch for issue 9 from favonia - detects .fig changes for
159# pstex files during regular compilation, so long as the pstex
160# has been built at least once with make all-pstex.
161# Chris Monson (2009-03-27):
162# * Bumped version to 2.1.25
163# * Cleaned up a bunch of variable setting stuff - more stuff is now
164# settable from Makefile.ini
165# * Cleaned up documentation for various features, especially settable
166# variables.
167# * issue 28: support for png -> eps conversion (it even looks good!)
168# * issue 29: support for "neverclean" files in Makefile.ini
169# * issue 30: make ps2pdf14 the default - fall back when not there
170# Chris Monson (2009-03-09):
171# * Bumped version to 2.1.24
172# * issue 27: xmgrace support (thanks to rolandschulzhd)
173# Chris Monson (2008-10-23):
174# * Bumped version to 2.1.23
175# * issue 23: fixed _check_programs to not use bash string subs
176# Chris Monson (2008-09-02):
177# * Bumped version to 2.1.22
178# * Appled patch from Holger <yllohy@googlemail.com> to add include
179# sources and some documentation updates.
180# * Updated backup_patterns to be a bit more aggressive (also thanks to
181# Holger)
182# Chris Monson (2008-08-30):
183# * Bumped version to 2.1.21
184# * Added ability to specify onlysources.* variables to indicate the only
185# files that should *not* be considered includes. Thanks to Holger
186# <yllohy@googlemail.com> for this patch.
187# * Added an automatic include of Makefile.ini if it exists. Allows
188# settings to be made outside of this makefile.
189# Chris Monson (2008-05-21):
190# * Bumped version to 2.1.20
191# * Added manual pstex compilation support (run make all-pstex first)
192# * Removed all automatic pstex support. It was totally breaking
193# everything and is very hard to incorporate into the makefile
194# concept because it requires LaTeX to *fail* before it can
195# determine that it needs the files.
196# Chris Monson (2008-04-17):
197# * Bumped version to 2.1.19
198# * Changed the pstex build hack to be on by default
199# Chris Monson (2008-04-09):
200# * Bumped version to 2.1.18
201# * issue 16: fixed pstex build problems, seems nondeterministic. Added
202# gratuitious hack for testing: set PSTEX_BUILD_ALL_HACK=1.
203# Chris Monson (2008-04-09):
204# * Bumped version to 2.1.17
205# * issue 20: fixed accumulation of <pid>*.make files - wildcard was
206# refusing to work on files that are very recently created.
207# Chris Monson (2008-04-02):
208# * Bumped version to 2.1.16
209# * issue 19: Removed the use of "type" to fix broken "echo" settings
210# Chris Monson (2008-03-27):
211# * Bumped version to 2.1.15
212# * issue 18: Favors binary echo over builtin, as binary understands -n
213# * issue 16: Fixed handling of missing pstex_t files in the log
214# * issue 9: Added .SECONDARY target for .pstex files
215# Chris Monson (2008-03-21):
216# * Bumped version to 2.1.14
217# * Fixed broken aux file flattening, which caused included bibs to be
218# missed.
219# Chris Monson (2008-03-20):
220# * Bumped version to 2.1.13
221# * Changed error output colorization to show errors for missing files
222# that are not graphics files.
223# Chris Monson (2008-03-20):
224# * Bumped version to 2.1.12
225# * Fixed a regression introduced in r28 that makes bibtex fail when
226# there is no index file present
227# Chris Monson (2008-03-03):
228# * Bumped version to 2.1.11
229# * Fixed issue 11 (handle index files, reported by abachn)
230# * Cleaned up some comments and help text
231# Chris Monson (2008-01-24):
232# * Bumped version to 2.1.10
233# * Fixed to work when 'sh' is a POSIX shell like 'dash'
234# Chris Monson (2007-12-12):
235# * Bumped version to 2.1.9
236# * Fixed documentation and dependency graph for pstex files
237# Chris Monson (2007-12-12):
238# * Bumped version to 2.1.8
239# * Added basic pstex_t support for fig files (Issue 9 by favonia)
240# I still suggest that psfrag be used instead.
241# Chris Monson (2007-10-16):
242# * Bumped version to 2.1.7
243# * Removed todo item: allow other comment directives for rst conversion
244# * Added ability to use global rst style file _rststyle_._include_.tex
245# * Added help text to that effect
246# Chris Monson (2007-05-20):
247# * Bumped version to 2.1.6
248# * Changed default paper size for rst files
249# * Added todo item: fix paper size for rst files
250# * Added todo item: allow other comment directives for rst conversion
251# Chris Monson (2007-04-02):
252# * Bumped version to 2.1.5
253# * Addressed Issue 7, incorrect .gpi.d generation in subdirectories
254# Chris Monson (2007-03-28):
255# * Bumped version to 2.1.4
256# * Fixed syntax error in dot output
257# Chris Monson (2007-03-01):
258# * Bumped version to 2.1.3
259# * Added reST to the included documentation
260# * Fixed graphics and script generation to be settable in the
261# environment.
262# Chris Monson (2007-02-23):
263# * Bumped version to 2.1.2
264# * Added the ability to generate .tex files from .rst files
265# Chris Monson (2006-10-17):
266# * Bumped version to 2.1.1
267# * Fixed includes from subdirectories (sed-to-sed slash escape problem)
268# Chris Monson (2006-10-05):
269# * Bumped version to 2.1.0 (pretty serious new feature added)
270# * New feature: bib files can now be anywhere on the BIBINPUTS path
271# * New programs: kpsewhich (with tetex) and xargs (BSD)
272# Chris Monson (2006-09-28):
273# * Bumped version to 2.0.9
274# * Added ability to parse more than one bibliography
275# Chris Monson (2006-06-01):
276# * Bumped version to 2.0.8
277# * Added .vrb to the list of cleaned files
278# Chris Monson (2006-04-26):
279# * Bumped version to 2.0.7
280# * Fixed so that clean-nographics does not remove .gpi.d files
281# * Removed jpg -> eps hack (not working properly -- just pre-convert)
282# * Fixed so that postscript grayscale can be done with BSD sed
283# Chris Monson (2006-04-25):
284# * Bumped version to 2.0.6
285# * Fixed so that changed toc, lot, lof, or out causes a rebuild
286# Chris Monson (2006-04-17):
287# * Bumped version to 2.0.5
288# * Added jpg -> eps conversion target
289# Chris Monson (2006-04-12):
290# * Bumped version to 2.0.4
291# * Fixed BSD sed invocation to not use \| as a branch delimiter
292# * Added a comment section on what is and is not allowed in BSD sed
293# * Made paper size handling more robust while I was at it
294# * Fixed postscript RGB grayscale to use a weighted average
295# * Fixed postscript HSB grayscale to convert to RGB first
296# * Fixed a problem with rebuilding .bbl files
297# Chris Monson (2006-04-11):
298# * Bumped version to 2.0.3
299# * Fixed some BSD sed problems: can't use \n in substitutions
300# Chris Monson (2006-04-10):
301# * Bumped version to 2.0.2
302# * Once again removed ability to create .tex files from scripts
303# * \includeonly works again
304# Chris Monson (2006-04-09):
305# * Bumped version to 2.0.1
306# * Fixed grayscale postscript handling to be more robust
307# * Added ability to generate ._gray_. files from eps and eps.gz
308# * Added ability to clean ._gray_.eps files created from .eps files
309# Chris Monson (2006-04-07):
310# * Bumped version to 2.0.0
311# * Removed clunky ability to create included .tex files from scripts
312# * Added note in the help about included tex scripting not working
313# * Fixed the .eps generation to delete %.gpihead.make when finished
314# * Abandoned designs to use shell variables to create sed scripts
315# * Abandoned __default__.tex.sh idea: it causes recursion with %: .
316# * Removed web page to-do. All items are now complete.
317# * Added better grayscale conversion for dot figures (direct ps fixup).
318# * Include files can now be scripted (at the expense of \includeonly).
319# * Updated dependency graph to contain better node names.
320# Chris Monson (2006-04-06):
321# * Bumped version to 2.0b3
322# * Top level includes now fail if there is no rule to build them
323# * A helpful message is printed when they do fail
324# * Grayscale has been changed to be ._gray_, other phonies use _ now, too
325# * Grayscale handling has been completed
326# * Changed _include_stems target to _includes target.
327# * Fixed _includes target to be useful by itself.
328# * Removed the ability to specify clean and build targets at once
329# * Verified that epsfig works fine with current code
330# * Fixed included scripts so that they are added to the dep files
331# * Fixed so that graphics includes don't happen if they aren't for gpi
332# * Fixed dot output to allow grayscale.
333# Chris Monson (2006-04-05):
334# * Bumped version to 2.0b2
335# * Removed automatic -gray output. It needs fixing in a bad way.
336# * Revamped dependency creation completely.
337# * Fixed conditional inclusion to actually work (test.nobuild.d, test.d).
338# * Fixed clean target to remove log targets
339# * Added the 'monochrome' word for gray gpi output
340# * Added a _check_gpi_files target that checks for common problems
341# * Changed the _version target into the version target (no _)
342# * Added better handling of grayscale files. Use the .gray.pdf target.
343# * Fixed testing for rebuilds
344# Chris Monson (2006-04-04):
345# * Bumped version to 2.0b1
346# * Changed colorization of output
347# * Made .auxbbl and .auxtex .make files secondary targets
348# * Shortened and simplified the final latex invocation loop
349# * Added version-specific output ($$i vs. $$$$i) in latex loop
350# * Added a build message for the first .dvi run (Building .dvi (0))
351# * Removed some build messages that most people don't care about.
352# * Simplified procedure for user-set colors -- simple text specification
353# * Fixed diff output to...not output.
354# * Fixed rerun bug -- detect not only when preceded with LaTeX Warning
355# * Sped up gpi plotting
356# * Added error handling and colorized output for gpi failure
357# * Documented color changing stuff.
358# * Now sort the flattened aux file to avoid false recompilation needs
359# * Added clean-nographics target
360# * Don't remove self.dvi file if self.aux is missing in the log
361# * Clarified some code. Did some very minor adjusting.
362# Chris Monson (2006-04-03):
363# * Bumped version to 2.0a7
364# * Added .dvi and .ps files as secondary files.
365# * Fixed handling of multiple run detection when includeonly is in use.
366# * Added code to flatten .aux files.
367# * Added more files as .SECONDARY prerequisites to avoid recompilation.
368# * Fixed the inputs generation to be much simpler and to use pipes.
369# * Added the dependency graph directly into the makefile.
370# * Changed flatten-aux to remove \@writefile \relax \newlabel, etc.
371# * Undid pipe changes with sed usage (BSD sed doesn't know -f-).
372# * Added a _check_programs target that tells you what your system has.
373# * Fixed an error in colorization that made unnecessary errors appear
374# * Added view targets.
375# * Updated help text.
376# * Augmented cookies so that .aux can trigger .bbl and .dvi rebuilds
377# * Added more informative error handling for dvips and ps2pdf
378# Chris Monson (2006-04-02):
379# * Bumped version to 2.0a6
380# * Added indirection to .bbl dependencies to avoid rebuilding .bbl files
381# * Streamlined the diff invocation to eliminate an existence test
382# * Removed special shell quote escape variables
383# * Moved includes to a more prominent location
384# * Fixed .inputs.make to not contain .aux files
385# * Fixed embedding to use a file instead of always grepping.
386# * Added *.make.temp to the list of cleanable files
387# * Fixed Ruby. It should now be supported properly.
388# * Now differentiate between all, default, and buildable files.
389# * Fixed to bail out on serious errors.
390# * Revised the handling of includable files. Still working on it.
391# Chris Monson (2006-03-31):
392# * Bumped version to 2.0a5
393# * Fixed a bug with LaTeX error detection (there can be spaces)
394# * Added .bbl support, simplifying everything and making it more correct
395# * Refactored some tests that muddy the code
396# * Did a little cleanup of some shell loops that can safely be make loops
397# * Added support for graphviz .dot files
398# * Made _all_programs output easier to read
399# * Added the ruby support that has long been advertised
400# * Font embedding was screwed up for PostScript -- now implicit
401# * Changed the generation of -gray.gpi files to a single command
402# * Changed any make-generated file that is not included from .d to .make
403# Chris Monson (2006-03-30):
404# * Bumped version to 2.0a4
405# * Fixed a bug with very long graphics file names
406# * Added a todo entry for epsfig support
407# * Fixed a bug paper size bug: sometimes more than one entry appears
408# * Fixed DVI build echoing to display the number instead of process ID
409# * DVI files are now removed on first invocation if ANY file is missing
410# * Added a simple grayscale approach: if a file ends with -gray.gpi, it
411# is created from the corresponding .gpi file with a special
412# comment ##GRAY in its header, which causes coloring to be
413# turned off.
414# * Fixed a bug in the handling of .tex.sh files. For some reason I had
415# neglected to define file stems for scripted output.
416# * Removed a trailing ; from the %.graphics dependencies
417# * Added dvips embedding (I think it works, anyway)
418# Chris Monson (2006-03-29):
419# * Bumped version to 2.0a3
420# * Fixed error in make 3.79 with MAKEFILE_LIST usage
421# * Added the presumed filename to the _version output
422# * Added a vim macro for converting sed scripts to make commands
423# * Added gpi dependency support (plotting external files and loading gpi)
424# * Allow .gpi files to be ignored if called .include.gpi or .nobuild.gpi
425# * Fixed sed invocations where \+ was used. BSD sed uses \{1,\}.
426# Chris Monson (2006-03-28):
427# * Bumped version to 2.0a2
428# * Added SHELL_DEBUG and VERBOSE options
429# * Changed the default shell back to /bin/sh (unset, in other words)
430# * Moved .PHONY declarations closer to their targets
431# * Moved help text into its own define block to obtain better formatting
432# * Removed need for double-entry when adding a new program invocation
433# * Moved .SECONDARY declaration closer to its relevant occurrence
434# * Commented things more heavily
435# * Added help text about setting terminal and output in gnuplot
436# * Created more fine-grained clean targets
437# * Added a %.graphics target that generates all of %'s graphics
438# * Killed backward-compatible graphics generation (e.g., eps.gpi=gpi.eps)
439# * For now, we're just GPL 2, not 3. Maybe it will change later
440# * Made the version and svninfo into variables
441# Chris Monson (2006-03-27):
442# * Bumped version to 2.0a1
443# * Huge, sweeping changes -- automatic dependencies
444
445# IMPORTANT!
446#
447# When adding to the following list, do not introduce any blank lines. The
448# list is extracted for documentation using sed and is terminated by a blank
449# line.
450#
451# EXTERNAL PROGRAMS:
452# = ESSENTIAL PROGRAMS =
453# == Basic Shell Utilities ==
454CAT ?= cat
455CP ?= cp -f
456DIFF ?= diff
457ECHO ?= echo
458EGREP ?= egrep
459ENV ?= env
460MV ?= mv -f
461SED ?= sed
462SORT ?= sort
463TOUCH ?= touch
464UNIQ ?= uniq
465WHICH ?= which
466XARGS ?= xargs
467# == LaTeX (tetex-provided) ==
468BIBTEX ?= bibtex
469DVIPS ?= dvips
470LATEX ?= latex
471MAKEINDEX ?= makeindex
472KPSEWHICH ?= kpsewhich
473GS ?= gs
474# = OPTIONAL PROGRAMS =
475# == Makefile Color Output ==
476TPUT ?= tput
477# == TeX Generation ==
478RST2LATEX ?= rst2latex.py
479# == EPS Generation ==
480CONVERT ?= convert # ImageMagick
481DOT ?= dot # GraphViz
482DOT2TEX ?= dot2tex # dot2tex - add options (not -o) as needed
483FIG2DEV ?= fig2dev # XFig
484GNUPLOT ?= gnuplot # GNUplot
485INKSCAPE ?= inkscape # Inkscape (svg support)
486XMGRACE ?= xmgrace # XMgrace
487PNGTOPNM ?= pngtopnm # From NetPBM - step 1 for png -> eps
488PPMTOPGM ?= ppmtopgm # From NetPBM - (gray) step 2 for png -> eps
489PNMTOPS ?= pnmtops # From NetPBM - step 3 for png -> eps
490GUNZIP ?= gunzip # GZipped EPS
491# == Beamer Enlarged Output ==
492PSNUP ?= psnup
493# == Viewing Stuff ==
494VIEW_POSTSCRIPT ?= gv
495VIEW_PDF ?= evince
496VIEW_GRAPHICS ?= display
497
498# Command options for embedding fonts and postscript->pdf conversion
499PS_EMBED_OPTIONS ?= -dPDFSETTINGS=/printer -dEmbedAllFonts=true -dSubsetFonts=true -dMaxSubsetPct=100
500PS_COMPATIBILITY ?= 1.4
501
502# This ensures that even when echo is a shell builtin, we still use the binary
503# (the builtin doesn't always understand -n)
504FIXED_ECHO := $(if $(findstring -n,$(shell $(ECHO) -n)),$(shell which echo),$(ECHO))
505ECHO := $(if $(FIXED_ECHO),$(FIXED_ECHO),$(ECHO))
506
507# Directory into which we place "binaries" if it exists.
508# Note that this can be changed on the commandline or in Makefile.ini:
509#
510# Command line:
511# make BINARY_TARGET_DIR=$HOME/pdfs myfile.pdf
512#
513# Also, you can specify a relative directory (relative to the Makefile):
514# make BINARY_TARGET_DIR=pdfs myfile.pdf
515#
516# Or, you can use Makefile.ini:
517#
518# BINARY_TARGET_DIR := $(HOME)/bin_out
519#
520BINARY_TARGET_DIR ?= _out_
521
522# SH NOTES
523#
524# On some systems, /bin/sh, which is the default shell, is not linked to
525# /bin/bash. While bash is supposed to be sh-compatible when invoked as sh, it
526# just isn't. This section details some of the things you have to stay away
527# from to remain sh-compatible.
528#
529# * File pattern expansion does not work for {}
530# * [ "$x" = "$y" ] has to be [ x"$x" x"$y" ]
531# * &> for stderr redirection doesn't work, use 2>&1 instead
532#
533# BSD SED NOTES
534#
535# BSD SED is not very nice compared to GNU sed, but it is the most
536# commonly-invoked sed on Macs (being based on BSD), so we have to cater to
537# it or require people to install GNU sed. It seems like the GNU
538# requirement isn't too bad since this makefile is really a GNU makefile,
539# but apparently GNU sed is much less common than GNU make in general, so
540# I'm supporting it here.
541#
542# Sad experience has taught me the following about BSD sed:
543#
544# * \+ is not understood to mean \{1,\}
545# * \| is meaningless (does not branch)
546# * \n cannot be used as a substitution character
547# * ? does not mean \{0,1\}, but is literal
548# * a\ works, but only reliably for a single line if subsequent lines
549# have forward slashes in them (as is the case in postscript)
550#
551# For more info (on the Mac) you can consult
552#
553# man -M /usr/share/man re_format
554#
555# And look for the word "Obsolete" near the bottom.
556
557#
558# EXTERNAL PROGRAM DOCUMENTATION SCRIPT
559#
560
561# $(call output-all-programs,[<output file>])
562define output-all-programs
563 [ -f '$(this_file)' ] && \
564 $(SED) \
565 -e '/^[[:space:]]*#[[:space:]]*EXTERNAL PROGRAMS:/,/^$$/!d' \
566 -e '/EXTERNAL PROGRAMS/d' \
567 -e '/^$$/d' \
568 -e '/^[[:space:]]*#/i\ '\
569 -e 's/^[[:space:]]*#[[:space:]][^=]*//' \
570 $(this_file) $(if $1,> '$1',) || \
571 $(ECHO) "Cannot determine the name of this makefile."
572endef
573
574# If they misspell gray, it should still work.
575GRAY ?= $(call get-default,$(GREY),)
576
577#
578# Utility Functions and Definitions
579#
580
581# While not exactly a make function, this vim macro is useful. It takes a
582# verbatim sed script and converts each line to something suitable in a command
583# context. Just paste the script's contents into the editor, yank this into a
584# register (starting at '0') and run the macro once for each line of the
585# original script:
586#
587# 0i -e :s/\$/$$/eg
0:s/'/'"'"'/eg588:s/'/'"'"'/eg
1^Ela'A' \:noh589^Ela'A' \:noh
2j590j
591
592# don't call this directly - it is here to avoid calling wildcard more than
593# once in remove-files.
594remove-files-helper = $(if $1,$(RM) $1,:)
595
596# $(call remove-files,file1 file2)
597remove-files = $(call remove-files-helper,$(wildcard $1))
598
599# Removes all cleanable files in the given list
600# $(call clean-files,file1 file2 file3 ...)
601# Works exactly like remove-files, but filters out files in $(neverclean)
602clean-files = \
603 $(call remove-files-helper,$(call cleanable-files,$(wildcard $1)))
604
605# Outputs all generated files to STDOUT, along with some others that are
606# created by these (e.g., .idx files end up producing .ilg and .ind files).
607# Discovered by reading *.fls OUTPUT lines and producing corresponding .ind
608# filenames as needed.
609#
610# $(call get-generated-names,<source recorder file (*.fls)>)
611define get-generated-names
612[ -f '$1' ] && \
613$(SED) \
614 -e '/^OUTPUT /{' \
615 -e ' s///' \
616 -e ' p' \
617 -e ' s/\.idx/\.ind/p' \
618 -e ' s/\.ind/\.ilg/p' \
619 -e '}' \
620 -e 'd' \
621 '$1' \
622| $(SORT) | $(UNIQ)
623endef
624
625# This removes files without checking whether they are there or not. This
626# sometimes has to be used when the file is created by a series of shell
627# commands, but there ends up being a race condition: make doesn't know about
628# the file generation as quickly as the system does, so $(wildcard ...) doesn't
629# work right. Blech.
630# $(call remove-temporary-files,filenames)
631remove-temporary-files = $(if $1,$(RM) $1,:)
632
633# Create an identifier from a file name
634# $(call cleanse-filename,filename)
635cleanse-filename = $(subst .,_,$(subst /,__,$1))
636
637# Escape dots
638# $(call escape-dots,str)
639escape-dots = $(subst .,\\.,$1)
640
641# Test that a file exists
642# $(call test-exists,file)
643test-exists = [ -e '$1' ]
644
645# Copy file1 to file2 only if file2 doesn't exist or they are different
646# $(call copy-if-different,sfile,dfile)
647copy-if-different = $(call test-different,$1,$2) && $(CP) '$1' '$2'
648copy-if-exists = $(call test-exists,$1) && $(CP) '$1' '$2'
649move-if-different = $(call test-different,$1,$2) && $(MV) '$1' '$2'
650replace-if-different-and-remove = \
651 $(call test-different,$1,$2) \
652 && $(MV) '$1' '$2' \
653 || $(call remove-files,'$1')
654
655# Note that $(DIFF) returns success when the files are the SAME....
656# $(call test-different,sfile,dfile)
657test-different = ! $(DIFF) -q '$1' '$2' >/dev/null 2>&1
658test-exists-and-different = \
659 $(call test-exists,$2) && $(call test-different,$1,$2)
660
661# Return value 1, or value 2 if value 1 is empty
662# $(call get-default,<possibly empty arg>,<default value if empty>)
663get-default = $(if $1,$1,$2)
664
665# Copy a file and log what's going on
666# $(call copy-with-logging,<source>,<target>)
667define copy-with-logging
668if [ -d '$2/' ]; then \
669 if $(CP) '$1' '$2/'; then \
670 $(ECHO) "$(C_INFO)Copied '$1' to '$2/'$(C_RESET)"; \
671 else \
672 $(ECHO) "$(C_ERROR)Failed to copy '$1' to '$2/'$(C_RESET)"; \
673 fi; \
674fi
675endef
676
677# Gives a reassuring message about the failure to find include files
678# $(call include-message,<list of include files>)
679define include-message
680$(strip \
681$(if $(filter-out $(wildcard $1),$1),\
682 $(shell $(ECHO) \
683 "$(C_INFO)NOTE: You may ignore warnings about the"\
684 "following files:" >&2;\
685 $(ECHO) >&2; \
686 $(foreach s,$(filter-out $(wildcard $1),$1),$(ECHO) ' $s' >&2;)\
687 $(ECHO) "$(C_RESET)" >&2)
688))
689endef
690# Characters that are hard to specify in certain places
691space := $(empty) $(empty)
692colon := \:
693comma := ,
694
695# Useful shell definitions
696sh_true := :
697sh_false := ! :
698
699# Clear out the standard interfering make suffixes
700.SUFFIXES:
701
702# Turn off forceful rm (RM is usually mapped to rm -f)
703ifdef SAFE_RM
704RM := rm
705endif
706
707# Turn command echoing back on with VERBOSE=1
708ifndef VERBOSE
709QUIET := @
710endif
711
712# Turn on shell debugging with SHELL_DEBUG=1
713# (EVERYTHING is echoed, even $(shell ...) invocations)
714ifdef SHELL_DEBUG
715SHELL += -x
716endif
717
718# Get the name of this makefile (always right in 3.80, often right in 3.79)
719# This is only really used for documentation, so it isn't too serious.
720ifdef MAKEFILE_LIST
721this_file := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
722else
723this_file := $(wildcard GNUmakefile makefile Makefile)
724endif
725
726# Terminal color definitions
727
728ifdef NO_COLOR
729tput =
730else
731tput = $(shell $(TPUT) $1)
732endif
733
734black := $(call tput,setaf 0)
735red := $(call tput,setaf 1)
736green := $(call tput,setaf 2)
737yellow := $(call tput,setaf 3)
738blue := $(call tput,setaf 4)
739magenta := $(call tput,setaf 5)
740cyan := $(call tput,setaf 6)
741white := $(call tput,setaf 7)
742bold := $(call tput,bold)
743uline := $(call tput,smul)
744reset := $(call tput,sgr0)
745
746#
747# User-settable definitions
748#
749LATEX_COLOR_WARNING ?= magenta
750LATEX_COLOR_ERROR ?= red
751LATEX_COLOR_INFO ?= green
752LATEX_COLOR_UNDERFULL ?= magenta
753LATEX_COLOR_OVERFULL ?= red bold
754LATEX_COLOR_PAGES ?= bold
755LATEX_COLOR_BUILD ?= blue
756LATEX_COLOR_GRAPHIC ?= yellow
757LATEX_COLOR_DEP ?= green
758LATEX_COLOR_SUCCESS ?= green bold
759LATEX_COLOR_FAILURE ?= red bold
760
761# Gets the real color from a simple textual definition like those above
762# $(call get-color,ALL_CAPS_COLOR_NAME)
763# e.g., $(call get-color,WARNING)
764get-color = $(subst $(space),,$(foreach c,$(LATEX_COLOR_$1),$($c)))
765
766#
767# STANDARD COLORS
768#
769C_WARNING := $(call get-color,WARNING)
770C_ERROR := $(call get-color,ERROR)
771C_INFO := $(call get-color,INFO)
772C_UNDERFULL := $(call get-color,UNDERFULL)
773C_OVERFULL := $(call get-color,OVERFULL)
774C_PAGES := $(call get-color,PAGES)
775C_BUILD := $(call get-color,BUILD)
776C_GRAPHIC := $(call get-color,GRAPHIC)
777C_DEP := $(call get-color,DEP)
778C_SUCCESS := $(call get-color,SUCCESS)
779C_FAILURE := $(call get-color,FAILURE)
780C_RESET := $(reset)
781
782#
783# PRE-BUILD TESTS
784#
785
786# Check that clean targets are not combined with other targets (weird things
787# happen, and it's not easy to fix them)
788hascleangoals := $(if $(sort $(filter clean clean-%,$(MAKECMDGOALS))),1)
789hasbuildgoals := $(if $(sort $(filter-out clean clean-%,$(MAKECMDGOALS))),1)
790ifneq "$(hasbuildgoals)" ""
791ifneq "$(hascleangoals)" ""
792$(error $(C_ERROR)Clean and build targets specified together$(C_RESET)))
793endif
794endif
795
796#
797# VARIABLE DECLARATIONS
798#
799
800# Names of sed scripts that morph gnuplot files -- only the first found is used
801GNUPLOT_SED := global-gpi.sed gnuplot.sed
802GNUPLOT_GLOBAL := global._include_.gpi gnuplot.global
803
804# Files of interest
805all_files.tex ?= $(wildcard *.tex)
806all_files.tex.sh ?= $(wildcard *.tex.sh)
807all_files.rst ?= $(wildcard *.rst)
808all_files.fig ?= $(wildcard *.fig)
809all_files.gpi ?= $(wildcard *.gpi)
810all_files.dot ?= $(wildcard *.dot)
811all_files.xvg ?= $(wildcard *.xvg)
812all_files.svg ?= $(wildcard *.svg)
813all_files.png ?= $(wildcard *.png)
814all_files.jpg ?= $(wildcard *.jpg)
815all_files.eps.gz ?= $(wildcard *.eps.gz)
816all_files.eps ?= $(wildcard *.eps)
817
818# Utility function for obtaining all files not specified in $(neverclean)
819# $(call cleanable-files,file1 file2 file3 ...)
820# Returns the list of files that is not in $(wildcard $(neverclean))
821cleanable-files = $(filter-out $(wildcard $(neverclean)), $1)
822
823# Utility function for getting all .$1 files that are to be ignored
824# * files listed in $(includes.$1)
825# * files not listed in $(onlysources.$1) if it is defined
826ignore_files = \
827 $(includes.$1) \
828 $(if $(onlysources.$1),$(filter-out $(onlysources.$1), $(all_files.$1)))
829
830# Patterns to never be allowed as source targets
831ignore_patterns := %._include_
832
833# Patterns allowed as source targets but not included in 'all' builds
834nodefault_patterns := %._nobuild_ $(ignore_patterns)
835
836# Utility function for getting targets suitable building
837# $(call filter-buildable,suffix)
838filter-buildable = \
839 $(filter-out $(call ignore_files,$1) \
840 $(addsuffix .$1,$(ignore_patterns)),$(all_files.$1))
841
842# Utility function for getting targets suitable for 'all' builds
843# $(call filter-default,suffix)
844filter-default = \
845 $(filter-out $(call ignore_files,$1) \
846 $(addsuffix .$1,$(nodefault_patterns)),$(all_files.$1))
847
848# Top level sources that can be built even when they are not by default
849files.tex := $(filter-out %._gray_.tex,$(call filter-buildable,tex))
850files.tex.sh := $(call filter-buildable,tex.sh)
851files.rst := $(call filter-buildable,rst)
852files.gpi := $(call filter-buildable,gpi)
853files.dot := $(call filter-buildable,dot)
854files.fig := $(call filter-buildable,fig)
855files.xvg := $(call filter-buildable,xvg)
856files.svg := $(call filter-buildable,svg)
857files.png := $(call filter-buildable,png)
858files.jpg := $(call filter-buildable,jpg)
859files.eps.gz := $(call filter-buildable,eps.gz)
860
861# Make all pstex targets secondary. The pstex_t target requires the pstex
862# target, and nothing else really depends on it, so it often gets deleted.
863# This avoids that by allowing *all* fig files to be pstex targets, which is
864# perfectly valid and causes no problems even if they're going to become eps
865# files in the end.
866.SECONDARY: $(patsubst %.fig,%.pstex,$(files.fig))
867.SECONDARY: $(patsubst %.fig,%._gray_.pstex,$(files.fig))
868
869# Top level sources that are built by default targets
870default_files.tex := $(filter-out %._gray_.tex,$(call filter-default,tex))
871default_files.tex.sh := $(call filter-default,tex.sh)
872default_files.rst := $(call filter-default,rst)
873default_files.gpi := $(call filter-default,gpi)
874default_files.dot := $(call filter-default,dot)
875default_files.fig := $(call filter-default,fig)
876default_files.xvg := $(call filter-default,xvg)
877default_files.svg := $(call filter-default,svg)
878default_files.png := $(call filter-default,png)
879default_files.jpg := $(call filter-default,jpg)
880default_files.eps.gz := $(call filter-default,eps.gz)
881
882# Utility function for creating larger lists of files
883# $(call concat-files,suffixes,[prefix])
884concat-files = $(foreach s,$1,$($(if $2,$2_,)files.$s))
885
886# Useful file groupings
887all_files_source := $(call concat-files,tex,all)
888all_files_scripts := $(call concat-files,tex.sh rst,all)
889all_files_graphics := $(call concat-files,fig gpi eps.gz xvg svg png jpg dot,all)
890
891default_files_source := $(call concat-files,tex,default)
892default_files_scripts := $(call concat-files,tex.sh rst,default)
893default_files_graphics := $(call concat-files,fig gpi eps.gz xvg svg png jpg dot,default)
894
895files_source := $(call concat-files,tex)
896files_scripts := $(call concat-files,tex.sh rst)
897files_graphics := $(call concat-files,fig gpi eps.gz xvg svg png jpg dot)
898
899# Utility function for obtaining stems
900# $(call get-stems,suffix,[prefix])
901get-stems = $(sort $($(if $2,$2_,)files.$1:%.$1=%))
902
903# List of all stems (including ._include_ and ._nobuild_ file stems)
904all_stems.tex := $(call get-stems,tex,all)
905all_stems.tex.sh := $(call get-stems,tex.sh,all)
906all_stems.rst := $(call get-stems,rst,all)
907all_stems.fig := $(call get-stems,fig,all)
908all_stems.gpi := $(call get-stems,gpi,all)
909all_stems.dot := $(call get-stems,dot,all)
910all_stems.xvg := $(call get-stems,xvg,all)
911all_stems.svg := $(call get-stems,svg,all)
912all_stems.png := $(call get-stems,png,all)
913all_stems.jpg := $(call get-stems,jpg,all)
914all_stems.eps.gz := $(call get-stems,eps.gz,all)
915all_stems.eps := $(call get-stems,eps,all)
916
917# List of all default stems (all default PDF targets):
918default_stems.tex := $(call get-stems,tex,default)
919default_stems.tex.sh := $(call get-stems,tex.sh,default)
920default_stems.rst := $(call get-stems,rst,default)
921default_stems.fig := $(call get-stems,fig,default)
922default_stems.gpi := $(call get-stems,gpi,default)
923default_stems.dot := $(call get-stems,dot,default)
924default_stems.xvg := $(call get-stems,xvg,default)
925default_stems.svg := $(call get-stems,svg,default)
926default_stems.png := $(call get-stems,png,default)
927default_stems.jpg := $(call get-stems,jpg,default)
928default_stems.eps.gz := $(call get-stems,eps.gz,default)
929
930# List of all stems (all possible bare PDF targets created here):
931stems.tex := $(call get-stems,tex)
932stems.tex.sh := $(call get-stems,tex.sh)
933stems.rst := $(call get-stems,rst)
934stems.fig := $(call get-stems,fig)
935stems.gpi := $(call get-stems,gpi)
936stems.dot := $(call get-stems,dot)
937stems.xvg := $(call get-stems,xvg)
938stems.svg := $(call get-stems,svg)
939stems.png := $(call get-stems,png)
940stems.jpg := $(call get-stems,jpg)
941stems.eps.gz := $(call get-stems,eps.gz)
942
943# Utility function for creating larger lists of stems
944# $(call concat-stems,suffixes,[prefix])
945concat-stems = $(sort $(foreach s,$1,$($(if $2,$2_,)stems.$s)))
946
947all_stems_source := $(call concat-stems,tex,all)
948all_stems_script := $(call concat-stems,tex.sh rst,all)
949all_stems_graphic := $(call concat-stems,fig gpi eps.gz xvg svg png jpg dot,all)
950all_stems_gray_graphic := $(addsuffix ._gray_,\
951 $(all_stems_graphic) $(all_stems.eps) \
952 )
953all_stems_gg := $(sort \
954 $(all_stems_graphic) $(all_stems_gray_graphic))
955all_stems_ss := $(sort $(all_stems_source) $(all_stems_script))
956all_stems_gray := $(addsuffix ._gray_,$(all_stems_ss))
957all_stems_sg := $(sort $(all_stems_script) $(all_stems_gray))
958all_stems_ssg := $(sort $(all_stems_ss) $(all_stems_gray))
959
960default_stems_source := $(call concat-stems,tex,default)
961default_stems_script := $(call concat-stems,tex.sh rst,default)
962default_stems_graphic := $(call concat-stems,fig gpi eps.gz xvg svg png jpg dot,default)
963default_stems_gray_graphic := $(addsuffix ._gray_,$(default_stems_graphic))
964default_stems_gg := $(sort \
965 $(default_stems_graphic) $(default_stems_gray_graphic))
966default_stems_ss := $(sort \
967 $(default_stems_source) $(default_stems_script))
968default_stems_gray := $(addsuffix ._gray_,$(default_stems_ss))
969default_stems_sg := $(sort $(default_stems_script) $(default_stems_gray))
970default_stems_ssg := $(sort $(default_stems_ss) $(default_stems_gray))
971
972stems_source := $(call concat-stems,tex)
973stems_script := $(call concat-stems,tex.sh rst)
974stems_graphic := $(call concat-stems,fig gpi eps.gz xvg svg png jpg dot)
975stems_gray_graphic := $(addsuffix ._gray_,\
976 $(stems_graphic) $(all_stems.eps))
977stems_gg := $(sort $(stems_graphic) $(stems_gray_graphic))
978stems_ss := $(sort $(stems_source) $(stems_script))
979stems_gray := $(addsuffix ._gray_,$(stems_ss))
980stems_sg := $(sort $(stems_script) $(stems_gray))
981stems_ssg := $(sort $(stems_ss) $(stems_gray))
982
983# Calculate names that can generate the need for an include file. We can't
984# really do this with patterns because it's too easy to screw up, so we create
985# an exhaustive list.
986allowed_source_suffixes := \
987 pdf \
988 ps \
989 dvi \
990 ind \
991 nls \
992 bbl \
993 aux \
994 aux.make \
995 d \
996 tex \
997 auxbbl.make \
998 _graphics \
999 _show
1000allowed_source_patterns := $(addprefix %.,$(allowed_source_suffixes))
1001
1002allowed_graphic_suffixes := \
1003 eps \
1004 gpihead.make \
1005 gpi.d
1006allowed_graphic_patterns := $(addprefix %.,$(allowed_graphic_suffixes))
1007
1008# All targets allowed to build documents
1009allowed_source_targets := \
1010 $(foreach suff,$(allowed_source_suffixes),\
1011 $(addsuffix .$(suff),$(stems_ssg)))
1012
1013# All targets allowed to build graphics
1014allowed_graphic_targets := \
1015 $(foreach suff,$(allowed_graphic_suffixes),\
1016 $(addsuffix .$(suff),$(stems_gg)))
1017
1018# All targets that build multiple documents (like 'all')
1019allowed_batch_source_targets := \
1020 all \
1021 all-pdf \
1022 all-ps \
1023 all-dvi \
1024 all-bbl \
1025 all-ind \
1026 all-gls \
1027 all-nls \
1028 show
1029
1030# All targets that build multiple graphics (independent of document)
1031allowed_batch_graphic_targets := \
1032 all-graphics \
1033 all-pstex \
1034 all-dot2tex \
1035 all-gray-pstex \
1036 show-graphics
1037
1038# Now we figure out which stuff is available as a make target for THIS RUN.
1039real_goals := $(call get-default,$(filter-out _includes,$(MAKECMDGOALS)),\
1040 all)
1041
1042specified_source_targets := $(strip \
1043 $(filter $(allowed_source_targets) $(stems_ssg),$(real_goals)) \
1044 )
1045
1046specified_batch_source_targets := $(strip \
1047 $(filter $(allowed_batch_source_targets),$(real_goals)) \
1048 )
1049
1050specified_graphic_targets := $(strip \
1051 $(filter $(allowed_graphic_targets),$(real_goals)) \
1052 )
1053
1054specified_batch_graphic_targets := $(strip \
1055 $(filter $(allowed_batch_graphic_targets),$(real_goals)) \
1056 )
1057
1058specified_gpi_targets := $(patsubst %.gpi,%.eps,\
1059 $(filter $(patsubst %.eps,%.gpi,$(specified_graphic_targets)),\
1060 $(all_files.gpi)) \
1061 )
1062
1063# Determine which .d files need including from the information gained above.
1064# This is done by first checking whether a batch target exists. If it does,
1065# then all *default* stems are used to create possible includes (nobuild need
1066# not apply for batch status). If no batch targets exist, then the individual
1067# targets are considered and appropriate includes are taken from them.
1068source_stems_to_include := \
1069 $(sort\
1070 $(if $(specified_batch_source_targets),\
1071 $(default_stems_ss),\
1072 $(foreach t,$(specified_source_targets),\
1073 $(foreach p,$(allowed_source_patterns),\
1074 $(patsubst $p,%,$(filter $p $(stems_ssg),$t)) \
1075 )) \
1076 ))
1077
1078# Determine which .gpi.d files are needed using the above information. We
1079# first check whether a batch target is specified, then check individual
1080# graphics that may have been specified.
1081graphic_stems_to_include := \
1082 $(sort\
1083 $(if $(specified_batch_graphic_targets),\
1084 $(default_stems.gpi),\
1085 $(foreach t,$(specified_gpi_targets),\
1086 $(foreach p,$(allowed_graphic_patterns),\
1087 $(patsubst $p,%,$(filter $p,$t)) \
1088 )) \
1089 ))
1090
1091# All dependencies for the 'all' targets
1092all_pdf_targets := $(addsuffix .pdf,$(stems_ssg))
1093all_ps_targets := $(addsuffix .ps,$(stems_ssg))
1094all_dvi_targets := $(addsuffix .dvi,$(stems_ssg))
1095all_tex_targets := $(addsuffix .tex,$(stems_sg))
1096all_d_targets := $(addsuffix .d,$(stems_ssg))
1097all_graphics_targets := $(addsuffix .eps,$(stems_gg))
1098all_pstex_targets := $(addsuffix .pstex_t,$(stems.fig))
1099all_gray_pstex_targets := $(addsuffix ._gray_.pstex_t,$(stems.fig))
1100all_dot2tex_targets := $(addsuffix .dot_t,$(stems.dot))
1101
1102all_known_graphics := $(sort $(all_graphics_targets) $(wildcard *.eps))
1103
1104default_pdf_targets := $(addsuffix .pdf,$(default_stems_ss))
1105default_ps_targets := $(addsuffix .ps,$(default_stems_ss))
1106default_dvi_targets := $(addsuffix .dvi,$(default_stems_ss))
1107
1108# Extensions generated by LaTeX invocation that can be removed when complete
1109rm_ext := \
1110 log *.log aux dvi ps pdf blg bbl out nav snm toc lof lot lol pfg \
1111 fls vrb idx ind ilg glg glo gls lox nls nlo nlg brf mtc maf
1112backup_patterns := *~ *.bak *.backup body.tmp head.tmp
1113
1114graph_stem := _graph
1115
1116# All LaTeX-generated files that can be safely removed
1117
1118rm_tex := \
1119 $(foreach e,$(rm_ext),$(addsuffix .$e,$(all_stems_source))) \
1120 $(foreach e,$(rm_ext) tex,$(addsuffix .$e,$(all_stems_sg))) \
1121 $(addsuffix .log,$(all_ps_targets) $(all_pdf_targets)) \
1122 $(addsuffix .*.log,$(stems_graphic))
1123
1124# These are the files that will affect .gpi transformation for all .gpi files.
1125#
1126# Use only the first one found. Backward compatible values are at the end.
1127# Note that we use foreach, even though wildcard also returns a list, to ensure
1128# that the order in the uppercase variables is preserved. Directory listings
1129# provide no such guarantee, so we avoid relying on them.
1130gpi_sed := $(strip \
1131 $(firstword $(foreach f,$(GNUPLOT_SED),$(wildcard $f))))
1132gpi_global := $(strip \
1133 $(firstword $(foreach f,$(GNUPLOT_GLOBAL),$(wildcard $f))))
1134
1135#
1136# Functions used in generating output
1137#
1138
1139# Outputs all source dependencies to stdout. The first argument is the file to
1140# be parsed, the second is a list of files that will show up as dependencies in
1141# the new .d file created here.
1142#
1143# NOTE: BSD sed does not understand \|, so we have to do something more
1144# clunky to extract suitable extensions.
1145#
1146# Also, we do a little bit of funny rewriting up front (TARGETS=) to make sure
1147# that we can properly backslash-escape spaces in file names (e.g, on Cygwin
1148# for tex distributions that have "Program Files" in their name).
1149#
1150# $(call get-inputs,<parsed file>,<target files>)
1151define get-inputs
1152$(SED) \
1153-e '/^INPUT/!d' \
1154-e 's!^INPUT \(\./\)\{0,1\}!TARGETS=!' \
1155-e 's/[[:space:]]/\\ /g' \
1156-e 's/^TARGETS=/$2: /' \
1157-e '/\.tex$$/p' \
1158-e '/\.cls$$/p' \
1159-e '/\.sty$$/p' \
1160-e '/\.pstex_t$$/p' \
1161-e '/\.dot_t$$/p' \
1162-e 'd' \
1163$1 | $(SORT) | $(UNIQ)
1164endef
1165
1166# Outputs all of the graphical dependencies to stdout. The first argument is
1167# the stem of the source file being built, the second is a list of suffixes
1168# that will show up as dependencies in the generated .d file.
1169#
1170# Note that we try to escape spaces in filenames where possible. We have to do
1171# it with three backslashes so that as the name percolates through the makefile
1172# it eventually ends up with the proper escaping when the build rule is found.
1173# Ugly, but it appears to work. Note that graphicx doesn't allow filenames
1174# with spaces, so this could in many ways be moot unless you're using something
1175# like grffile.
1176#
1177# $(call get-graphics,<parsed file>,<target files>)
1178define get-graphics
1179$(SED) \
1180-e '/^File:/!d' \
1181-e 'N' \
1182-e 's/\n//g' \
1183-e '/Graphic file/!d' \
1184-e 's/^File: //' \
1185-e 's/ Graphic.*$$//' \
1186-e '/^\(.*\)\(\.[^.]*\)$$/{' \
1187-e 's//TARGETS=\1\2/' \
1188-e 's/[[:space:]]/\\\\\\&/g' \
1189-e 's/^TARGETS=/$2: /' \
1190-e 'p' \
1191-e 's/[^:]*: \(.*\)\(\.[^.]*\)$$/-include \1.gpi.d/' \
1192-e 'p' \
1193-e 'd' \
1194-e '}' \
1195$1 | $(SORT) | $(UNIQ)
1196endef
1197
1198# Checks for build failure due to pstex inclusion, and gives instructions.
1199#
1200# $(call die-on-pstexs,<parsed file>)
1201define die-on-pstexs
1202if $(EGREP) -q '^! LaTeX Error: File .*\.pstex.* not found' $1; then \
1203 $(ECHO) "$(C_ERROR)Missing pstex_t file(s)$(C_RESET)"; \
1204 $(ECHO) "$(C_ERROR)Please run$(C_RESET)"; \
1205 $(ECHO) "$(C_ERROR) make all-pstex$(C_RESET)"; \
1206 $(ECHO) "$(C_ERROR)before proceeding.$(C_RESET)"; \
1207 exit 1; \
1208fi
1209endef
1210
1211# Checks for build failure due to dot2tex, and gives instructions.
1212#
1213# $(call die-on-dot2tex,<parsed file>)
1214define die-on-dot2tex
1215if $(EGREP) -q '^! LaTeX Error: File .*\.dot_t.* not found' $1; then \
1216 $(ECHO) "$(C_ERROR)Missing dot_t file(s)$(C_RESET)"; \
1217 $(ECHO) "$(C_ERROR)Please run$(C_RESET)"; \
1218 $(ECHO) "$(C_ERROR) make all-dot2tex$(C_RESET)"; \
1219 $(ECHO) "$(C_ERROR)before proceeding.$(C_RESET)"; \
1220 exit 1; \
1221fi
1222endef
1223
1224# Outputs all index files to stdout. Arg 1 is the source file stem, arg 2 is
1225# the list of targets for the discovered dependency.
1226#
1227# $(call get-log-index,<log file stem>,<target files>)
1228define get-log-index
1229$(SED) \
1230-e 's/^No file \(.*\.ind\)\.$$/TARGETS=\1/' \
1231-e 's/^No file \(.*\.[gn]ls\)\.$$/TARGETS=\1/' \
1232-e 's/[[:space:]]/\\&/g' \
1233-e '/^TARGETS=/{' \
1234-e ' h' \
1235-e ' s/^TARGETS=/$2: /p' \
1236-e ' g' \
1237-e ' s/^TARGETS=\(.*\)/\1: $1.tex/p' \
1238-e '}' \
1239-e 'd' \
1240'$1.log' | $(SORT) | $(UNIQ)
1241endef
1242
1243
1244# Outputs all bibliography files to stdout. Arg 1 is the source stem, arg 2 is
1245# a list of targets for each dependency found.
1246#
1247# The script kills all lines that do not contain bibdata. Remaining lines have
1248# the \bibdata macro and delimiters removed to create a dependency list. A
1249# trailing comma is added, then all adjacent commas are collapsed into a single
1250# comma. Then commas are replaced with the string .bib[space], and the
1251# trailing space is killed off. Finally, all filename spaces are escaped.
1252# This produces a list of space-delimited .bib filenames, which is what the
1253# make dep file expects to see.
1254#
1255# $(call get-bibs,<aux file>,<targets>)
1256define get-bibs
1257$(SED) \
1258-e '/^\\bibdata/!d' \
1259-e 's/\\bibdata{\([^}]*\)}/\1,/' \
1260-e 's/,\{2,\}/,/g' \
1261-e 's/[[:space:]]/\\&/g' \
1262-e 's/,/.bib /g' \
1263-e 's/ \{1,\}$$//' \
1264$1 | $(XARGS) $(KPSEWHICH) | \
1265$(SED) \
1266-e 's/^/$2: /' | \
1267\$(SORT) | $(UNIQ)
1268endef
1269
1270# Makes a an aux file that only has stuff relevant to the dvi in it
1271# $(call make-auxdvi-file,<flattened-aux>,<new-aux>)
1272define make-auxdvi-file
1273$(SED) \
1274-e '/^\\newlabel/!d' \
1275$1 > $2
1276endef
1277
1278# Makes an aux file that only has stuff relevant to the bbl in it
1279# $(call make-auxbbl-file,<flattened-aux>,<new-aux>)
1280define make-auxbbl-file
1281$(SED) \
1282-e '/^\\newlabel/d' \
1283$1 > $2
1284endef
1285
1286# Makes a .gpi.d file from a .gpi file
1287# $(call make-gpi-d,<.gpi>,<.gpi.d>)
1288define make-gpi-d
1289$(ECHO) '# vim: ft=make' > $2; \
1290$(ECHO) 'ifndef INCLUDED_$(call cleanse-filename,$2)' >> $2; \
1291$(ECHO) 'INCLUDED_$(call cleanse-filename,$2) = 1' >> $2; \
1292$(call get-gpi-deps,$1,$(addprefix $(2:%.gpi.d=%).,eps gpi.d)) >> $2; \
1293$(ECHO) 'endif' >> $2;
1294endef
1295
1296# Parse .gpi files for data and loaded dependencies, output to stdout
1297#
1298# The sed script here tries to be clever about obtaining valid
1299# filenames from the gpi file. It assumes that the plot command starts its own
1300# line, which is not too difficult a constraint to satisfy.
1301#
1302# This command script also generates 'include' directives for every 'load'
1303# command in the .gpi file. The load command must appear on a line by itself
1304# and the file it loads must have the suffix .gpi. If you don't want it to be
1305# compiled when running make graphics, then give it a suffix of ._include_.gpi.
1306#
1307# $(call get-gpi-deps,<gpi file>,<targets>)
1308define get-gpi-deps
1309$(SED) \
1310-e '/^[[:space:]]*s\{0,1\}plot/,/[^\\]$$/{' \
1311-e ' H' \
1312-e ' /[^\\]$$/{' \
1313-e ' s/.*//' \
1314-e ' x' \
1315-e ' s/\\\{0,1\}\n//g' \
1316-e ' s/^[[:space:]]*s\{0,1\}plot[[:space:]]*\(\[[^]]*\][[:space:]]*\)*/,/' \
1317-e ' s/[[:space:]]*\(['\''"][^'\''"]*['\''"]\)\{0,1\}[^,]*/\1/g' \
1318-e ' s/,['\''"]-\{0,1\}['\''"]//g' \
1319-e ' s/[,'\''"]\{1,\}/ /g' \
1320-e ' s!.*!$2: &!' \
1321-e ' p' \
1322-e ' }' \
1323-e ' d' \
1324-e '}' \
1325-e 's/^[[:space:]]*load[[:space:]]*['\''"]\([^'\''"]*\.gpi\)['\''"].*$$/-include \1.d/p' \
1326-e 'd' \
1327$1
1328endef
1329
1330# Colorizes real, honest-to-goodness LaTeX errors that can't be overcome with
1331# recompilation.
1332#
1333# Note that we only ignore file not found errors for things that we know how to
1334# build, like graphics files.
1335#
1336# $(call colorize-latex-errors,<log file>)
1337define colorize-latex-errors
1338$(SED) \
1339-e '/^! LaTeX Error: File .*eps'"'"' not found\.$$/d' \
1340-e '/^! LaTeX Error: Cannot determine size/d' \
1341-e '/^! /,/^$$/{' \
1342-e ' H' \
1343-e ' /^$$/{' \
1344-e ' x' \
1345-e ' s/^.*$$/$(C_ERROR)&$(C_RESET)/' \
1346-e ' p' \
1347-e ' }' \
1348-e '}' \
1349-e 'd' \
1350$1
1351endef
1352
1353# Colorize Makeindex errors
1354define colorize-makeindex-errors
1355$(SED) \
1356-e '/^!! /{' \
1357-e ' N' \
1358-e ' s/^.*$$/$(C_ERROR)&$(C_RESET)/' \
1359-e ' p' \
1360-e '}' \
1361-e 'd' \
1362$1
1363endef
1364
1365# Colorize GNUplot errors
1366#
1367# $(call colorize-gnuplot-errors,<log file>)
1368define colorize-gnuplot-errors
1369$(SED) \
1370-e '/^gnuplot>/,/^$$/{' \
1371-e ' s/^gnuplot.*/$(C_ERROR)&/' \
1372-e ' s/^$$/$(C_RESET)/' \
1373-e ' p' \
1374-e '}' \
1375-e 'd' \
1376$1
1377endef
1378
1379# Colorize GraphViz errors
1380#
1381# $(call colorize-dot-errors,<log file>)
1382define colorize-dot-errors
1383$(SED) \
1384-e '/^Error:/,/context:/s/.*/$(C_ERROR)&$(C_RESET)/p' \
1385-e 's/^Warning:.*/$(C_WARNING)&$(C_RESET)/p' \
1386-e 'd' \
1387'$1'
1388endef
1389
1390# Get all important .aux files from the top-level .aux file and merges them all
1391# into a single file, which it outputs to stdout.
1392#
1393# $(call flatten-aux,<toplevel aux>,<output file>)
1394define flatten-aux
1395$(SED) \
1396-e '/\\@input{\(.*\)}/{' \
1397-e 's//\1/' \
1398-e 's![.:]!\\&!g' \
1399-e 'h' \
1400-e 's!.*!\\:\\\\@input{&}:{!' \
1401-e 'p' \
1402-e 'x' \
1403-e 's/\\././g' \
1404-e 's/.*/r &/p' \
1405-e 's/.*/d/p' \
1406-e 's/.*/}/p' \
1407-e 'd' \
1408-e '}' \
1409-e 'd' \
1410'$1' > "$1.$$$$.sed.make"; \
1411$(SED) -f "$1.$$$$.sed.make" '$1' > "$1.$$$$.make"; \
1412$(SED) \
1413-e '/^\\relax/d' \
1414-e '/^\\bibcite/d' \
1415-e 's/^\(\\newlabel{[^}]\{1,\}}\).*/\1/' \
1416"$1.$$$$.make" | $(SORT) > '$2'; \
1417$(call remove-temporary-files,$1.$$$$.make $1.$$$$.sed.make)
1418endef
1419
1420# Generate pdf from postscript
1421#
1422# Note that we don't just call ps2pdf, since there are so many versions of that
1423# script on various systems. Instead, we call the postscript interpreter
1424# directly.
1425#
1426# $(call ps2pdf,infile,outfile,[embed fonts])
1427define ps2pdf
1428 $(GS) \
1429 -dSAFER -dCompatibilityLevel=$(PS_COMPATIBILITY) \
1430 $(if $3,$(PS_EMBED_OPTIONS)) \
1431 -q -dNOPAUSE -dBATCH \
1432 -sDEVICE=pdfwrite -sstdout=%stderr \
1433 '-sOutputFile=$2' \
1434 -dSAFER -dCompatibilityLevel=$(PS_COMPATIBILITY) \
1435 $(if $3,$(PS_EMBED_OPTIONS)) \
1436 -c .setpdfwrite \
1437 -f '$1'
1438endef
1439
1440# Colorize LaTeX output.
1441# This uses a neat trick from the Sed & Awk Book from O'Reilly:
1442# 1) If a line has a single ending paren, delete it to make a blank line (so
1443# that we catch the first error, which is not always preceded by a blank
1444# line).
1445# 2) Ensure that the last line of the file gets appended to the hold buffer,
1446# and blank it out to trigger end-of-paragraph logic below.
1447# 3) When encountering a blank line (LaTeX output helpfully breaks output on
1448# newlines)
1449# a) swap the hold buffer (containing the paragraph) into the pattern buffer (putting a blank line into the hold buffer),
1450# b) remove the newline at the beginning (don't ask),
1451# c) apply any colorizing substitutions necessary to ensure happiness.
1452# d) get the newline out of the hold buffer and append it
1453# e) profit! (print)
1454# 4) Anything not colorized is deleted, unless in verbose mode.
1455color_tex := \
1456 $(SED) \
1457 -e '$${' \
1458 -e ' /^$$/!{' \
1459 -e ' H' \
1460 -e ' s/.*//' \
1461 -e ' }' \
1462 -e '}' \
1463 -e '/^$$/!{' \
1464 -e ' H' \
1465 -e ' d' \
1466 -e '}' \
1467 -e '/^$$/{' \
1468 -e ' x' \
1469 -e ' s/^\n//' \
1470 -e ' /Output written/{' \
1471 -e ' s/.*(\([^)]\{1,\}\)).*/Success! Wrote \1/' \
1472 -e ' s/[[:digit:]]\{1,\}/$(C_PAGES)&$(C_RESET)/g' \
1473 -e ' s/Success!/$(C_SUCCESS)&$(C_RESET)/g' \
1474 -e ' b end' \
1475 -e ' }' \
1476 -e ' /! *LaTeX Error:.*/{' \
1477 -e ' s/.*\(! *LaTeX Error:.*\)/$(C_ERROR)\1$(C_RESET)/' \
1478 -e ' b end' \
1479 -e ' }' \
1480 -e ' /.*Warning:.*/{' \
1481 -e ' s//$(C_WARNING)&$(C_RESET)/' \
1482 -e ' b end' \
1483 -e ' }' \
1484 -e ' /Underfull.*/{' \
1485 -e ' s/.*\(Underfull.*\)/$(C_UNDERFULL)\1$(C_RESET)/' \
1486 -e ' b end' \
1487 -e ' }' \
1488 -e ' /Overfull.*/{' \
1489 -e ' s/.*\(Overfull.*\)/$(C_OVERFULL)\1$(C_RESET)/' \
1490 -e ' b end' \
1491 -e ' }' \
1492 $(if $(VERBOSE),,-e ' d') \
1493 -e ' :end' \
1494 -e ' G' \
1495 -e '}' \
1496
1497# Colorize BibTeX output.
1498color_bib := \
1499 $(SED) \
1500 -e 's/^Warning--.*/$(C_WARNING)&$(C_RESET)/' -e 't' \
1501 -e '/---/,/^.[^:]/{' \
1502 -e ' H' \
1503 -e ' /^.[^:]/{' \
1504 -e ' x' \
1505 -e ' s/\n\(.*\)/$(C_ERROR)\1$(C_RESET)/' \
1506 -e ' p' \
1507 -e ' s/.*//' \
1508 -e ' h' \
1509 -e ' d' \
1510 -e ' }' \
1511 -e ' d' \
1512 -e '}' \
1513 -e '/(.*error.*)/s//$(C_ERROR)&$(C_RESET)/' \
1514 $(if $(VERBOSE),,-e 'd')
1515
1516
1517# Make beamer output big enough to print on a full page. Landscape doesn't
1518# seem to work correctly.
1519enlarge_beamer = $(PSNUP) -l -1 -W128mm -H96mm -pletter
1520
1521# $(call test-run-again,<source stem>)
1522test-run-again = $(EGREP) -q '^(.*Rerun .*|No file $1\.[^.]+\.)$$' $1.log
1523
1524# This tests whether the dvi target should be run at all, from viewing the log
1525# file.
1526# $(call test-log-for-need-to-run,<source stem>)
1527define test-log-for-need-to-run
1528$(SED) \
1529-e '/^No file $(call escape-dots,$1)\.aux\./d' \
1530$1.log \
1531| $(EGREP) -q '^(.*Rerun .*|No file $1\.[^.]+\.|LaTeX Warning: File.*)$$'
1532endef
1533
1534# LaTeX invocations
1535#
1536# $(call latex,<tex file>,[<extra LaTeX args>])
1537run-latex = $(LATEX) --interaction=batchmode $(if $2,$2,) $1 > /dev/null
1538
1539# $(call latex-color-log,<LaTeX stem>)
1540latex-color-log = $(color_tex) $1.log
1541
1542# $(call run-makeindex,<input>,<output>,<log>,<extra flags>)
1543define run-makeindex
1544success=1; \
1545if ! $(MAKEINDEX) -q $1 -t $3 -o $2 $4 > /dev/null || $(EGREP) -q '^!!' $3; then \
1546 $(call colorize-makeindex-errors,$3); \
1547 success=0; \
1548fi; \
1549[ "$$success" = "1" ] && $(sh_true) || $(sh_false);
1550endef
1551
1552# BibTeX invocations
1553#
1554# $(call run-bibtex,<tex stem>)
1555run-bibtex = $(BIBTEX) $1 | $(color_bib)
1556
1557
1558# $(call convert-gpi,<gpi file>,<eps file>,[gray])
1559define convert-gpi
1560$(ECHO) 'set terminal postscript enhanced eps' \
1561$(call get-default,$(strip \
1562$(firstword \
1563 $(shell \
1564 $(SED) \
1565 -e 's/^\#\#FONTSIZE=\([[:digit:]]\{1,\}\)/\1/p' \
1566 -e 'd' \
1567 $1 $(strip $(gpi_global)) \
1568 ) \
1569) \
1570),22) \
1571$(strip $(if $3,monochrome,$(if \
1572$(shell $(EGREP) '^\#\#[[:space:]]*GRAY[[:space:]]*$$' $< $(gpi_global)),\
1573,color))) > $1head.make; \
1574$(ECHO) 'set output "$2"' >> $1head.make; \
1575$(if $(gpi_global),$(CAT) $(gpi_global) >> $1head.make;,) \
1576fnames='$1head.make $1';\
1577$(if $(gpi_sed),\
1578 $(SED) -f '$(gpi_sed)' $$fnames > $1.temp.make; \
1579 fnames=$1.temp.make;,\
1580) \
1581success=1; \
1582if ! $(GNUPLOT) $$fnames 2>$1.log; then \
1583 $(call colorize-gnuplot-errors,$1.log); \
1584 success=0; \
1585fi; \
1586$(if $(gpi_sed),$(call remove-temporary-files,$1.temp.make);,) \
1587$(call remove-temporary-files,$1head.make); \
1588[ "$$success" = "1" ] && $(sh_true) || $(sh_false);
1589endef
1590
1591# Creation of .eps files from .png files
1592#
1593# The intermediate step of PNM (using NetPBM) produces much nicer output than
1594# ImageMagick's "convert" binary. I couldn't get the right combination of
1595# flags to make it look nice, anyway.
1596#
1597# To handle gray scale conversion, we pipe things through ppmtopgm in the
1598# middle.
1599#
1600# $(call convert-png,<png file>,<eps file>)
1601define convert-png
1602$(PNGTOPNM) "$1" \
1603 $(if $3,| $(PPMTOPGM),) \
1604 | $(PNMTOPS) -noturn \
1605 > "$2"
1606endef
1607
1608# Creation of .eps files from .jpg files
1609#
1610# Thanks to brubakee for this solution.
1611#
1612# Uses Postscript level 2 to avoid file size bloat
1613# $(call convert-jpg,<jpg file>,<eps file>)
1614define convert-jpg
1615$(CONVERT) $(if $3,-type Grayscale,) '$1' eps2:'$2'
1616endef
1617
1618# Creation of .eps files from .fig files
1619# $(call convert-fig,<fig file>,<eps file>,[gray])
1620convert-fig = $(FIG2DEV) -L eps $(if $3,-N,) $1 $2
1621
1622# Creation of .pstex files from .fig files
1623# $(call convert-fig-pstex,<fig file>,<pstex file>)
1624convert-fig-pstex = $(FIG2DEV) -L pstex $1 $2 > /dev/null 2>&1
1625
1626# Creation of .pstex_t files from .fig files
1627# $(call convert-fig-pstex-t,<fig file>,<pstex file>,<pstex_t file>)
1628convert-fig-pstex-t = $(FIG2DEV) -L pstex_t -p $3 $1 $2 > /dev/null 2>&1
1629
1630# Creation of .dot_t files from .dot files
1631# #(call convert-dot-tex,<dot file>,<dot_t file>)
1632convert-dot-tex = $(DOT2TEX) '$1' > '$2'
1633
1634# Creation of .tex files from .rst files
1635# TODO: Fix paper size so that it can be specified in the file itself
1636# $(call convert-rst,<rst file>,<tex file>)
1637rst_style_file=$(wildcard _rststyle_._include_.tex)
1638define convert-rst
1639$(RST2LATEX) \
1640 --documentoptions=letterpaper \
1641 $(if $(rst_style_file),--stylesheet=$(rst_style_file),) \
1642 $1 $2
1643endef
1644
1645# Converts svg files into .eps files
1646#
1647# $(call convert-svg,<svg file>,<eps file>,[gray])
1648convert-svg = $(INKSCAPE) --export-eps='$2' '$1'
1649
1650# Converts xvg files into .eps files
1651#
1652# $(call convert-xvg,<xvg file>,<eps file>,[gray])
1653convert-xvg = $(XMGRACE) '$1' -printfile - -hardcopy -hdevice EPS $(if $3,| $(call kill-ps-color)) > '$2'
1654
1655# Converts .eps.gz files into .eps files
1656#
1657# $(call convert-epsgz,<eps.gz file>,<eps file>,[gray])
1658convert-epsgz = $(GUNZIP) -c '$1' $(if $3,| $(call kill-ps-color)) > '$2'
1659
1660# Converts .eps files into .eps files (usually a no-op, but can make grayscale)
1661#
1662# $(call convert-eps,<in file>,<out file>,[gray])
1663convert-eps = $(if $3,$(call kill-ps-color) $1 > $2)
1664
1665# The name of the file containing special postscript commands for grayscale
1666gray_eps_file := gray.eps.make
1667
1668# Changes sethsbcolor and setrgbcolor calls in postscript to always produce
1669# grayscale. In general, this is accomplished by writing new versions of those
1670# functions into the user dictionary space, which is looked up before the
1671# global or system dictionaries (userdict is one of the permanent dictionaries
1672# in postscript and is not read-only like systemdict).
1673#
1674# For setrgbcolor, the weighted average of the triple is computed and the
1675# triple is replaced with three copies of that average before the original
1676# procedure is called: .299R + .587G + .114B
1677#
1678# For sethsbcolor, the color is first converted to RGB, then to grayscale by
1679# the new setrgbcolor operator as described above. Why is this done?
1680# Because simply using the value component will tend to make pure colors
1681# white, a very undesirable thing. Pure blue should not translate to white,
1682# but to some level of gray. Conversion to RGB does the right thing. It's
1683# messy, but it works.
1684#
1685# From
1686# http://en.wikipedia.org/wiki/HSV_color_space#Transformation_from_HSV_to_RGB,
1687# HSB = HSV (Value = Brightness), and the formula used to convert to RGB is
1688# as follows:
1689#
1690# Hi = int(floor(6 * H)) mod 6
1691# f = 6 * H - Hi
1692# p = V(1-S)
1693# q = V(1-fS)
1694# t = V(1-(1-f)S)
1695# if Hi = 0: R G B <-- V t p
1696# if Hi = 1: R G B <-- q V p
1697# if Hi = 2: R G B <-- p V t
1698# if Hi = 3: R G B <-- p q V
1699# if Hi = 4: R G B <-- t p V
1700# if Hi = 5: R G B <-- V p q
1701#
1702# The messy stack-based implementation is below
1703# $(call create-gray-eps-file,filename)
1704define create-gray-eps-file
1705$(ECHO) -n -e '\
1706/OLDRGB /setrgbcolor load def\n\
1707/setrgbcolor {\n\
1708 .114 mul exch\n\
1709 .587 mul add exch\n\
1710 .299 mul add\n\
1711 dup dup\n\
1712 OLDRGB\n\
1713} bind def\n\
1714/OLDHSB /sethsbcolor load def\n\
1715/sethsbcolor {\n\
1716 2 index % H V S H\n\
1717 6 mul floor cvi 6 mod % Hi V S H\n\
1718 3 index % H Hi V S H\n\
1719 6 mul % 6H Hi V S H\n\
1720 1 index % Hi 6H Hi V S H\n\
1721 sub % f Hi V S H\n\
1722 2 index 1 % 1 V f Hi V S H\n\
1723 4 index % S 1 V f Hi V S H\n\
1724 sub mul % p f Hi V S H\n\
1725 3 index 1 % 1 V p f Hi V S H\n\
1726 6 index % S 1 V p f Hi V S H\n\
1727 4 index % f S 1 V p f Hi V S H\n\
1728 mul sub mul % q p f Hi V S H\n\
1729 4 index 1 1 % 1 1 V q p f Hi V S H\n\
1730 5 index % f 1 1 V q p f Hi V S H\n\
1731 sub % (1-f) 1 V q p f Hi V S H\n\
1732 8 index % S (1-f) 1 V q p f Hi V S H\n\
1733 mul sub mul % t q p f Hi V S H\n\
1734 4 -1 roll pop % t q p Hi V S H\n\
1735 7 -2 roll pop pop % t q p Hi V\n\
1736 5 -2 roll % Hi V t q p\n\
1737 dup 0 eq\n\
1738 {1 index 3 index 6 index}\n\
1739 {\n\
1740 dup 1 eq\n\
1741 {3 index 2 index 6 index}\n\
1742 {\n\
1743 dup 2 eq\n\
1744 {4 index 2 index 4 index}\n\
1745 {\n\
1746 dup 3 eq\n\
1747 {4 index 4 index 3 index}\n\
1748 {\n\
1749 dup 4 eq\n\
1750 {2 index 5 index 3 index}\n\
1751 {\n\
1752 dup 5 eq\n\
1753 {1 index 5 index 5 index}\n\
1754 {0 0 0}\n\
1755 ifelse\n\
1756 }\n\
1757 ifelse\n\
1758 }\n\
1759 ifelse\n\
1760 }\n\
1761 ifelse\n\
1762 }\n\
1763 ifelse\n\
1764 }\n\
1765 ifelse % B G R Hi V t q p\n\
1766 setrgbcolor\n\
1767 5 {pop} repeat\n\
1768} bind def\n'\
1769> $1
1770endef
1771
1772# This actually inserts the color-killing code into a postscript file
1773# $(call kill-ps-color)
1774define kill-ps-color
1775$(SED) -e '/%%EndComments/r $(gray_eps_file)'
1776endef
1777
1778# Converts graphviz .dot files into .eps files
1779# Grayscale is not directly supported by dot, so we pipe it through fig2dev in
1780# that case.
1781# $(call convert-dot,<dot file>,<eps file>,<log file>,[gray])
1782define convert-dot
1783$(DOT) -Tps '$1' 2>'$3' $(if $4,| $(call kill-ps-color)) > $2; \
1784$(call colorize-dot-errors,$3)
1785endef
1786
1787# Convert DVI to Postscript
1788# $(call make-ps,<dvi file>,<ps file>,<log file>,[<paper size>])
1789make-ps = \
1790 $(DVIPS) -o '$2' $(if $(filter-out BEAMER,$4),-t$(firstword $4),) '$1' \
1791 $(if $(filter BEAMER,$4),| $(enlarge_beamer)) > $3 2>&1
1792
1793# Convert Postscript to PDF
1794# $(call make-pdf,<ps file>,<pdf file>,<log file>,<embed file>)
1795make-pdf = \
1796 $(call ps2pdf,$1,$2,$(filter 1,$(shell $(CAT) '$4'))) > '$3' 2>&1
1797
1798# Display information about what is being done
1799# $(call echo-build,<output file>,[<run number>])
1800echo-build = $(ECHO) "$(C_BUILD)= $1 --> $2$(if $3, ($3),) =$(C_RESET)"
1801echo-graphic = $(ECHO) "$(C_GRAPHIC)= $1 --> $2 =$(C_RESET)"
1802echo-dep = $(ECHO) "$(C_DEP)= $1 --> $2 =$(C_RESET)"
1803
1804# Display a list of something
1805# $(call echo-list,<values>)
1806echo-list = for x in $1; do $(ECHO) "$$x"; done
1807
1808#
1809# DEFAULT TARGET
1810#
1811
1812.PHONY: all
1813all: $(default_pdf_targets) ;
1814
1815.PHONY: all-pdf
1816all-pdf: $(default_pdf_targets) ;
1817
1818.PHONY: all-ps
1819all-ps: $(default_ps_targets) ;
1820
1821.PHONY: all-dvi
1822all-dvi: $(default_dvi_targets) ;
1823
1824#
1825# VIEWING TARGET
1826#
1827.PHONY: show
1828show: all
1829 $(QUIET)for x in $(default_pdf_targets); do \
1830 [ -e "$$x" ] && $(VIEW_PDF) $$x & \
1831 done
1832
1833#
1834# INCLUDES
1835#
1836source_includes := $(addsuffix .d,$(source_stems_to_include))
1837graphic_includes := $(addsuffix .gpi.d,$(graphic_stems_to_include))
1838
1839# Include only the dependencies used
1840ifneq "" "$(source_includes)"
1841include $(source_includes)$(call include-message,$(source_includes))
1842endif
1843ifneq "" "$(graphic_includes)"
1844include $(graphic_includes)$(call include-message,$(graphic_includes))
1845endif
1846
1847#
1848# MAIN TARGETS
1849#
1850
1851%: %.pdf ;
1852
1853# This builds and displays the wanted file.
1854.PHONY: $(addsuffix ._show,$(stems_ssg))
1855%._show: %.pdf
1856 $(QUIET)$(VIEW_PDF) $< &
1857
1858.SECONDARY: $(all_pdf_targets)
1859%.pdf: %.ps %.embed.make
1860 $(QUIET)$(call echo-build,$<,$@)
1861 $(QUIET)$(call make-pdf,$<,$@.temp,$@.log,$*.embed.make); \
1862 if [ x"$$?" = x"0" ]; then \
1863 $(if $(VERBOSE),$(CAT) $@.log,:); \
1864 $(RM) -f '$@'; \
1865 $(MV) '$@.temp' '$@'; \
1866 $(TOUCH) '$@'; \
1867 $(call copy-with-logging,$@,$(BINARY_TARGET_DIR)); \
1868 else \
1869 $(CAT) $@.log; \
1870 $(call remove-temporary-files,'$@.temp'); \
1871 $(sh_false); \
1872 fi
1873
1874.SECONDARY: $(all_ps_targets)
1875%.ps: %.dvi %.paper.make
1876 $(QUIET)$(call echo-build,$<,$@)
1877 $(QUIET)$(call make-ps,$<,$@.temp,$@.log,\
1878 $(firstword $(shell $(CAT) $*.paper.make))); \
1879 if [ x"$$?" = x"0" ]; then \
1880 $(if $(VERBOSE),$(CAT) $@.log,:); \
1881 $(RM) -f '$@'; \
1882 $(MV) '$@.temp' '$@'; \
1883 $(TOUCH) '$@'; \
1884 $(call copy-with-logging,$@,$(BINARY_TARGET_DIR)); \
1885 else \
1886 $(CAT) $@.log; \
1887 $(call remove-temporary-files,'$@.temp'); \
1888 $(sh_false); \
1889 fi
1890
1891# Build the final dvi file. This is a very tricky rule because of the way that
1892# latex runs multiple times, needs graphics after the first run (or maybe
1893# already has them), and relies on bibliographies or indices that may not exist.
1894#
1895# Check the log for fatal errors. If they exist, colorize and bail.
1896#
1897# Create the .auxdvi.cookie file. (Needed for next time if not present)
1898#
1899# If any of the following are true, we must rebuild at least one time:
1900#
1901# * the .bbl was recently rebuilt
1902#
1903# check a cookie, then delete it
1904#
1905# * any of several output files was created or changed:
1906#
1907# check $*.run.cookie, then delete it
1908#
1909# * the .aux file changed in a way that necessitates attention
1910#
1911# Note that if the .auxdvi.make file doesn't exist, this means
1912# that we are doing a clean build, so it doesn't figure into the
1913# test for running again.
1914#
1915# compare against .auxdvi.make
1916#
1917# move if different, remove if not
1918#
1919# * the .log file has errors or warnings requiring at least one more run
1920#
1921# We use a loop over a single item to simplify the process of breaking
1922# out when we find one of the conditions to be true.
1923#
1924# If we do NOT need to run latex here, then we move the $@.1st.make file
1925# over to $@ because the .dvi file has already been built by the first
1926# dependency run and is valid.
1927#
1928# If we do, we delete that cookie file and do the normal multiple-runs
1929# routine.
1930#
1931.SECONDARY: $(all_dvi_targets)
1932%.dvi: %.bbl %.aux
1933 $(QUIET)\
1934 fatal=`$(call colorize-latex-errors,$*.log)`; \
1935 if [ x"$$fatal" != x"" ]; then \
1936 $(ECHO) "$$fatal"; \
1937 exit 1; \
1938 fi; \
1939 $(call make-auxdvi-file,$*.aux.make,$*.auxdvi.cookie); \
1940 run=0; \
1941 for i in 1; do \
1942 if $(call test-exists,$*.bbl.cookie); then \
1943 run=1; \
1944 break; \
1945 fi; \
1946 if $(call test-exists,$*.run.cookie); then \
1947 run=1; \
1948 break; \
1949 fi; \
1950 if $(call \
1951 test-exists-and-different,$*.auxdvi.cookie,$*.auxdvi.make);\
1952 then \
1953 run=1; \
1954 break; \
1955 fi; \
1956 if $(call test-log-for-need-to-run,$*); then \
1957 run=1; \
1958 break; \
1959 fi; \
1960 done; \
1961 $(call remove-temporary-files,$*.bbl.cookie $*.run.cookie); \
1962 $(MV) $*.auxdvi.cookie $*.auxdvi.make; \
1963 if [ x"$$run" = x"1" ]; then \
1964 $(call remove-files,$@.1st.make); \
1965 for i in 2 3 4 5; do \
1966 $(if $(findstring 3.79,$(MAKE_VERSION)),\
1967 $(call echo-build,$*.tex,$@,$$$$i),\
1968 $(call echo-build,$*.tex,$@,$$i)\
1969 ); \
1970 $(call run-latex,$*); \
1971 $(CP) '$*.log' '$*.'$$i'.log'; \
1972 $(call test-run-again,$*) || break; \
1973 done; \
1974 else \
1975 $(MV) $@.1st.make $@; \
1976 fi; \
1977 $(call copy-with-logging,$@,$(BINARY_TARGET_DIR)); \
1978 $(call latex-color-log,$*)
1979
1980# Build the .bbl file. When dependencies are included, this will (or will
1981# not!) depend on something.bib, which we detect, acting accordingly. The
1982# dependency creation also produces the %.auxbbl.make file. BibTeX is a bit
1983# finicky about what you call the actual files, but we can rest assured that if
1984# a .auxbbl.make file exists, then the .aux file does, as well. The
1985# .auxbbl.make file is a cookie indicating whether the .bbl needs to be
1986# rewritten. It only changes if the .aux file changes in ways relevant to .bbl
1987# creation.
1988#
1989# Note that we do NOT touch the .bbl file if there is no need to
1990# create/recreate it. We would like to leave existing files alone if they
1991# don't need to be changed, thus possibly avoiding a rebuild trigger on the
1992# .dvi side.
1993%.bbl: %.auxbbl.make
1994 $(QUIET)\
1995 $(if $(filter %.bib,$^),\
1996 $(call echo-build,$(filter %.bib,$?) $*.aux,$@); \
1997 $(call run-bibtex,$*); \
1998 $(TOUCH) $@.cookie; \
1999 )
2000
2001# Create the index file - note that we do *not* depend on %.tex here, since
2002# that unnecessarily restricts the kinds of indices that we can build to those
2003# with exactly the same stem as the source file. Things like splitidx create
2004# idx files with other names.
2005#
2006# Therefore, we add the .tex dependency in the sourcestem.d file in the call to
2007# get index file dependencies from the logs.
2008%.ind: %.idx
2009 $(QUIET)$(call echo-build,$<,$@)
2010 $(QUIET)$(call run-makeindex,$<,$@,$*.ilg)
2011
2012# Create the glossary file
2013%.gls: %.glo %.tex
2014 $(QUIET)$(call echo-build,$<,$@)
2015 $(QUIET)$(call run-makeindex,$<,$@,$*.glg,-s nomencl.ist)
2016
2017# Create the nomenclature file
2018%.nls: %.nlo %.tex
2019 $(QUIET)$(call echo-build,$<,$@)
2020 $(QUIET)$(call run-makeindex,$<,$@,$*.nlg,-s nomencl.ist)
2021
2022# SCRIPTED LaTeX TARGETS
2023#
2024.SECONDARY: $(all_tex_targets)
2025%.tex: %.tex.sh
2026 $(QUIET)$(call echo-build,$<,$@)
2027 $(QUIET)$(SHELL) $< $@
2028
2029%.tex: %.rst $(rst_style_file)
2030 $(QUIET)$(call echo-build,$<,$@)
2031 $(QUIET)$(call convert-rst,$<,$@)
2032
2033#
2034# GRAYSCALE LaTeX TARGETS
2035#
2036
2037# Parse %.d to get all of the include files, then run sed to generate new files
2038# for all of them that depend on _gray.
2039%._gray_.tex: %.d %.tex
2040 $(QUIET)$(call echo-build,$^,$@)
2041 $(QUIET)\
2042 texstems=`$(SED) \
2043 -e 's/[^:]*:[[:space:]]*\(.*\)\.tex[[:space:]]*$$/\\1/p' \
2044 -e 'd' \
2045 $<`; \
2046 for f in $$texstems; do \
2047 $(SED) \
2048 -e 's/\.eps/._gray_&/' \
2049 -e 's/\.pstex/._gray_&/' \
2050 -e 's/\.pstex_t/._gray_&/' \
2051 -e 's/_include_/&._gray_/g' \
2052 $$f.tex > $$f._gray_.tex; \
2053 done;
2054
2055#
2056# GRAPHICS TARGETS
2057#
2058.PHONY: all-graphics
2059all-graphics: $(all_graphics_targets);
2060
2061.PHONY: all-pstex all-gray-pstex
2062all-pstex: $(all_pstex_targets);
2063all-gray-pstex: $(all_gray_pstex_targets);
2064
2065.PHONY: all-dot2tex
2066all-dot2tex: $(all_dot2tex_targets);
2067
2068.PHONY: show-graphics
2069show-graphics: all-graphics
2070 $(VIEW_GRAPHICS) $(all_known_graphics)
2071
2072$(gray_eps_file):
2073 $(QUIET)$(call echo-build,$^,$@)
2074 $(QUIET)$(call create-gray-eps-file,$@)
2075
2076%._gray_.eps: %.gpi $(gpi_sed)
2077 $(QUIET)$(call echo-graphic,$^,$@)
2078 $(QUIET)$(call convert-gpi,$<,$@,1)
2079
2080%._gray_.eps: %.fig
2081 $(QUIET)$(call echo-graphic,$^,$@)
2082 $(QUIET)$(call convert-fig,$<,$@,1)
2083
2084%._gray_.eps: %.dot $(gray_eps_file)
2085 $(QUIET)$(call echo-graphic,$^,$@)
2086 $(QUIET)$(call convert-dot,$<,$@,$<.log,1)
2087
2088%._gray_.eps: %.xvg $(gray_eps_file)
2089 $(QUIET)$(call echo-graphic,$^,$@)
2090 $(QUIET)$(call convert-xvg,$<,$@,1)
2091
2092%._gray_.eps: %.svg $(gray_eps_file)
2093 $(QUIET)$(call echo-graphic,$^,$@)
2094 $(QUIET)$(call convert-svg,$<,$@,1)
2095
2096%._gray_.eps: %.jpg $(gray_jpg_file)
2097 $(QUIET)$(call echo-graphic,$^,$@)
2098 $(QUIET)$(call convert-jpg,$<,$@,1)
2099
2100%._gray_.eps: %.png $(gray_eps_file)
2101 $(QUIET)$(call echo-graphic,$^,$@)
2102 $(QUIET)$(call convert-png,$<,$@,1)
2103
2104%._gray_.eps: %.eps.gz $(gray_eps_file)
2105 $(QUIET)$(call echo-graphic,$^,$@)
2106 $(QUIET)$(call convert-epsgz,$<,$@,1)
2107
2108%._gray_.eps: %.eps $(gray_eps_file)
2109 $(QUIET)$(call echo-graphic,$^,$@)
2110 $(QUIET)$(call convert-eps,$<,$@,1)
2111
2112%._gray_.pstex: %.fig
2113 $(QUIET)$(call echo-graphic,$^,$@)
2114 $(QUIET)$(call convert-fig-pstex,$<,$@,1)
2115
2116%._gray_.pstex_t: %.fig %._gray_.pstex
2117 $(QUIET)$(call echo-graphic,$^,$@)
2118 $(QUIET)$(call convert-fig-pstex-t,$<,$@,$*._gray_.pstex,1)
2119
2120%.eps: %.gpi $(gpi_sed)
2121 $(QUIET)$(call echo-graphic,$^,$@)
2122 $(QUIET)$(call convert-gpi,$<,$@,$(GRAY))
2123
2124%.eps: %.fig
2125 $(QUIET)$(call echo-graphic,$^,$@)
2126 $(QUIET)$(call convert-fig,$<,$@,$(GRAY))
2127
2128%.eps: %.dot $(if $(GRAY),$(gray_eps_file))
2129 $(QUIET)$(call echo-graphic,$^,$@)
2130 $(QUIET)$(call convert-dot,$<,$@,$<.log,$(GRAY))
2131
2132%.eps: %.xvg $(if $(GRAY),$(gray_eps_file))
2133 $(QUIET)$(call echo-graphic,$^,$@)
2134 $(QUIET)$(call convert-xvg,$<,$@,$(GRAY))
2135
2136%.eps: %.svg $(if $(GRAY),$(gray_eps_file))
2137 $(QUIET)$(call echo-graphic,$^,$@)
2138 $(QUIET)$(call convert-svg,$<,$@,$(GRAY))
2139
2140%.eps: %.jpg $(if $(GRAY),$(gray_eps_file))
2141 $(QUIET)$(call echo-graphic,$^,$@)
2142 $(QUIET)$(call convert-jpg,$<,$@,$(GRAY))
2143
2144%.eps: %.png $(if $(GRAY),$(gray_eps_file))
2145 $(QUIET)$(call echo-graphic,$^,$@)
2146 $(QUIET)$(call convert-png,$<,$@,$(GRAY))
2147
2148%.eps: %.eps.gz $(if $(GRAY),$(gray_eps_file))
2149 $(QUIET)$(call echo-graphic,$^,$@)
2150 $(QUIET)$(call convert-epsgz,$<,$@,$(GRAY))
2151
2152%.pstex: %.fig
2153 $(QUIET)$(call echo-graphic,$^,$@)
2154 $(QUIET)$(call convert-fig-pstex,$<,$@,$(GRAY))
2155
2156%.pstex_t: %.fig %.pstex
2157 $(QUIET)$(call echo-graphic,$^,$@)
2158 $(QUIET)$(call convert-fig-pstex-t,$<,$@,$*.pstex,$(GRAY))
2159
2160%.dot_t: %.dot
2161 $(QUIET)$(call echo-graphic,$^,$@)
2162 $(QUIET)$(call convert-dot-tex,$<,$@)
2163
2164#
2165# DEPENDENCY-RELATED TARGETS.
2166#
2167
2168# Generate all of the information needed to get dependencies
2169# As a side effect, this creates a .dvi file. We need to be sure to remove it
2170# if there are errors. Errors can take several forms and all of them are found
2171# within the log file:
2172# * There was a LaTeX error
2173# * A needed file was not found
2174# * Cross references need adjustment
2175#
2176# Behavior:
2177# This rule is responsible for generating the following:
2178# %.aux
2179# %.d
2180# %.aux.make
2181# %.dvi.1st.make (the .dvi file, moved)
2182#
2183# Steps:
2184#
2185# Run latex
2186# Move .dvi somewhere else (make no judgements about success)
2187# Flatten the .aux file into another file
2188# Add source dependencies
2189# Add graphic dependencies
2190# Add bib dependencies
2191#
2192# Create cookies for various suffixes that may represent files that
2193# need to be read by LaTeX in order for it to function properly.
2194#
2195%.d %.aux %.aux.make %.fls: %.tex
2196 $(QUIET)$(call echo-build,$<,$*.d $*.dvi,1)
2197 $(QUIET)\
2198 $(call run-latex,$<,--recorder) || $(sh_true); \
2199 $(CP) '$*.log' '$*.1.log'; \
2200 $(call die-on-pstexs,$*.log); \
2201 $(call die-on-dot2tex,$*.log); \
2202 $(MV) $*.dvi $*.dvi.1st.make; \
2203 $(call flatten-aux,$*.aux,$*.aux.make); \
2204 $(ECHO) "# vim: ft=make" > $*.d; \
2205 $(ECHO) ".PHONY: $*._graphics" >> $*.d; \
2206 $(call get-inputs,$*.fls,$(addprefix $*.,aux aux.make d dvi)) >> $*.d; \
2207 $(call get-graphics,$*.log,$(addprefix $*.,d dvi _graphics)) >> $*.d; \
2208 $(call get-log-index,$*,$(addprefix $*.,d aux aux.make)) >> $*.d; \
2209 $(call get-bibs,$*.aux.make,$(addprefix $*.,bbl aux aux.make)) >> $*.d; \
2210 for s in toc out lot lof lol nav; do \
2211 if [ -e "$*.$$s" ]; then \
2212 if ! $(DIFF) -q $*.$$s $*.$$s.make 2>/dev/null; then \
2213 $(TOUCH) $*.run.cookie; \
2214 fi; \
2215 $(CP) $*.$$s $*.$$s.make; \
2216 fi; \
2217 done
2218
2219# This is a cookie that is updated if the flattened aux file has changed in a
2220# way that affects the bibliography generation.
2221.SECONDARY: $(addsuffix .auxbbl.make,$(stems_ssg))
2222%.auxbbl.make: %.aux.make
2223 $(QUIET)\
2224 $(call make-auxbbl-file,$<,$@.temp); \
2225 $(call replace-if-different-and-remove,$@.temp,$@)
2226
2227# Build a dependency file for .gpi files. These often plot data files that
2228# also reside in the directory, so if a data file changes, it's nice to know
2229# about it. This also handles loaded .gpi files, whose filename should have
2230# _include_. in it.
2231%._gray_.gpi.d: %.gpi
2232 $(QUIET)$(call echo-build,$<,$@)
2233 $(QUIET)$(call make-gpi-d,$<,$@)
2234
2235%.gpi.d: %.gpi
2236 $(QUIET)$(call echo-build,$<,$@)
2237 $(QUIET)$(call make-gpi-d,$<,$@)
2238
2239# Store the paper size for this document -- note that if beamer is used we set
2240# it to the special BEAMER paper size. We only do this, however, if the
2241# special comment exists, in which case we enlarge the output with psnup.
2242#
2243# The paper size is extracted from a documentclass attribute.
2244%.paper.make: %.tex
2245 $(QUIET)$(SED) \
2246 -e '/\\documentclass/,/}/{' \
2247 -e ' s/%.*//' \
2248 -e ' H' \
2249 -e ' /}/{' \
2250 -e ' s/.*//' \
2251 -e ' x' \
2252 -e ' /\\documentclass/!d' \
2253 -e ' s/[\n[:space:]]*//g' \
2254 -e ' s/\([,{[]\)\([[:alnum:]]\{1,\}\)paper\([],}]\)/\1%-\2-%\3/g' \
2255 -e ' s/\([,{[]\)\(landscape\)\([],}]\)/\1%-\2-%\3/g' \
2256 -e ' s/^[^%]*%-//' \
2257 -e ' s/-%[^%]*$$//' \
2258 -e ' s/-%[^%]%-/ /g' \
2259 -e ' p' \
2260 -e ' }' \
2261 -e ' d' \
2262 -e '}' \
2263 -e 'd' \
2264 $< > $@; \
2265 $(EGREP) -q '^[^%]*\\documentclass[^{]*{beamer}' $< && \
2266 (\
2267 $(EGREP) -q '^%%[[:space:]]*BEAMER[[:space:]]*LARGE$$' $< && \
2268 $(ECHO) "BEAMER" > $@ || \
2269 : > $@ \
2270 ) || $(sh_true)
2271
2272# Store embedding instructions for this document using a special comment
2273%.embed.make: %.tex
2274 $(QUIET)$(EGREP) '^%%[[:space:]]*NO[[:space:]]*EMBED[[:space:]]*$$' $< \
2275 && $(ECHO) '' > $@ \
2276 || $(ECHO) '1' > $@;
2277
2278#
2279# HELPFUL PHONY TARGETS
2280#
2281
2282.PHONY: _all_programs
2283_all_programs:
2284 $(QUIET)$(ECHO) "== All External Programs Used =="
2285 $(QUIET)$(call output-all-programs)
2286
2287.PHONY: _check_programs
2288_check_programs:
2289 $(QUIET)$(ECHO) "== Checking Makefile Dependencies =="; $(ECHO)
2290 $(QUIET) \
2291 $(ECHO) hi; \
2292 allprogs=`\
2293 ($(call output-all-programs)) | \
2294 $(SED) \
2295 -e 's/^[[:space:]]*//' \
2296 -e '/^#/d' \
2297 -e 's/[[:space:]]*#.*//' \
2298 -e '/^=/s/[[:space:]]/_/g' \
2299 -e '/^[[:space:]]*$$/d' \
2300 -e 's/^[^=].*=[[:space:]]*\([^[:space:]]\{1,\}\).*$$/\\1/' \
2301 `; \
2302 spaces=' '; \
2303 for p in $${allprogs}; do \
2304 case $$p in \
2305 =*) $(ECHO); $(ECHO) "$$p";; \
2306 *) \
2307 $(ECHO) -n "$$p:$$spaces" | $(SED) -e 's/^\(.\{0,20\}\).*$$/\1/'; \
2308 loc=`$(WHICH) $$p`; \
2309 if [ x"$$?" = x"0" ]; then \
2310 $(ECHO) "$(C_SUCCESS)Found:$(C_RESET) $$loc"; \
2311 else \
2312 $(ECHO) "$(C_FAILURE)Not Found$(C_RESET)"; \
2313 fi; \
2314 ;; \
2315 esac; \
2316 done
2317
2318.PHONY: _check_gpi_files
2319_check_gpi_files:
2320 $(QUIET)$(ECHO) "== Checking all .gpi files for common errors =="; \
2321 $(ECHO); \
2322 for f in $(files.gpi); do \
2323 result=`$(EGREP) '^([^#]*set terminal |set output )' $$f`; \
2324 $(ECHO) -n "$$f: "; \
2325 if [ x"$$result" = x"" ]; then \
2326 $(ECHO) "$(C_SUCCESS)Okay$(C_RESET)"; \
2327 else \
2328 $(ECHO) "$(C_FAILURE)Warning: Problematic commands:$(C_RESET)";\
2329 $(ECHO) "$(C_ERROR)$$result$(C_RESET)"; \
2330 fi; \
2331 done; \
2332 $(ECHO)
2333
2334.PHONY: _all_stems
2335_all_stems:
2336 $(QUIET)$(ECHO) "== All Stems =="
2337 $(QUIET)$(call echo-list,$(sort $(all_stems)))
2338
2339.PHONY: _includes
2340_includes:
2341 $(QUIET)$(ECHO) "== Include Stems =="
2342 $(QUIET)$(ECHO) "=== Sources ==="
2343 $(QUIET)$(call echo-list,$(sort $(source_includes)))
2344 $(QUIET)$(ECHO) "=== Graphics ==="
2345 $(QUIET)$(call echo-list,$(sort $(graphic_includes)))
2346
2347.PHONY: _all_sources
2348_all_sources:
2349 $(QUIET)$(ECHO) "== All Sources =="
2350 $(QUIET)$(call echo-list,$(sort $(all_files.tex)))
2351
2352.PHONY: _dependency_graph
2353_dependency_graph:
2354 $(QUIET)$(ECHO) "/* LaTeX Dependency Graph */"
2355 $(QUIET)$(call output-dependency-graph)
2356
2357.PHONY: _show_dependency_graph
2358_show_dependency_graph:
2359 $(QUIET)$(call output-dependency-graph,$(graph_stem).dot)
2360 $(QUIET)$(DOT) -Tps -o $(graph_stem).eps $(graph_stem).dot
2361 $(QUIET)$(VIEW_POSTSCRIPT) $(graph_stem).eps
2362 $(QUIET)$(call remove-temporary-files,$(graph_stem).*)
2363
2364.PHONY: _sources
2365_sources:
2366 $(QUIET)$(ECHO) "== Sources =="
2367 $(QUIET)$(call echo-list,$(sort $(files.tex)))
2368
2369.PHONY: _scripts
2370_scripts:
2371 $(QUIET)$(ECHO) "== Scripts =="
2372 $(QUIET)$(call echo-list,$(sort $(files_scripts)))
2373
2374.PHONY: _graphic_outputs
2375_graphic_outputs:
2376 $(QUIET)$(ECHO) "== Graphic Outputs =="
2377 $(QUIET)$(call echo-list,$(sort $(all_graphics_targets)))
2378
2379.PHONY: _graphic_sources
2380_graphic_sources:
2381 $(QUIET)$(ECHO) "== Graphic Sources =="
2382 $(QUIET)$(call echo-list,$(sort $(files_graphics)))
2383
2384.PHONY: _env
2385_env:
2386ifdef .VARIABLES
2387 $(QUIET)$(ECHO) "== MAKE VARIABLES =="
2388 $(QUIET)$(call echo-list,$(foreach var,$(sort $(.VARIABLES)),'$(var)'))
2389endif
2390 $(QUIET)$(ECHO) "== ENVIRONMENT =="
2391 $(QUIET)$(ENV)
2392
2393#
2394# CLEAN TARGETS
2395#
2396# clean-generated is somewhat unique - it relies on the .fls file being
2397# properly built so that it can determine which of the files was generated, and
2398# which was not. Expect it to silently fail if the .fls file is missing.
2399#
2400# This is used to, e.g., clean up index files that are generated by the LaTeX.
2401.PHONY: clean-generated
2402clean-generated:
2403 $(QUIET)$(call clean-files,$(foreach e,$(addsuffix .fls,$(all_stems_source)),\
2404 $(shell $(call get-generated-names,$e))))
2405
2406.PHONY: clean-deps
2407clean-deps:
2408 $(QUIET)$(call clean-files,$(all_d_targets) *.make *.make.temp *.cookie)
2409
2410.PHONY: clean-tex
2411clean-tex: clean-deps
2412 $(QUIET)$(call clean-files,$(rm_tex))
2413
2414.PHONY: clean-graphics
2415# TODO: This *always* deletes pstex files, even if they were not generated by
2416# anything.... In other words, if you create a pstex and pstex_t pair by hand
2417# an drop them in here without the generating fig file, they will be deleted
2418# and you won't get them back. It's a hack put in here because I'm not sure we
2419# even want to keep pstex functionality, so my motivation is not terribly high
2420# for doing it right.
2421clean-graphics:
2422 $(QUIET)$(call clean-files,$(all_graphics_targets) *.gpi.d *.pstex *.pstex_t *.dot_t)
2423
2424.PHONY: clean-backups
2425clean-backups:
2426 $(QUIET)$(call clean-files,$(backup_patterns) *.temp)
2427
2428.PHONY: clean-auxiliary
2429clean-auxiliary:
2430 $(QUIET)$(call clean-files,$(graph_stem).*)
2431
2432.PHONY: clean-nographics
2433clean-nographics: clean-tex clean-deps clean-backups clean-auxiliary ;
2434
2435.PHONY: clean
2436clean: clean-generated clean-tex clean-graphics clean-deps clean-backups clean-auxiliary
2437
2438#
2439# HELP TARGETS
2440#
2441
2442.PHONY: help
2443help:
2444 $(help_text)
2445
2446.PHONY: version
2447version:
2448 $(QUIET)\
2449 $(ECHO) "$(fileinfo) Version $(version)"; \
2450 $(ECHO) "by $(author)"; \
2451
2452#
2453# HELP TEXT
2454#
2455
2456define help_text
2457# $(fileinfo) Version $(version)
2458#
2459# by $(author)
2460#
2461# Generates a number of possible output files from a LaTeX document and its
2462# various dependencies. Handles .bib files, \include and \input, and .eps
2463# graphics. All dependencies are handled automatically by running LaTeX over
2464# the source.
2465#
2466# USAGE:
2467#
2468# make [GRAY=1] [VERBOSE=1] [SHELL_DEBUG=1] <target(s)>
2469#
2470# STANDARD OPTIONS:
2471# GRAY:
2472# Setting this variable forces all recompiled graphics to be grayscale.
2473# It is useful when creating a document for printing. The default is
2474# to allow colors. Note that it only changes graphics that need to be
2475# rebuilt! It is usually a good idea to do a 'make clean' first.
2476#
2477# There is another facility for creating grayscale documents that is
2478# better when you can use it (it has some small limitations not shared
2479# by this approach). See the section on %._gray_ targets below.
2480#
2481# VERBOSE:
2482# This turns off all @ prefixes for commands invoked by make. Thus,
2483# you get to see all of the gory details of what is going on.
2484#
2485# SHELL_DEBUG:
2486# This enables the -x option for sh, meaning that everything it does is
2487# echoed to stderr. This is particularly useful for debugging
2488# what is going on in $$(shell ...) invocations. One of my favorite
2489# debugging tricks is to do this:
2490#
2491# make -d SHELL_DEBUG=1 VERBOSE=1 2>&1 | less
2492#
2493# STANDARD AUXILIARY FILES:
2494#
2495# Makefile.ini
2496#
2497# This file can contain variable declarations that override various
2498# aspects of the makefile. For example, one might specify
2499#
2500# neverclean := *.pdf *.ps
2501# onlysources.tex := main.tex
2502# LATEX_COLOR_WARNING := 'bold red uline'
2503#
2504# And this would override the neverclean setting to ensure that pdf
2505# and ps files always remain behind, set the makefile to treat all
2506# .tex files that are not "main.tex" as includes (and therefore not
2507# default targets). It also changes the LaTeX warning output to be
2508# red, bold, and underlined.
2509#
2510# There are numerous variables in this file that can be overridden in
2511# this way. Search for '?=' to find them all.
2512#
2513# Also, you can put arbitrary targets into it if, for example, you
2514# want your source built from something else, e.g.:
2515#
2516# generated.tex: generating_script.weird_lang depA depB
2517# ./generating_script.weird_lang > $$@
2518#
2519# The Makefile.ini is imported before anything else is done, so go
2520# wild with your ideas for changes to this makefile in there. It
2521# makes it easy to test them before submitting patches.
2522#
2523# STANDARD ENVIRONMENT VARIABLES:
2524#
2525# LATEX_COLOR_WARNING '$(LATEX_COLOR_WARNING)'
2526# LATEX_COLOR_ERROR '$(LATEX_COLOR_ERROR)'
2527# LATEX_COLOR_UNDERFULL '$(LATEX_COLOR_UNDERFULL)'
2528# LATEX_COLOR_OVERFULL '$(LATEX_COLOR_OVERFULL)'
2529# LATEX_COLOR_PAGES '$(LATEX_COLOR_PAGES)'
2530# LATEX_COLOR_BUILD '$(LATEX_COLOR_BUILD)'
2531# LATEX_COLOR_GRAPHIC '$(LATEX_COLOR_GRAPHIC)'
2532# LATEX_COLOR_DEP '$(LATEX_COLOR_DEP)'
2533# LATEX_COLOR_SUCCESS '$(LATEX_COLOR_SUCCESS)'
2534# LATEX_COLOR_FAILURE '$(LATEX_COLOR_FAILURE)'
2535#
2536# These may be redefined in your environment to be any of the following:
2537#
2538# black
2539# red
2540# green
2541# yellow
2542# blue
2543# magenta
2544# cyan
2545# white
2546#
2547# Bold or underline may be used, as well, either alone or in combination
2548# with colors:
2549#
2550# bold
2551# uline
2552#
2553# Order is not important. You may want, for example, to specify:
2554#
2555# export LATEX_COLOR_SUCCESS='bold blue uline'
2556#
2557# in your .bashrc file. I don't know why, but you may want to.
2558#
2559# STANDARD TARGETS:
2560#
2561# all:
2562# Make all possible documents in this directory. The documents are
2563# determined by scanning for .tex and .tex.sh (described in more detail
2564# later) and omitting any file that ends in ._include_.tex or
2565# ._nobuild_.tex. The output is a set of .pdf files.
2566#
2567# If you wish to omit files without naming them with the special
2568# underscore names, set the following near the top of the Makefile,
2569# or (this is recommended) within a Makefile.ini in the same directory:
2570#
2571# includes.tex := file1.tex file2.tex
2572#
2573# This will cause the files listed to be considered as include files.
2574#
2575# If you have only few source files, you can set
2576#
2577# onlysources.tex := main.tex
2578#
2579# This will cause only the source files listed to be considered in
2580# dependency detection. All other .tex files will be considered as
2581# include files. Note that these options work for *any* source type,
2582# so you could do something similar with includes.gpi, for example.
2583# Note that this works for *any valid source* target. All of the
2584# onlysources.* variables are commented out in the shipping version of
2585# this file, so it does the right thing when they simply don't exist.
2586# The comments are purely documentation. If you know, for example, that
2587# file.mycoolformat is supported by this Makefile, but don't see the
2588# "onlysources.mycoolformat" declared in the comments, that doesn't mean
2589# you can't use it. Go ahead and set "onlysources.mycoolformat" and it
2590# should do the right thing.
2591#
2592# show:
2593# Builds and displays all documents in this directory. It uses the
2594# environment-overridable value of VIEW_PDF (currently $(VIEW_PDF)) to
2595# do its work.
2596#
2597# all-graphics:
2598# Make all of the graphics in this directory.
2599#
2600# all-pstex:
2601# Build all fig files into pstex and pstex_t files. Gray DOES NOT WORK.
2602#
2603# all-gray-pstex:
2604# Build all fig files into grayscale pstex and pstex_t files.
2605#
2606# all-dot2tex:
2607# Build all dot files into tex files.
2608#
2609# show-graphics:
2610# Builds and displays all graphics in this directory. Uses the
2611# environment-overridable value of VIEW_GRAPHICS (currently
2612# $(VIEW_GRAPHICS)) to do its work.
2613#
2614# clean:
2615# Remove ALL generated files, leaving only source intact.
2616# This will *always* skip files mentioned in the "neverclean" variable,
2617# either in this file or specified in Makefile.ini:
2618#
2619# neverclean := *.pdf *.ps
2620#
2621# The neverclean variable works on all "clean" targets below, as well.
2622#
2623# clean-graphics:
2624# Remove all generated graphics files.
2625#
2626# clean-backups:
2627# Remove all backup files: $(backup_patterns)
2628# (XFig and other editors have a nasty habit of leaving them around)
2629# Also removes Makefile-generated .temp files
2630#
2631# clean-tex:
2632# Remove all files generated from LaTeX invocations except dependency
2633# information. Leaves graphics alone.
2634#
2635# clean-deps:
2636# Removes all auto-generated dependency information.
2637#
2638# clean-auxiliary:
2639# Removes extra files created by various targets (like the dependency
2640# graph output).
2641#
2642# clean-nographics:
2643# Cleans everything *except* the graphics files.
2644#
2645# help:
2646# This help text.
2647#
2648# version:
2649# Version information about this LaTeX makefile.
2650#
2651# DEBUG TARGETS:
2652#
2653# _all_programs:
2654# A list of the programs used by this makefile.
2655#
2656# _check_programs:
2657# Checks your system for the needed software and reports what it finds.
2658#
2659# _check_gpi_files:
2660# Checks the .gpi files in the current directory for common errors, such
2661# as specification of the terminal or output file inside of the gpi file
2662# itself.
2663#
2664# _dependency_graph:
2665# Outputs a .dot file to stdout that represents a graph of LaTeX
2666# dependencies. To see it, use the _show_dependency_graph target or
2667# direct the output to a file, run dot on it, and view the output, e.g.:
2668#
2669# make _dependency_graph > graph.dot
2670# dot -T ps -o graph.eps graph.dot
2671# gv graph.eps
2672#
2673# _show_dependency_graph:
2674# Makes viewing the graph simple: extracts, builds and displays the
2675# dependency graph given in the _dependency_graph target using the value
2676# of the environment-overridable VIEW_POSTSCRIPT variable (currently set
2677# to $(VIEW_POSTSCRIPT)). The postscript viewer is used because it
2678# makes it easier to zoom in on the graph, a critical ability for
2679# something so dense and mysterious.
2680#
2681# _all_sources:
2682# List all .tex files in this directory.
2683#
2684# _sources:
2685# Print out a list of all compilable sources in this directory. This is
2686# useful for determining what make thinks it will be using as the
2687# primary source for 'make all'.
2688#
2689# _scripts:
2690# Print out a list of scripts that make knows can be used to generate
2691# .tex files (described later).
2692#
2693# _all_stems:
2694# Print a list of stems. These represent bare targets that can be
2695# executed. Listing <stem> as a bare target will produce <stem>.pdf.
2696#
2697# _includes:
2698# A list of .d files that would be included in this run if _includes
2699# weren't specified. This target may be used alone or in conjunction
2700# with other targets.
2701#
2702# _graphic_sources:
2703# A list of all files that can create .eps files
2704#
2705# _graphic_outputs:
2706# A list of all generated .eps files
2707#
2708# _env:
2709# A list of environment variables and their values. If supported by
2710# your version of make, also a list of variables known to make.
2711#
2712# FILE TARGETS:
2713#
2714# %, %.pdf:
2715# Build a PDF file from the corresponding %.tex file. This is
2716# done using dvips and ps2pdf. Some may object to this idea,
2717# saying that pdflatex is a better approach, but I disagree for
2718# two major reasons:
2719#
2720# * Postscript can be a very nice thing to have directly from the LaTeX
2721# file, especially when printing.
2722#
2723# * One word: psfrag. If you don't know this wonderful package, get to
2724# know it. It is a workhorse for making graphs pretty.
2725#
2726# %._show:
2727# A phony target that builds the pdf file and then displays it using the
2728# environment-overridable value of VIEW_PDF ($(VIEW_PDF)).
2729#
2730# %._graphics:
2731# A phony target that generates all graphics on which %.dvi
2732# depends.
2733#
2734# %.ps:
2735# Build a Postscript file from the corresponding %.tex file.
2736# This is done using dvips. Paper size is automatically
2737# extracted from the declaration
2738#
2739# \documentclass[<something>paper]
2740#
2741# or it is the system default.
2742#
2743# If using beamer (an excellent presentation class), the paper
2744# size is ignored. More on this later.
2745#
2746# %.dvi:
2747# Build the DVI file from the corresponding %.tex file.
2748#
2749# %.ind:
2750# Build the index for this %.tex file.
2751#
2752# %.gls:
2753# Build the nomenclature glossary for this %.tex file.
2754#
2755# %.nls:
2756# Build the (newer) nomenclature file for this %.tex file.
2757#
2758# %.eps:
2759# Build an eps file from one of the following file types:
2760#
2761# .dot : graphviz
2762# .gpi : gnuplot
2763# .fig : xfig
2764# .xvg : xmgrace
2765# .svg : scalable vector graphics (goes through inkscape)
2766# .png : png (goes through NetPBM)
2767# .jpg : jpeg (goes through ImageMagick)
2768# .eps.gz : gzipped eps
2769#
2770# The behavior of this makefile with each type is described in
2771# its own section below.
2772#
2773# %.pstex{,_t}:
2774# Build a .pstex_t file from a .fig file.
2775#
2776# All targets have a corresponding %._gray_.suffix form, which creates
2777# everything in monochrome. This is useful for creating both color and
2778# grayscale versions of the same document, and they can coexist happily in
2779# the same directory. Examples:
2780#
2781# make test._gray_._graphics # Build all grayscale graphics
2782# make test._gray_ # Build a grayscale document
2783#
2784# The use of a ._gray_ target creates ._gray_.tex files (not forgetting the
2785# included files!) with appropriate dependencies on ._gray_.eps graphics.
2786# This approach is in many ways superior to specifying GRAY=1 on the command
2787# line, but has some limitations. Because a new .tex file must be created,
2788# this means that the original .tex file must be parsed and all references
2789# to graphics and include files must be transformed. This can be a brittle
2790# operation in a macro-based language like LaTeX, since it is very easy to
2791# define macros that call \include or \input indirectly.
2792#
2793# Here the naming strategy for include files comes into play. They all have
2794# ._include_. in their name, and are therefore fairly easy to search out.
2795# That sequence is unlikely to appear in text, so it is fairly safe to
2796# replace it. Anything ending in .eps is also replaced to end with
2797# ._gray_.eps, and is subject to the same issues.
2798#
2799# In short, if your file contains _include_ when not referencing a file, or
2800# it says .eps when not referencing a graphic, this approach is probably not
2801# for you. I imagine that these cases are fairly rare, however, so it
2802# should work most of the time. When a doubt arises, you can be sure that
2803# GRAY=1 will do the right thing, provided you precede it with a 'make
2804# clean'.
2805#
2806# FEATURES:
2807#
2808# Optional Binary Directory:
2809# If you create the _out_ directory in the same place as the makefile,
2810# it will automatically be used as a dumping ground for .dvi, .ps, and
2811# .pdf output files.
2812#
2813# Alternatively, you can set the BINARY_TARGET_DIR variable, either as a
2814# make argument or in Makefile.ini, to point to your directory of
2815# choice. Note that no pathname wildcard expansion is done in the
2816# makefile, so make sure that the path is complete before going in
2817# there. E.g., if you want to specify something in your home directory,
2818# use $$HOME/ instead of ~/ so that the shell expands it before it gets
2819# to the makefile.
2820#
2821# External Program Dependencies:
2822# Every external program used by the makefile is represented by an
2823# ALLCAPS variable at the top of this file. This should allow you to
2824# make judgments about whether your system supports the use of this
2825# makefile. The list is available in the ALL_PROGRAMS variable and,
2826# provided that you are using GNU make 3.80 or later (or you haven't
2827# renamed this file to something weird like "mylatexmakefile" and like
2828# invoking it with make -f) can be viewed using
2829#
2830# make _all_programs
2831#
2832# Additionally, the availability of these programs can be checked
2833# automatically for you by running
2834#
2835# make _check_programs
2836#
2837# The programs are categorized according to how important they are and
2838# what function they perform to help you decide which ones you really
2839# need.
2840#
2841# Colorized Output:
2842# The output of commands is colorized to highlight things that are often
2843# important to developers. This includes {underfull,overfull}
2844# {h,v}boxes, general LaTeX Errors, each stage of document building, and
2845# the number of pages in the final document. The colors are obtained
2846# using 'tput', so colorization should work pretty well on any terminal.
2847#
2848# The colors can be customized very simply by setting any of the
2849# LATEX_COLOR_<CONTEXT> variables in your environment (see above).
2850#
2851# Predecessors to TeX Files:
2852# Given a target <target>, if no <target>.tex file exists but a
2853# corresponding script or predecessor file exists, then appropriate
2854# action will be taken to generate the tex file.
2855#
2856# Currently supported script or predecessor languages are:
2857#
2858# sh: %.tex.sh
2859#
2860# Calls the script using sh, assuming that its output is a .tex
2861# file. Of course, your .sh file can call another script to do
2862# its work. Go wild!
2863#
2864# The script is called thus:
2865#
2866# <interpreter> <script file name> <target tex file>
2867#
2868# and therefore sees exactly one parameter: the name of the .tex
2869# file that it is to create.
2870#
2871# Why does this feature exist? I ran into this while working on
2872# my paper dissertation. I wrote a huge bash script that used a
2873# lot of sed to bring together existing papers in LaTeX. It
2874# would have been nice had I had something like this to make my
2875# life easier, since as it stands I have to run the script and
2876# then build the document with make. This feature provides hooks
2877# for complicated stuff that you may want to do, but that I have
2878# not considered.
2879#
2880# This approach does not work for included .tex files. If you
2881# want to do something special with those, you should wrap all of
2882# that functionality into a top-level source script that creates
2883# the necessary includes as well.
2884#
2885# reST: %.rst
2886#
2887# Runs the reST to LaTeX converter to generate a .tex file
2888# If it finds a file names _rststyle_._include_.tex, uses it as
2889# the "stylesheet" option to rst2latex.
2890#
2891# Dependencies:
2892#
2893# In general, dependencies are extracted directly from LaTeX output on
2894# your document. This includes
2895#
2896# * Bibliography information
2897# * \include or \input files (honoring \includeonly, too)
2898# * Graphics files inserted by the graphicx package
2899#
2900# Where possible, all of these are built correctly and automatically.
2901# In the case of graphics files, these are generated from the following
2902# file types:
2903#
2904# GraphViz: .dot
2905# GNUPlot: .gpi
2906# XFig: .fig
2907# XMgrace: .xvg
2908# SVG: .svg
2909# PNG: .png
2910# JPEG: .jpg
2911# GZipped EPS: .eps.gz
2912#
2913# If the file exists as a .eps already, it is merely used (and will not
2914# be deleted by 'clean'!).
2915#
2916# LaTeX and BibTeX are invoked correctly and the "Rerun to get
2917# cross-references right" warning is heeded a reasonable number of
2918# times. In my experience this is enough for even the most troublesome
2919# documents, but it can be easily changed (if LaTeX has to be run after
2920# BibTeX more than three times, it is likely that something is moving
2921# back and forth between pages, and no amount of LaTeXing will fix
2922# that).
2923#
2924# \includeonly is honored by this system, so files that are not
2925# specified there will not trigger a rebuild when changed.
2926#
2927# Beamer:
2928# A special TeX source comment is recognized by this makefile:
2929#
2930# %%[[:space:]]*BEAMER[[:space:]]*LARGE
2931#
2932# The presence of this comment forces the output of dvips through psnup
2933# to enlarge beamer slides to take up an entire letter-sized page. This
2934# is particularly useful when printing transparencies or paper versions
2935# of the slides. For some reason landscape orientation doesn't appear
2936# to work, though.
2937#
2938# If you want to put multiple slides on a page, use this option and then
2939# print using mpage, a2ps, or psnup to consolidate slides. My personal
2940# favorite is a2ps, but your mileage may vary.
2941#
2942# When beamer is the document class, dvips does NOT receive a paper size
2943# command line attribute, since beamer does special things with sizes.
2944#
2945# GNUPlot Graphics:
2946# When creating a .gpi file, DO NOT INCLUDE the "set terminal" or "set
2947# output" commands! The makefile will include terminal information for
2948# you. Besides being unnecessary and potentially harmful, including the
2949# terminal definition in the .gpi file makes it harder for you, the one
2950# writing the document, to preview your graphics, e.g., with
2951#
2952# gnuplot -persist myfile.gpi
2953#
2954# so don't do specify a terminal or an output file in your .gpi files.
2955#
2956# When building a gpi file into an eps file, there are several features
2957# available to the document designer:
2958#
2959# Global Header:
2960# The makefile searches for the files in the variable GNUPLOT_GLOBAL
2961# in order:
2962#
2963# ($(GNUPLOT_GLOBAL))
2964#
2965# Only the first found is used. All .gpi files in the directory are
2966# treated as though the contents of GNUPLOT_GLOBAL were directly
2967# included at the top of the file.
2968#
2969# NOTE: This includes special comments! (see below)
2970#
2971# Font Size:
2972# A special comment in a .gpi file (or a globally included file) of
2973# the form
2974#
2975# ## FONTSIZE=<number>
2976#
2977# will change the font size of the GPI output. If font size is
2978# specified in both the global file and the GPI file, the
2979# specification in the individual GPI file is used.
2980#
2981# Grayscale Output:
2982# GNUplot files also support a special comment to force them to be
2983# output in grayscale *no matter what*:
2984#
2985# ## GRAY
2986#
2987# This is not generally advisable, since you can always create a
2988# grayscale document using the forms mentioned above. But, if your
2989# plot simply must be grayscale even in a document that allows
2990# colors, this is how you do it.
2991#
2992# XFig Graphics:
2993# No special handling is done with XFig, except when a global
2994# grayscale method is used, e.g.
2995#
2996# make document._gray_
2997# or
2998# make GRAY=1 document
2999#
3000# In these cases the .eps files is created using the -N switch to
3001# fig2dev to turn off color output. (Only works with eps, not
3002# pstex output!)
3003#
3004# GraphVis Graphics:
3005# Color settings are simply ignored here. The 'dot' program is used
3006# to transform a .dot file into a .eps file.
3007#
3008# If you want, you can use the dot2tex program to convert dot files
3009# to tex graphics. The default is to just call dot2tex with no
3010# arguments, but you can change the DOT2TEX definition to include
3011# options as needed (in your Makefile.ini).
3012#
3013# Note that, like pstex, the makefile cannot use latex's own output
3014# to discover all missing dot_t (output) files, since anytime TeX
3015# includes TeX, it has to bail when it can't find the include file.
3016# It can therefore only stop on the first missing file it discovers,
3017# and we can't get a large list of them out easily.
3018#
3019# So, the makefile errors out if it's missing an included dot_t
3020# file, then prompts the user to run this command manually:
3021#
3022# make all-dot2tex
3023#
3024# GZipped EPS Graphics:
3025#
3026# A .eps.gz file is sometimes a nice thing to have. EPS files can get
3027# very large, especially when created from bitmaps (don't do this if you
3028# don't have to). This makefile will unzip them (not in place) to
3029# create the appropriate EPS file.
3030#
3031endef
3032
3033#
3034# DEPENDENCY CHART:
3035#
3036#digraph "g" {
3037# rankdir=TB
3038# size="9,9"
3039# edge [fontsize=12 weight=10]
3040# node [shape=box fontsize=14 style=rounded]
3041#
3042# eps [
3043# shape=Mrecord
3044# label="{{<gpi> GNUplot|<epsgz> GZip|<dot> Dot|<fig> XFig}|<eps> eps}"
3045# ]
3046# pstex [label="%.pstex"]
3047# pstex_t [label="%.pstex_t"]
3048# tex_outputs [shape=point]
3049# extra_tex_files [shape=point]
3050# gpi_data [label="<data>"]
3051# gpi_includes [label="_include_.gpi"]
3052# aux [label="%.aux"]
3053# fls [label="%.fls"]
3054# idx [label="%.idx"]
3055# glo [label="%.glo"]
3056# ind [label="%.ind"]
3057# log [label="%.log"]
3058# tex_sh [label="%.tex.sh"]
3059# rst [label="%.rst"]
3060# tex [
3061# shape=record
3062# label="<tex> %.tex|<include> _include_.tex"
3063# ]
3064# include_aux [label="_include_.aux"]
3065# file_bib [label=".bib"]
3066# bbl [label="%.bbl"]
3067# dvi [label="%.dvi"]
3068# ps [label="%.ps"]
3069# pdf [label="%.pdf"]
3070# fig [label=".fig"]
3071# dot [label=".dot"]
3072# gpi [label=".gpi"]
3073# eps_gz [label=".eps.gz"]
3074#
3075# gpi_files [shape=point]
3076#
3077# rst -> tex:tex [label="reST"]
3078# tex_sh -> tex:tex [label="sh"]
3079# tex -> tex_outputs [label="latex"]
3080# tex_outputs -> dvi
3081# tex_outputs -> aux
3082# tex_outputs -> log
3083# tex_outputs -> fls
3084# tex_outputs -> idx
3085# tex_outputs -> include_aux
3086# aux -> bbl [label="bibtex"]
3087# file_bib -> bbl [label="bibtex"]
3088# idx -> ind [label="makeindex"]
3089# glo -> gls [label="makeindex"]
3090# nlo -> nls [label="makeindex"]
3091# gls -> extra_tex_files
3092# nls -> extra_tex_files
3093# ind -> extra_tex_files
3094# bbl -> extra_tex_files
3095# eps -> extra_tex_files
3096# extra_tex_files -> dvi [label="latex"]
3097# gpi_files -> eps:gpi [label="gnuplot"]
3098# gpi -> gpi_files
3099# gpi_data -> gpi_files
3100# gpi_includes -> gpi_files
3101# eps_gz -> eps:epsgz [label="gunzip"]
3102# fig -> eps:fig [label="fig2dev"]
3103# fig -> pstex [label="fig2dev"]
3104# fig -> pstex_t [label="fig2dev"]
3105# pstex -> pstex_t [label="fig2dev"]
3106# dot -> eps:dot [label="dot"]
3107# dvi -> ps [label="dvips"]
3108# include_aux -> bbl [label="bibtex"]
3109# ps -> pdf [label="ps2pdf"]
3110#
3111# edge [ color=blue label="" style=dotted weight=1 fontcolor=blue]
3112# fls -> tex:include [label="INPUT: *.tex"]
3113# fls -> file_bib [label="INPUT: *.aux"]
3114# aux -> file_bib [label="\\bibdata{...}"]
3115# include_aux -> file_bib [label="\\bibdata{...}"]
3116# log -> gpi [label="Graphic file"]
3117# log -> fig [label="Graphic file"]
3118# log -> eps_gz [label="Graphic file"]
3119# log -> dot [label="Graphic file"]
3120# log -> idx [label="No file *.ind"]
3121# log -> glo [label="No file *.gls"]
3122# log -> nlo [label="No file *.nls"]
3123# gpi -> gpi_data [label="plot '...'"]
3124# gpi -> gpi_includes [label="load '...'"]
3125# tex:tex -> ps [label="paper"]
3126# tex:tex -> pdf [label="embedding"]
3127#}
3128
3129#
3130# DEPENDENCY CHART SCRIPT
3131#
3132# $(call output_dependency_graph,[<output file>])
3133define output-dependency-graph
3134 if [ -f '$(this_file)' ]; then \
3135 $(SED) \
3136 -e '/^[[:space:]]*#[[:space:]]*DEPENDENCY CHART:/,/^$$/!d' \
3137 -e '/DEPENDENCY CHART/d' \
3138 -e '/^$$/d' \
3139 -e 's/^[[:space:]]*#//' \
3140 $(this_file) $(if $1,> '$1',); \
3141 else \
3142 $(ECHO) "Cannot determine the name of this makefile."; \
3143 fi
3144endef
3145# vim: noet sts=0 sw=8 ts=8
33146
=== added directory 'Planet Stuff'
=== added file 'Planet Stuff/READ THIS FIRST!!'
--- Planet Stuff/READ THIS FIRST!! 1970-01-01 00:00:00 +0000
+++ Planet Stuff/READ THIS FIRST!! 2014-09-01 04:44:23 +0000
@@ -0,0 +1,5 @@
1It's mainly all set up, all you have to do is follow these instructions to add feeds and then create a cron job to update it every 15 mins or so.
2
3https://wiki.ubuntu.com/LoCoCreatingPlanet
4
5I've downloaded the latest version of planet and extracted here. It's in /planet-2.0
06
=== added file 'Planet Stuff/README'
--- Planet Stuff/README 1970-01-01 00:00:00 +0000
+++ Planet Stuff/README 2014-09-01 04:44:23 +0000
@@ -0,0 +1,11 @@
1This is the planet.ubuntu.ro new PlanetPlanet theme. Code is a modified moinmoin
2design, containing also code from ubuntu.com drupal theme.
3
4You are free to use this theme on other ubuntu planets.
5
6For instalation, css/, img/ and planet.css must be copied into planetplanet's
7output directory. The links shall be changed in index.html.tmpl. The logo is
8in img/ as logo.png
9
10Any further information available upon request from alexef@softwareliber.ro or
11alex@eftimie.ro.
012
=== added directory 'Planet Stuff/css'
=== added directory 'Planet Stuff/css/.ssh'
=== added file 'Planet Stuff/css/.ssh/authorized_keys'
--- Planet Stuff/css/.ssh/authorized_keys 1970-01-01 00:00:00 +0000
+++ Planet Stuff/css/.ssh/authorized_keys 2014-09-01 04:44:23 +0000
@@ -0,0 +1,2 @@
1ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtRP0Iisni0A4mkqLkdxlwEswZb9YOxsAj9eu3vBYu9OWW2CBK/Spz5v0aAVbqOd2f1jG1rC+KMWdA7Dpe0ZvofSM4EXN8mNXChv0awUN0ENURMurKtfq1QxarCz9U+ErDhi1k5CoebszjtuWvR3AntPtTzyISY7f2mwc0PU50kOiayJf4dE1hutvRzTqcSVj00ZMgF5L/G1xIyu+sHPOHcEEC+JA9f91iX4E364AZgv5lp9QUZ7byrlf2MUBnvLI2jxz2BRCtysxR/6Af/2UpwLUEs9bcjPj4ZC36P1tdUvgw2p3lLVGNG0RdkQoGEdwZ9k7AEFVZwJfPl77V+8EcQ== alex@soleares
2
03
=== added file 'Planet Stuff/css/bg-page.png'
1Binary files Planet Stuff/css/bg-page.png 1970-01-01 00:00:00 +0000 and Planet Stuff/css/bg-page.png 2014-09-01 04:44:23 +0000 differ4Binary files Planet Stuff/css/bg-page.png 1970-01-01 00:00:00 +0000 and Planet Stuff/css/bg-page.png 2014-09-01 04:44:23 +0000 differ
=== added file 'Planet Stuff/css/bullet-triangle.png'
2Binary files Planet Stuff/css/bullet-triangle.png 1970-01-01 00:00:00 +0000 and Planet Stuff/css/bullet-triangle.png 2014-09-01 04:44:23 +0000 differ5Binary files Planet Stuff/css/bullet-triangle.png 1970-01-01 00:00:00 +0000 and Planet Stuff/css/bullet-triangle.png 2014-09-01 04:44:23 +0000 differ
=== added file 'Planet Stuff/css/common.css'
--- Planet Stuff/css/common.css 1970-01-01 00:00:00 +0000
+++ Planet Stuff/css/common.css 2014-09-01 04:44:23 +0000
@@ -0,0 +1,367 @@
1/* common.css - MoinMoin Default Styles
2Copyright (c) 2001, 2002, 2003 by Juergen Hermann
3*/
4
5/* Links */
6
7a {
8 color: #D90D19;
9}
10
11a:hover {
12 color: #800000;
13}
14
15/* Headings */
16
17#pagelocation li {
18 display: inline;
19}
20
21#pagelocation {
22 margin: 0;
23 padding: 0;
24 color: #6d4c07; /* ubuntu dark brown */
25 font-size: 1.8em;
26 font-weight: bold;
27 line-height: 1.2em;
28 border-bottom: 3px solid #6d4c07; /* ubuntu dark brown */
29}
30
31#pagelocation a {
32 text-decoration: none;
33 color: #6d4c07; /* ubuntu dark brown */
34}
35
36h1, h2, h3, h4, h5, h6
37{
38 margin: 0;
39 /* AE: conflicts with bubbles padding: 2px 0;*/
40 font-weight: normal;
41 color: #5A3320;
42 line-height: 1.2em;
43}
44
45h1
46{
47 font-size: 1.6em;
48 border-bottom: 1px solid #6d4c07; /* ubuntu dark brown */
49}
50
51h2
52{
53 font-size: 1.3em;
54}
55
56h3 {font-size: 1.1em;}
57h4, h5, h6 {font-size: 1em;}
58
59li p {
60 margin: .25em 0;
61}
62
63li.gap {
64 margin-top: 0.5em;
65}
66
67/* from ubuntu_styles; sizes changed to em */
68dt
69{
70 margin-top: 1.2em;
71 margin-bottom: 0.3em;
72 font-size: 1.2em;
73 border-bottom: 1px solid #6D4C07;
74}
75
76dd {
77 margin-top: 0;
78 margin-bottom: 0;
79}
80
81dd p {
82 margin: 0.25em 0;
83}
84
85a, img, img.drawing {
86 border: 0;
87}
88
89pre
90{
91 border: 1px dashed #C1B496; /* ubuntu dark tan */
92 background-color: #f0eee6; /* ubuntu light salmon */
93 padding: 4pt;
94 font-family: courier, monospace;
95 white-space: pre;
96 /* begin css 3 or browser specific rules - do not remove!
97 see: http://forums.techguy.org/archive/index.php/t-249849.html */
98 white-space: pre-wrap;
99 word-wrap: break-word;
100 white-space: -moz-pre-wrap;
101 white-space: -pre-wrap;
102 white-space: -o-pre-wrap;
103 /* end css 3 or browser specific rules */
104}
105
106table
107{
108 margin: 0.5em 0;
109 border-collapse: collapse;
110}
111
112td
113{
114 padding: 0.25em;
115 border: 1pt solid #C1B496; /* ubuntu dark tan */
116}
117
118td p {
119 margin: 0;
120 padding: 0;
121}
122
123.footnotes div {
124 width: 5em;
125 border-top: 1pt solid #C1B496; /* ubuntu dark tan */
126}
127
128.footnotes ul {
129 padding: 0 2em;
130 margin: 0 0 1em;
131 list-style: none;
132}
133
134.footnotes li {
135}
136
137.info {
138 font-size: 0.85em;
139 color: #C1B496; /* ubuntu dark tan */
140}
141
142#pageinfo {
143 margin-top: 2em;
144}
145
146.seperator {
147 color: #C1B496; /* ubuntu dark tan */
148}
149
150#pagebottom {clear: both;}
151
152/* standard rule ---- */
153hr {
154 height: 1pt;
155 background-color: #C1B496; /* ubuntu dark tan */
156 border: 0;
157}
158
159/* custom rules ----- to ---------- */
160.hr1 {height: 2pt;}
161.hr2 {height: 3pt;}
162.hr3 {height: 4pt;}
163.hr4 {height: 5pt;}
164.hr5 {height: 6pt;}
165.hr6 {height: 7pt;}
166
167/* Replacement for html 3 u tag */
168.u {text-decoration: underline;}
169
170/* eye catchers */
171.warning
172{
173 color: red;
174}
175
176.error
177{
178 color: red;
179}
180
181strong.highlight
182{
183 background-color: #edddba; /* ubuntu pale orange */
184 padding: 1pt;
185}
186
187
188/* Recent changes */
189
190.rcrss {
191 float: right;
192 margin: 0;
193}
194
195.recentchanges[dir="rtl"] .rcrss {
196 float: left;
197}
198
199.recentchanges table {
200 clear: both;
201}
202
203.recentchanges td {
204 vertical-align: top;
205 border: none;
206 border-bottom: 1pt solid #C1B496; /* ubuntu dark tan */
207 background: white;
208}
209
210.rcdaybreak td {
211 background: #EDD097; /* classic: deep yellow */
212 border: none;
213}
214
215.rcdaybreak td a {
216 font-size: 0.88em;
217}
218
219.rcicon1, .rcicon2 {
220 text-align: center;
221}
222
223.rcpagelink {
224 width: 33%;
225}
226
227.rctime {
228 font-size: 0.88em;
229 white-space: nowrap;
230}
231
232.rceditor {
233 white-space: nowrap;
234 font-size: 0.88em;
235}
236
237.rccomment {
238 width: 66%;
239 color: #C1B496; /* ubuntu dark tan */
240 font-size: 0.88em;
241 font-weight: bold;
242}
243
244
245/* User Preferences */
246
247.userpref table, .userpref td {
248 border: none;
249}
250
251/* CSS for new code_area markup used by Colorizer and ParserBase */
252
253div.codearea { /* the div makes the border */
254 margin: 4pt 0;
255 padding: 0;
256 border: 1pt solid #C1B496; /* ubuntu dark tan */
257/* background-color: #F3F5F7; * light grey */
258 background-color: #edddba; /* ubuntu pale orange */
259 color: black;
260}
261
262div.codearea pre { /* the pre has no border and is inside the div */
263 margin: 0;
264 padding: 4pt;
265 border: none;
266}
267
268a.codenumbers { /* format of the line numbering link */
269 margin: 0 4pt;
270 font-size: 0.85em;
271 color: #6d4c07; /* ubuntu dark brown */
272}
273
274/* format of certain syntax spans */
275div.codearea pre span.LineNumber {color: gray;}
276div.codearea pre span.ID {color: #000000;}
277div.codearea pre span.Operator {color: #0000C0;}
278div.codearea pre span.Char {color: #004080;}
279div.codearea pre span.Comment {color: #008000;}
280div.codearea pre span.Number {color: #0080C0;}
281div.codearea pre span.String {color: #004080;}
282div.codearea pre span.SPChar {color: #0000C0;}
283div.codearea pre span.ResWord {color: #A00000;}
284div.codearea pre span.ConsWord {color: #008080; font-weight: bold;}
285div.codearea pre span.Error {color: #FF8080; border: solid 1.5pt #FF0000;}
286div.codearea pre span.ResWord2 {color: #0080ff; font-weight: bold;}
287div.codearea pre span.Special {color: #0000ff;}
288div.codearea pre span.Preprc {color: #803999;}
289
290
291/* Search results */
292
293.searchresults dt {
294 margin-top: 1em;
295 font-weight: normal;
296}
297
298.searchresults dd {
299 font-size: 0.85em;
300}
301
302/* MonthCalendar css */
303
304/* days without and with pages linked to them */
305a.cal-emptyday {
306 color: #777777;
307 text-align: center;
308}
309a.cal-usedday {
310 color: #000000;
311 font-weight: bold;
312 text-align: center;
313}
314/* general stuff: workdays, weekend, today */
315td.cal-workday {
316 background-color: #F1F1ED; /* ubuntu near-white */
317 text-align: center;
318}
319td.cal-weekend {
320 background-color: #edddba; /* ubuntu pale orange */
321 text-align: center;
322}
323td.cal-today {
324 background-color: #DBBA75; /* ubuntu orange */
325 border-style: solid;
326 border-width: 2pt;
327 text-align: center;
328}
329/* invalid places on the monthly calendar sheet */
330td.cal-invalidday {
331 background-color: #CCCCCC;
332}
333/* links to prev/next month/year */
334a.cal-link {
335 color: #F1F1ED; /* ubuntu near-white */
336 text-decoration: none;
337}
338th.cal-header {
339 background-color: #6d4c07; /* ubuntu dark brown */
340 color: white;
341 text-align: center;
342}
343
344/* for MonthCalendar mouseover info boxes */
345TABLE.tip {
346 color: black;
347 border: 1px solid #C1B496; /* ubuntu dark tan */
348 background-color: #f0eee6; /* ubuntu light salmon */
349 font-size: small;
350 font-weight: normal;
351}
352
353TH.tip {
354 background-color: #DBBA75; /* ubuntu orange */
355 font-weight: bold;
356 text-align: center;
357}
358
359TD.tip {
360 text-align: left;
361}
362*[dir="rtl"] TD.tip {
363 text-align: right;
364}
365
366/* end MonthCalendar stuff */
367
0368
=== added file 'Planet Stuff/css/screen.css'
--- Planet Stuff/css/screen.css 1970-01-01 00:00:00 +0000
+++ Planet Stuff/css/screen.css 2014-09-01 04:44:23 +0000
@@ -0,0 +1,434 @@
1/* screen.css - MoinMoin Default Styles
2
3Copyright (c) 2001, 2002, 2003 by Juergen Hermann
4Modified by Nir Soffer (technical theme), Mauricio Hernandez (ruleta theme)
5Heather Stern (ubuntu theme), Alex Eftimie (planet ubuntu theme)
6*/
7
8body {
9 background: #d3caaa url(bg-page.png) repeat-x top;
10 margin: 20px;
11 font-size: 90%;
12 font-family: Arial, Verdana, Arial, sans-serif;
13}
14
15img.ubuntulogo {
The diff has been truncated for viewing.