1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
# -*- mode: org; eval: (visual-line-mode); -*- #
#+begin_abstract
This document is a configuration file for Emacs [[https://orgmode.org/][Org mode]]. It describes
how to export Org mode documents to PDFs that look visually similar to
the Safran document templates. The configuration described in this
document applies to this document itself; you can find the PDF version
of this file in the same folder, or export this very file to PDF from
within Emacs by using ~C-p~ (Control key + p) if using my /Smart
Documents/ distribution.
#+end_abstract
* \huge Safran Document Template
:PROPERTIES:
:UNNUMBERED: t
:END:
#+ATTR_LATEX: :center nil
| =From= | Marius Peter |
| =To= | Safran |
| =Date= | <2021-06-22 Tue> |
| =Subject= | Safran template for Emacs Org mode |
#+LATEX: \tableofcontents
* Usage
Towards the beginning of your Org mode file, simply add
: #+SETUPFILE: "L:/org/templates/Safran-doc.setup"
which will call this very file's instructions. The remainder of the
document can be as plain as you wish.
* The template
This template provides:
1. Fonts
2. Header
1. Safran logo
2. Document metadata
3. Footer
1. Page numbering
2. ``Proprietary and Confidential'' notice
And not much else. You must either design your own title page, or copy
the following elegant example for a minimalistic title section at the
top of your exported PDF. The macros contained in triple curly braces
are a convenient way to render your =#+TITLE=, =#+AUTHOR=, =#+DATE=,
and other document properties you will have previously defined.
: * \huge {{{TITLE}}}
: :PROPERTIES:
: :UNNUMBERED: t
: :END:
:
: #+ATTR_LATEX: :center nil
: | =From= | {{{AUTHOR}}} |
: | =To= | Your recipient |
: | =Date= | {{{DATE}}} |
: | =Subject= | Description of the document subject |
:
: #+LATEX: \tableofcontents
** Options
#+OPTIONS: tags:nil toc:nil title:nil p:t
: #+OPTIONS: tags:nil toc:nil title:nil p:t
** Macros
# +MACRO: test (eval (concat "This is a " $1 " that illustrates " $2))
: # +MACRO: test (eval (concat "This is a " $1 " that illustrates " $2))
** LaTeX
LaTeX is the premier free document preparation system.
*** Document class
We choose the article class. It is generic, nice and simple.
#+LATEX_CLASS: article
: #+LATEX_CLASS: article
*** Geometry
Thanks to the geometry package, we can set the margin widths on all
sides.
#+LATEX_HEADER: \usepackage[
#+LATEX_HEADER: left = 1.5in ,
#+LATEX_HEADER: right = 1.5in ,
#+LATEX_HEADER: top = 1in ,
#+LATEX_HEADER: bottom = 2.4in ,]{geometry}
: #+LATEX_HEADER: \usepackage[
: #+LATEX_HEADER: left = 1.5in ,
: #+LATEX_HEADER: right = 1.5in ,
: #+LATEX_HEADER: top = 1in ,
: #+LATEX_HEADER: bottom = 2.4in ,]{geometry}
*** Fonts
The ~fontspec~ package exposes convenient commands for font selection
when using LuaTeX.
#+LATEX_HEADER: \usepackage{fontspec}
: #+LATEX_HEADER: \usepackage{fontspec}
**** Regular
Carlito is the open source alternative to Calibri on MS Windows. It
makes for a great ``friendly'' font. Public Sans, on the other hand,
has much sharper contours and is more ``serious''. Public Sans is a
more balanced alternative to Arial.
Public Sans relative x-height is *0.517*. By setting the Public Sans
~Scale~ to *0.872*, we ensure that the absolute Public Sans x-height
matches the absolute Courier Prime x-height. This results in both
fonts appearing of pleasingly similar size.
#+LATEX_HEADER: \setmainfont{publicsans}[
#+LATEX_HEADER: Path = L:/org/fonts/ ,
#+LATEX_HEADER: Scale = 0.872 ,
#+LATEX_HEADER: Extension = .ttf ,
#+LATEX_HEADER: UprightFont = *-regular ,
#+LATEX_HEADER: BoldFont = *-bold ,
#+LATEX_HEADER: ItalicFont = *-italic ,
#+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
: #+LATEX_HEADER: \setmainfont{publicsans}[
: #+LATEX_HEADER: Path = L:/org/fonts/ ,
: #+LATEX_HEADER: Scale = 0.872 ,
: #+LATEX_HEADER: Extension = .ttf ,
: #+LATEX_HEADER: UprightFont = *-regular ,
: #+LATEX_HEADER: BoldFont = *-bold ,
: #+LATEX_HEADER: ItalicFont = *-italic ,
: #+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
**** Sans
We also use Public Sans for our Sans font.
#+LATEX_HEADER: \setsansfont{publicsans}[
#+LATEX_HEADER: Path = L:/org/fonts/ ,
#+LATEX_HEADER: Scale = 0.872 ,
#+LATEX_HEADER: Extension = .ttf ,
#+LATEX_HEADER: UprightFont = *-regular ,
#+LATEX_HEADER: BoldFont = *-bold ,
#+LATEX_HEADER: ItalicFont = *-italic ,
#+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
: #+LATEX_HEADER: \setsansfont{publicsans}[
: #+LATEX_HEADER: Path = L:/org/fonts/ ,
: #+LATEX_HEADER: Scale = 0.872 ,
: #+LATEX_HEADER: Extension = .ttf ,
: #+LATEX_HEADER: UprightFont = *-regular ,
: #+LATEX_HEADER: BoldFont = *-bold ,
: #+LATEX_HEADER: ItalicFont = *-italic ,
: #+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
**** Monospace
Courier Prime is an open source alternative to Courier New on MS
Windows. Courier Prime relative x-height is *0.451*.
#+LATEX_HEADER: \setmonofont{courierprime}[
#+LATEX_HEADER: Path = L:/org/fonts/ ,
#+LATEX_HEADER: Extension = .ttf ,
#+LATEX_HEADER: UprightFont = *-regular ,
#+LATEX_HEADER: BoldFont = *-bold ,
#+LATEX_HEADER: ItalicFont = *-italic ,
#+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
: #+LATEX_HEADER: \setmonofont{courierprime}[
: #+LATEX_HEADER: Path = L:/org/fonts/ ,
: #+LATEX_HEADER: Extension = .ttf ,
: #+LATEX_HEADER: UprightFont = *-regular ,
: #+LATEX_HEADER: BoldFont = *-bold ,
: #+LATEX_HEADER: ItalicFont = *-italic ,
: #+LATEX_HEADER: BoldItalicFont = *-bolditalic ,]
**** Special characters
We define some custom special characters.
#+LATEX_HEADER: \newcommand\warningsign{\symbol{"26A0}}
: #+LATEX_HEADER: \newcommand\warningsign{\symbol{"26A0}}
*** Accessing document properties
We include the ~titling~ package in order to reference the document
title in the LaTeX header definition.
#+LATEX_HEADER: \usepackage{titling}
: #+LATEX_HEADER: \usepackage{titling}
We include the ~lastpage~ package in order to access the total amount
of pages in the document. This enables including a page count in the
document footer.
#+LATEX_HEADER: \usepackage{lastpage}
: #+LATEX_HEADER: \usepackage{lastpage}
*** Header and footer
#+LATEX_HEADER: \usepackage{fancyhdr}
#+LATEX_HEADER: \setlength{\headheight}{48pt}
#+LATEX_HEADER_EXTRA: \pagestyle{fancy}
#+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-20pt]{0pt}{0pt} \includegraphics[height=32pt]{L:/Org/templates/Safran_logo.png}}
#+LATEX_HEADER_EXTRA: \fancyhead[R]{\color{Gray} \footnotesize \texttt{\thetitle} \\ \thedate \\ \texttt{\theauthor}}
# LATEX_HEADER_EXTRA: \renewcommand{\headrulewidth}{1.2pt}
#+LATEX_HEADER_EXTRA: \fancyfoot[C]{\hrulefill\\[8pt]
#+LATEX_HEADER_EXTRA: \color{Gray} Page~\thepage/\pageref*{LastPage}\\[8pt]
#+LATEX_HEADER_EXTRA: \footnotesize \texttt{\textbf{MAG Aerospace Industries, LLC---Proprietary and Confidential.}}\\[6pt]
#+LATEX_HEADER_EXTRA: This document contains proprietary information of MAG Aerospace Industries, LLC.
#+LATEX_HEADER_EXTRA: This information may not, in whole or in part, be duplicated, reproduced, disclosed,
#+LATEX_HEADER_EXTRA: or used in any way except as expressly authorized in writing by MAG Aerospace Industries, LLC.}
: #+LATEX_HEADER: \usepackage{fancyhdr}
: #+LATEX_HEADER: \setlength{\headheight}{48pt}
: #+LATEX_HEADER_EXTRA: \pagestyle{fancy}
: #+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-20pt]{0pt}{0pt} \includegraphics[height=32pt]{L:/Org/templates/Safran_logo.png}}
: #+LATEX_HEADER_EXTRA: \fancyhead[R]{\color{Gray} \footnotesize \texttt{\thetitle} \\ \thedate \\ \texttt{\theauthor}}
: # LATEX_HEADER_EXTRA: \renewcommand{\headrulewidth}{1.2pt}
: #+LATEX_HEADER_EXTRA: \fancyfoot[C]{\hrulefill\\[8pt] \color{Gray} Page~\thepage/\pageref*{LastPage}\\[8pt] \footnotesize \texttt{\textbf{MAG Aerospace Industries, LLC---Proprietary and Confidential.}}\\[6pt] This document contains proprietary information of MAG Aerospace Industries, LLC. This information may not, in whole or in part, be duplicated, reproduced, disclosed, or used in any way except as expressly authorized in writing by MAG Aerospace Industries, LLC.}
|