template.tex 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. \documentclass[$layout$]{elsarticle} %review=doublespace preprint=single 5p=2 column
  2. %%% Begin My package additions %%%%%%%%%%%%%%%%%%%
  3. \usepackage[hyphens]{url}
  4. $if(journal)$
  5. \journal{$journal$} % Sets Journal name
  6. $endif$
  7. \usepackage{lineno} % add
  8. $if(linenumbers)$
  9. \linenumbers % turns line numbering on
  10. $endif$
  11. \providecommand{\tightlist}{%
  12. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  13. \bibliographystyle{elsarticle-harv}
  14. \biboptions{sort&compress} % For natbib
  15. \usepackage{graphicx}
  16. \usepackage{booktabs} % book-quality tables
  17. %%%%%%%%%%%%%%%% end my additions to header
  18. \usepackage[T1]{fontenc}
  19. \usepackage{lmodern}
  20. \usepackage{amssymb,amsmath}
  21. \usepackage{ifxetex,ifluatex}
  22. \usepackage{fixltx2e} % provides \textsubscript
  23. % use upquote if available, for straight quotes in verbatim environments
  24. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  25. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  26. \usepackage[utf8]{inputenc}
  27. $if(euro)$
  28. \usepackage{eurosym}
  29. $endif$
  30. \else % if luatex or xelatex
  31. \usepackage{fontspec}
  32. \ifxetex
  33. \usepackage{xltxtra,xunicode}
  34. \fi
  35. \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  36. \newcommand{\euro}{€}
  37. $if(mainfont)$
  38. \setmainfont{$mainfont$}
  39. $endif$
  40. $if(sansfont)$
  41. \setsansfont{$sansfont$}
  42. $endif$
  43. $if(monofont)$
  44. \setmonofont{$monofont$}
  45. $endif$
  46. $if(mathfont)$
  47. \setmathfont{$mathfont$}
  48. $endif$
  49. \fi
  50. % use microtype if available
  51. \IfFileExists{microtype.sty}{\usepackage{microtype}}{}
  52. $if(geometry)$
  53. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  54. $endif$
  55. $if(natbib)$
  56. \usepackage{natbib}
  57. \bibliographystyle{plainnat}
  58. $endif$
  59. $if(biblatex)$
  60. \usepackage{biblatex}
  61. $if(biblio-files)$
  62. \bibliography{$biblio-files$}
  63. $endif$
  64. $endif$
  65. $if(listings)$
  66. \usepackage{listings}
  67. $endif$
  68. $if(lhs)$
  69. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  70. $endif$
  71. $if(highlighting-macros)$
  72. $highlighting-macros$
  73. $endif$
  74. $if(verbatim-in-note)$
  75. \usepackage{fancyvrb}
  76. $endif$
  77. $if(tables)$
  78. \usepackage{longtable}
  79. $endif$
  80. $if(graphics)$
  81. \usepackage{graphicx}
  82. % We will generate all images so they have a width \maxwidth. This means
  83. % that they will get their normal width if they fit onto the page, but
  84. % are scaled down if they would overflow the margins.
  85. \makeatletter
  86. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
  87. \else\Gin@nat@width\fi}
  88. \makeatother
  89. \let\Oldincludegraphics\includegraphics
  90. \renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
  91. $endif$
  92. \ifxetex
  93. \usepackage[setpagesize=false, % page size defined by xetex
  94. unicode=false, % unicode breaks when used with xetex
  95. xetex]{hyperref}
  96. \else
  97. \usepackage[unicode=true]{hyperref}
  98. \fi
  99. \hypersetup{breaklinks=true,
  100. bookmarks=true,
  101. pdfauthor={$author-meta$},
  102. pdftitle={$title-meta$},
  103. colorlinks=$if(colorlinks)$true$else$false$endif$,
  104. urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
  105. linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
  106. pdfborder={0 0 0}}
  107. \urlstyle{same} % don't use monospace font for urls
  108. $if(links-as-notes)$
  109. % Make links footnotes instead of hotlinks:
  110. \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
  111. $endif$
  112. $if(strikeout)$
  113. \usepackage[normalem]{ulem}
  114. % avoid problems with \sout in headers with hyperref:
  115. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  116. $endif$
  117. $if(numbersections)$
  118. \setcounter{secnumdepth}{5}
  119. $else$
  120. \setcounter{secnumdepth}{0}
  121. $endif$
  122. $if(verbatim-in-note)$
  123. \VerbatimFootnotes % allows verbatim text in footnotes
  124. $endif$
  125. $if(lang)$
  126. \ifxetex
  127. \usepackage{polyglossia}
  128. \setmainlanguage{$mainlang$}
  129. \else
  130. \usepackage[$lang$]{babel}
  131. \fi
  132. $endif$
  133. % Pandoc toggle for numbering sections (defaults to be off)
  134. $if(numbersections)$
  135. $else$
  136. \setcounter{secnumdepth}{0}
  137. $endif$
  138. % Pandoc header
  139. $for(header-includes)$
  140. $header-includes$
  141. $endfor$
  142. $preamble$
  143. \begin{document}
  144. \begin{frontmatter}
  145. \title{$title$}
  146. $for(author)$
  147. \author[$author.affiliation$]{$author.name$$if(author.footnote)$\corref{c1}$endif$}
  148. $if(author.email)$ \ead{$author.email$} $endif$
  149. $if(author.footnote)$ \cortext[c1]{$author.footnote$}$endif$
  150. $endfor$
  151. $for(address)$
  152. \address[$address.code$]{$address.address$}
  153. $endfor$
  154. \begin{abstract}
  155. $abstract$
  156. \end{abstract}
  157. $if(keywords)$ \begin{keyword} $for(keywords)$$keywords$$sep$ $endfor$\end{keyword}$endif$
  158. \end{frontmatter}
  159. $body$
  160. $if(natbib)$
  161. $if(biblio-files)$
  162. $if(biblio-title)$
  163. $if(book-class)$
  164. \renewcommand\bibname{$biblio-title$}
  165. $else$
  166. \renewcommand\refname{$biblio-title$}
  167. $endif$
  168. $endif$
  169. \bibliography{$biblio-files$}
  170. $endif$
  171. $endif$
  172. $if(biblatex)$
  173. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  174. $endif$
  175. $for(include-after)$
  176. $include-after$
  177. $endfor$
  178. \end{document}