forked from mfouesneau/arxiv_on_deck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.tpl
210 lines (184 loc) · 6.26 KB
/
default.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
% Template class ---------------------------------------------
\documentclass[a4paper]{article}
% packages ---------------------------------------------------
% Many of these packages are only for compatibility with
% common articles and their macros
\usepackage[utf8]{inputenc}
% \usepackage[a4paper,margin=.5cm, landscape]{geometry}
\usepackage[a4paper,margin=.5cm]{geometry}
\usepackage[english]{babel}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{txfonts}
\usepackage{xcolor}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{amssymb}
\usepackage{textgreek}
\usepackage[nolist,nohyperlinks,printonlyused]{acronym}
\usepackage[breaklinks,colorlinks,citecolor=blue,unicode]{hyperref}
\usepackage{siunitx}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{xparse}
\usepackage{xspace}
% Internal macros --------------------------------------------------------------
% convert files on the fly to pdflatex compilation
% requires `-enable-write18 -shell-escape`' compilation options
\DeclareGraphicsExtensions{.jpg, .ps, .eps, .png, .pdf}
% \DeclareGraphicsRule{.ps}{pdf}{.pdf}{`convert -trim +repage #1 pdf:`dirname #1`/`basename #1 .ps`-ps-converted-to.pdf}
% \DeclareGraphicsRule{.eps}{pdf}{.pdf}{`convert -trim +repage #1 pdf:`dirname #1`/`basename #1 .eps`-eps-converted-to.pdf}
% \DeclareGraphicsRule{.pdf}{pdf}{.pdf}{`convert -trim +repage #1 pdf:`dirname #1`/`basename #1 .pdf`-pdf-converted-to.pdf}
% \DeclareGraphicsRule{.png}{pdf}{.pdf}{`convert -trim +repage #1 pdf:`dirname #1`/`basename #1 .png`-png-converted-to.pdf}
% slightly better quality than above
\DeclareGraphicsRule{.ps}{pdf}{.pdf}{`epstopdf #1 -o `dirname #1`/`basename #1 .ps`-ps-converted-to.pdf}
\DeclareGraphicsRule{.eps}{pdf}{.pdf}{`epstopdf #1 -o `dirname #1`/`basename #1 .eps`-eps-converted-to.pdf}
% highlight in yellow some text (e.g., authors)
\newcommand\hl[1]{\colorbox{yellow}{#1}}
% makes abstract macro
\renewcommand{\abstract}[1]{%
\textbf{\hl{<IDENTIFIER>} } #1
}
% Inhibit most of article macros
\renewcommand{\thanks}[1]{}
\renewcommand{\caption}[1]{{\raggedright\scriptsize{#1}}}
\providecommand{\acronymused}[1]{}
\providecommand{\altaffilmark}[1]{}
\providecommand{\keywords}{}
% Layout definition --------------------------------------------------------
% sets some dimensions
\newlength\Widthtempl% width for 1,2,3,4
\newlength\Highttempl% height for 1
\newlength\gap% separation between boxes
\setlength\gap{4pt}
\setlength\Widthtempl{\dimexpr0.5\textwidth-0.75\gap\relax}
\setlength\Highttempl{.67\textheight}
\parindent0pt
\fboxsep0pt
\fboxrule0pt
% Will be used to store the first figure properties
\newsavebox\boxFigOne
% debugging macros
% \renewcommand{\frame}{} % using lines around frames for layout debugging
\renewcommand{\frame}[1]{\colorbox{white}{#1}} % using lines around frames for layout debugging
%Document found macros ------------------------------------------------------
<MACROS>
% ----------------------------------------------------------------------------------
\begin{document}
% ----------------------------------------------------------------------------------
\thispagestyle{plain}
% title
\textbf{\LARGE{<TITLE>}}
\vspace{1em}
% Authors
\textbf{\large{<AUTHORS>}}
\hl{<DATE>} -- <COMMENTS>
\vspace{1em}
% Abstract
\frame{
\begin{minipage}[t][0.25\Highttempl][t]{2\Widthtempl}%
\abstract{
<ABSTRACT>
}
\end{minipage}
}
% defined automatically
\def\figone{<FIGURE_ONE>}
\def\capone{<CAPTION_ONE>}
\def\figtwo{<FIGURE_TWO>}
\def\captwo{<CAPTION_TWO>}
\def\figthree{<FIGURE_THREE>}
\def\capthree{<CAPTION_THREE>}
% Figure layout decision --------------------------------------------------------
% check figure 1 aspect and adopt the following layouts
% landscape generates
%
% -----------
% | |
% -----------
% | | |
% -----------
%
% portrait will generate
% -----------
% | | |
% | |----|
% | | |
% -----------
% store the figure into a box to retrieve properties
\savebox{\boxFigOne}{<FILE_FIGURE_ONE>}
% For DEBUGGING \pgfmathsetmacro{\ratio}{\the\ht\boxFigOne/\the\wd\boxFigOne}
% \pgfmathsetmacro{\ratio}{\the\wd\boxFigOne/\the\ht\boxFigOne}
% \pgfmathparse{\ratio > 1?int(1):int(0)}
% Ratio: \ratio
\pgfmathparse{\the\wd\boxFigOne/\the\ht\boxFigOne > 1.2 ? int(1):int(0)}
% test orientation
\ifnum\pgfmathresult=1\relax%
% ------------------------------------------------------------------ {landscape}
\def\maxheight{0.25\paperheight}
\def\maxwidth{\textwidth}
\frame{%
\begin{minipage}[t][0.5\Highttempl][t]{2\Widthtempl}%
\vspace*{\fill}
{\begin{center}\figone\end{center}} % put contents here
\capone
\vspace*{\fill} \
\end{minipage}}%
\par
\fbox{%
\begin{minipage}[t][0.49\Highttempl][t]{2\Widthtempl+\gap}
\frame{\ %
\begin{minipage}[t][0.5\Highttempl][t]{\Widthtempl-\gap}
\vspace*{\fill}
{\begin{center}\figtwo\end{center}}
\captwo
\vspace*{\fill} \
\end{minipage}}
\frame{\ %
\begin{minipage}[t][0.5\Highttempl][t]{\Widthtempl-\gap}
\vspace*{\fill}
{\begin{center}\figthree\end{center}}
\capthree
\vspace*{\fill}
\end{minipage}}
\end{minipage}}
\else
% ------------------------------------------------------------------ {portrait}
\def\maxheight{0.4\paperheight}
\def\maxwidth{\textwidth}
\frame{%
\begin{minipage}[b][1\Highttempl][t]{1\Widthtempl}%
\vspace*{\fill}
{\begin{center}\figone\end{center}} % put contents here
\capone
\vspace*{\fill} \
\end{minipage}}%
\fbox{%
\def\maxheight{0.3\paperheight}
\begin{minipage}[b][1\Highttempl][t]{\Widthtempl+1\gap}
\frame{\ %
\begin{minipage}[t][0.5\Highttempl][t]{\Widthtempl}
\vspace*{\fill}
{\begin{center}\figtwo\end{center}}
\captwo
\vspace*{\fill} \
\end{minipage}}
\frame{\ %
\begin{minipage}[t][0.5\Highttempl][t]{\Widthtempl}
\vspace*{\fill}
{\begin{center}\figthree\end{center}}
\capthree
\vspace*{\fill} \
\end{minipage}}
\end{minipage}}
\fi
% add bottom text -------------------------------------------------------------------
% \frame{
% \begin{minipage}[b][0.05\Highttempl][b]{2\Widthtempl}
% \hl{<DATE>} -- <COMMENTS>
% \end{minipage}
% }
\end{document}
% -------------------------------------------------------------------------------------