Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

532 lines
13KB

  1. \PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
  2. \PassOptionsToPackage{hyphens}{url}
  3. $if(colorlinks)$
  4. \PassOptionsToPackage{usenames,dvipsnames}{color}
  5. $endif$
  6. %
  7. \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
  8. $if(beamerarticle)$
  9. \usepackage{beamerarticle} % needs to be loaded first
  10. $endif$
  11. $if(fontfamily)$
  12. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  13. $else$
  14. \usepackage{lmodern}
  15. $endif$
  16. $if(linestretch)$
  17. \usepackage{setspace}
  18. \setstretch{$linestretch$}
  19. $endif$
  20. \usepackage{amssymb,amsmath}
  21. \usepackage{ifxetex,ifluatex}
  22. \usepackage{fixltx2e} % provides \textsubscript
  23. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  24. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  25. \usepackage[utf8]{inputenc}
  26. $if(euro)$
  27. \usepackage{eurosym}
  28. $endif$
  29. \else % if luatex or xelatex
  30. $if(mathspec)$
  31. \ifxetex
  32. \usepackage{mathspec}
  33. \else
  34. \usepackage{unicode-math}
  35. \fi
  36. $else$
  37. \usepackage{unicode-math}
  38. $endif$
  39. \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
  40. $for(fontfamilies)$
  41. \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
  42. $endfor$
  43. $if(euro)$
  44. \newcommand{\euro}{€}
  45. $endif$
  46. $if(mainfont)$
  47. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  48. $else$
  49. \setmainfont{LinLibertineO}
  50. $endif$
  51. $if(sansfont)$
  52. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  53. $else$
  54. \setsansfont{Carlito}
  55. $endif$
  56. $if(monofont)$
  57. \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
  58. $else$
  59. \setmonofont[Mapping=tex-ansi]{DejaVuSansMono}
  60. $endif$
  61. $if(mathfont)$
  62. $if(mathspec)$
  63. \ifxetex
  64. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  65. \else
  66. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  67. \fi
  68. $else$
  69. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  70. $endif$
  71. $endif$
  72. $if(CJKmainfont)$
  73. \ifxetex
  74. \usepackage{xeCJK}
  75. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  76. \fi
  77. $endif$
  78. $if(luatexjapresetoptions)$
  79. \ifluatex
  80. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  81. \fi
  82. $endif$
  83. $if(CJKmainfont)$
  84. \ifluatex
  85. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  86. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  87. \fi
  88. $endif$
  89. \fi
  90. % use upquote if available, for straight quotes in verbatim environments
  91. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  92. % use microtype if available
  93. \IfFileExists{microtype.sty}{%
  94. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  95. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  96. }{}
  97. $if(indent)$
  98. $else$
  99. % \IfFileExists{parskip.sty}{%
  100. % \usepackage{parskip}
  101. % }{% else
  102. % \setlength{\parindent}{0pt}
  103. % \setlength{\parskip}{6pt plus 2pt minus 1pt}
  104. % }
  105. $endif$
  106. $if(verbatim-in-note)$
  107. \usepackage{fancyvrb}
  108. $endif$
  109. \usepackage{hyperref}
  110. \hypersetup{
  111. $if(title-meta)$
  112. pdftitle={$title-meta$},
  113. $endif$
  114. $if(author-meta)$
  115. pdfauthor={$author-meta$},
  116. $endif$
  117. $if(keywords)$
  118. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  119. $endif$
  120. $if(colorlinks)$
  121. colorlinks=true,
  122. linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
  123. citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
  124. urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
  125. $else$
  126. pdfborder={0 0 0},
  127. $endif$
  128. breaklinks=true}
  129. \urlstyle{tt}
  130. $if(verbatim-in-note)$
  131. \VerbatimFootnotes % allows verbatim text in footnotes
  132. $endif$
  133. $if(geometry)$
  134. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  135. $else$
  136. \usepackage{geometry}
  137. \geometry{paper=a4paper, left=2.5cm, right=2cm, bottom=3.5cm, foot=2cm, top=3.5cm, head=2cm}
  138. $endif$
  139. $if(lang)$
  140. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  141. \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  142. $if(babel-newcommands)$
  143. $babel-newcommands$
  144. $endif$
  145. \else
  146. % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
  147. \usepackage{polyglossia}
  148. \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
  149. $for(polyglossia-otherlangs)$
  150. \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
  151. $endfor$
  152. \fi
  153. $endif$
  154. $if(natbib)$
  155. \usepackage[$natbiboptions$]{natbib}
  156. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  157. $endif$
  158. $if(biblatex)$
  159. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  160. $for(bibliography)$
  161. \addbibresource{$bibliography$}
  162. $endfor$
  163. $endif$
  164. $if(listings)$
  165. \usepackage{listings}
  166. \usepackage[dvipsnames]{xcolor}
  167. \input{syntax.tex}
  168. \newcommand{\passthrough}[1]{\texttt{#1}}
  169. $endif$
  170. $if(lhs)$
  171. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  172. $endif$
  173. $if(highlighting-macros)$
  174. $highlighting-macros$
  175. $endif$
  176. $if(tables)$
  177. \usepackage{longtable,booktabs}
  178. % Fix footnotes in tables (requires footnote package)
  179. \IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
  180. $endif$
  181. \usepackage{graphicx,grffile}
  182. \makeatletter
  183. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  184. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  185. \makeatother
  186. % Scale images if necessary, so that they will not overflow the page
  187. % margins by default, and it is still possible to overwrite the defaults
  188. % using explicit options in \includegraphics[width, height, ...]{}
  189. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  190. % headers y footers a medida
  191. \usepackage{lastpage}
  192. \usepackage{fancyhdr}
  193. \pagestyle{fancy}
  194. \fancyhf{} % clear all header and footer fields
  195. $if(docnumber)$
  196. \lhead{$docnumber$}
  197. $endif$
  198. \lfoot{\scriptsize{$if(date)$ $date$ $endif$ / $if(hash)$ \texttt{$hash$} $endif$}}
  199. \rfoot{\thepage/\pageref{LastPage}}
  200. \rhead{\includegraphics[height=10pt]{logo}}
  201. \renewcommand{\headrulewidth}{0.0pt}
  202. \renewcommand{\footrulewidth}{0.4pt}
  203. \fancypagestyle{plain}{%
  204. \fancyhf{} % clear all header and footer fields
  205. $if(hash)$
  206. % \lhead{\scriptsize{\texttt{$hash$}}}
  207. \rfoot{\scriptsize{\texttt{$hash$}}}
  208. $endif$
  209. \renewcommand{\headrulewidth}{0pt}
  210. \renewcommand{\footrulewidth}{0pt}}
  211. $if(links-as-notes)$
  212. % Make links footnotes instead of hotlinks:
  213. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  214. $endif$
  215. $if(strikeout)$
  216. \usepackage[normalem]{ulem}
  217. % avoid problems with \sout in headers with hyperref:
  218. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  219. $endif$
  220. \setlength{\emergencystretch}{3em} % prevent overfull lines
  221. \providecommand{\tightlist}{%
  222. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  223. $if(numbersections)$
  224. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  225. $else$
  226. \setcounter{secnumdepth}{0}
  227. $endif$
  228. $if(subparagraph)$
  229. $else$
  230. % Redefines (sub)paragraphs to behave more like sections
  231. \ifx\paragraph\undefined\else
  232. \let\oldparagraph\paragraph
  233. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  234. \fi
  235. \ifx\subparagraph\undefined\else
  236. \let\oldsubparagraph\subparagraph
  237. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  238. \fi
  239. $endif$
  240. $if(dir)$
  241. \ifxetex
  242. % load bidi as late as possible as it modifies e.g. graphicx
  243. $if(latex-dir-rtl)$
  244. \usepackage[RTLdocument]{bidi}
  245. $else$
  246. \usepackage{bidi}
  247. $endif$
  248. \fi
  249. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  250. \TeXXeTstate=1
  251. \newcommand{\RL}[1]{\beginR #1\endR}
  252. \newcommand{\LR}[1]{\beginL #1\endL}
  253. \newenvironment{RTL}{\beginR}{\endR}
  254. \newenvironment{LTR}{\beginL}{\endL}
  255. \fi
  256. $endif$
  257. \usepackage{subfig}
  258. % SIunits
  259. \usepackage{siunitx}
  260. % set default figure placement to htbp
  261. \makeatletter
  262. \def\fps@figure{htbp}
  263. \pretocmd\env@cases{\def\@rowc@lors{}}{}{}
  264. \pretocmd\start@align{\def\@rowc@lors{}}{}{}
  265. \makeatother
  266. % fuente para los captions de figuras
  267. \usepackage{caption}
  268. \renewcommand{\captionfont}{\sf\small}
  269. % \renewcommand{\captionlabelfont}{\bf\sf}
  270. %% cover
  271. \makeatletter
  272. \newcommand{\fielddesc}[1]{\textsf{\footnotesize{#1}}}
  273. \newlength{\coff}
  274. \setlength{\coff}{0.3cm plus 0.1cm minus 0.1cm}
  275. \def\maketitle{%
  276. \thispagestyle{empty}
  277. % TODO: elegir si se quiere background
  278. % put a cover-back.pdf as a background
  279. % \AddToShipoutPicture*{\put(0,0){\includegraphics{cover-back}}}
  280. $if(logo2ver)$
  281. \begin{minipage}[b]{0.5\linewidth}
  282. \includegraphics[width=$logo2ver_width$]{$logo2ver$}
  283. \end{minipage}%
  284. \begin{minipage}[b]{$if(logo2ver)$0.45$else$0.9$endif$\linewidth}
  285. \raggedleft\includegraphics[width=$logo1ver_width$]{$logo1ver$}
  286. \end{minipage}
  287. \noindent{\color{gray}\rule{\linewidth}{1.2pt}}
  288. $endif$
  289. % --- title -------------------------------------------------------
  290. \null
  291. \vspace{1cm plus 0.5cm minus 0.5cm}
  292. \begin{center}
  293. \begin{minipage}{0.75\linewidth}
  294. \begin{center}
  295. \Large{\textbf{$title$}}
  296. \bigskip
  297. $if(subtitle)$\large{$subtitle$}$endif$
  298. \end{center}
  299. \end{minipage}
  300. \end{center}
  301. % --- authors & meta -------------------------------------------------------
  302. \vspace{\stretch{0.5}}
  303. \begin{minipage}[t]{0.4\linewidth}
  304. \begin{tabular}{ll}
  305. \fielddesc{Number} & \fielddesc{Rev.} \\
  306. \hspace{\coff}\textsf{$docnumber$} & \hspace{\coff}\textsf{$rev$} \\
  307. \fielddesc{Date} & \fielddesc{Hash} \\
  308. \hspace{\coff}$date$ & \hspace{\coff}\texttt{$hash$} \\
  309. $if(doctype)$
  310. \fielddesc{Type} & \fielddesc{Pages} \\
  311. \hspace{\coff}doctype & \hspace{\coff}\pageref{LastPage} \\
  312. $endif$
  313. \end{tabular}
  314. \end{minipage}%
  315. %
  316. \begin{minipage}[t]{0.6\linewidth}
  317. \begin{tabular}{ll}
  318. \fielddesc{Author} & \\
  319. $if(firstauthor)$
  320. \hspace{\coff}firstauthor & $if(firstauthoremail)$\hspace{\coff}\small{\texttt{$firstauthoremail$}}$endif$ \\
  321. $else$
  322. \hspace{\coff}$author-meta$ & $if(authoremail)$ \hspace{\coff}\small{\texttt{$authoremail$}}$endif$ \\
  323. $endif$
  324. $if(secondauthor)$
  325. \hspace{\coff}$secondauthor$ & $if(secondauthoremail)$\hspace{\coff}\small{\texttt{$secondauthoremail$}}$endif$ \\
  326. $endif$
  327. $if(reviewer)$
  328. \fielddesc{Reviewed by} & \\
  329. \hspace{\coff}$reviewer$ & $if(revieweremail)$\hspace{\coff}\small{\texttt{$revieweremail$}}$endif$ \\
  330. $endif$
  331. $if(releaser)$
  332. \fielddesc{Released by} & \\
  333. \hspace{\coff}$releaser$ & $if(releaseremail)$\hspace{\coff}\small{\texttt{$releaseremail$}}$endif$ \\
  334. $endif$
  335. \end{tabular}
  336. \end{minipage}
  337. % --- client & project -------------------------------------------------------
  338. \vspace{\stretch{0.25}}
  339. $if(client)$
  340. \begin{minipage}[t]{0.5\linewidth}
  341. \begin{tabular}{l}
  342. \fielddesc{Client} \\
  343. \hspace{\coff}client
  344. \end{tabular}
  345. \end{minipage}
  346. $endif$
  347. %
  348. $if(project)$
  349. \begin{minipage}[t]{0.5\linewidth}
  350. \begin{tabular}{l}
  351. \fielddesc{Project} \\
  352. \hspace{\coff}project
  353. \end{tabular}
  354. \end{minipage}
  355. $endif$
  356. % --- abstract -------------------------------------------------------
  357. $if(abstract)$
  358. \vspace{\stretch{1.0}}
  359. \begin{abstract}
  360. \noindent
  361. $abstract$
  362. \end{abstract}
  363. $endif$
  364. % --- keywords -------------------------------------------------------
  365. $if(keywords)$
  366. \vspace{\stretch{1.5}}
  367. \begin{center}
  368. \begin{minipage}{0.95\linewidth}
  369. \fielddesc{Keywords} \\
  370. \hspace{\coff}$keywords$
  371. \end{minipage}
  372. \end{center}
  373. $endif$
  374. % --- dist -------------------------------------------------------
  375. $if(distribution_list)$
  376. \vspace{\stretch{0.5}}
  377. \noindent\begin{minipage}[t]{0.5\linewidth}
  378. \fielddesc{Distribution}\vspace{-0.5cm} \\
  379. \begin{sffamily}
  380. $distribution_list$
  381. \end{sffamily}
  382. \end{minipage}%
  383. $endif$%
  384. %
  385. $if(cc_list)$%
  386. \begin{minipage}[t]{0.5\linewidth}
  387. \fielddesc{Carbon Copy}\vspace{-0.5cm} \\
  388. \begin{sffamily}
  389. $cc_list$
  390. \end{sffamily}
  391. \end{minipage}
  392. $endif$
  393. \null
  394. \pagebreak
  395. }
  396. \def\revhistory{%
  397. \section*{\bibcpstring{revhistory}}
  398. \noindent
  399. \rowcolors{1}{black!10}{black!0}
  400. \begin{tabularx}{\linewidth}{cllX}
  401. \hline
  402. \multicolumn{1}{c}{\bibcpstring{rev}} &
  403. \multicolumn{1}{c}{\bibcpstring{date}} &
  404. \multicolumn{1}{c}{\bibcpsstring{author}} &
  405. \multicolumn{1}{c}{} \\
  406. \hline
  407. \@@input revhistory.tex
  408. \hline
  409. \end{tabularx}
  410. }
  411. \makeatother
  412. %%
  413. $for(header-includes)$
  414. $header-includes$
  415. $endfor$
  416. $if(title)$
  417. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  418. $endif$
  419. $if(subtitle)$
  420. \providecommand{\subtitle}[1]{}
  421. \subtitle{$subtitle$}
  422. $endif$
  423. $if(author)$
  424. \author{$for(author)$$author$$sep$ \and $endfor$}
  425. $endif$
  426. $if(institute)$
  427. \providecommand{\institute}[1]{}
  428. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  429. $endif$
  430. \date{$date$}
  431. \begin{document}
  432. % \thispagestyle{empty}
  433. % \thispagestyle{plain}
  434. $if(title)$
  435. \maketitle
  436. $endif$
  437. $for(include-before)$
  438. $include-before$
  439. $endfor$
  440. $if(toc)$
  441. {
  442. $if(colorlinks)$
  443. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
  444. $endif$
  445. \setcounter{tocdepth}{$toc-depth$}
  446. \tableofcontents
  447. \pagebreak
  448. }
  449. $endif$
  450. $if(lot)$
  451. \listoftables
  452. \pagebreak
  453. $endif$
  454. $if(lof)$
  455. \listoffigures
  456. \pagebreak
  457. $endif$
  458. % vectors done right
  459. \renewcommand{\vec}[1]{\ensuremath\mathbf{#1}}
  460. $body$
  461. $if(natbib)$
  462. $if(bibliography)$
  463. $if(biblio-title)$
  464. $if(book-class)$
  465. \renewcommand\bibname{$biblio-title$}
  466. $else$
  467. \renewcommand\refname{$biblio-title$}
  468. $endif$
  469. $endif$
  470. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  471. $endif$
  472. $endif$
  473. $if(biblatex)$
  474. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  475. $endif$
  476. $for(include-after)$
  477. $include-after$
  478. $endfor$
  479. \end{document}