View raw

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