Geen omschrijving

polytechnique.sty 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. %%
  2. %% This is file `polytechnique.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% polytechnique.dtx (with options: `package')
  8. %% This is a generated file.
  9. %%
  10. %% Copyright (C) 2015 by Denis Merigoux
  11. %%
  12. %% This file may be distributed and/or modified under the
  13. %% conditions of the LaTeX Project Public License, either
  14. %% version 1.2 of this license or (at your option) any later
  15. %% version. The latest version of this license is in:
  16. %%
  17. %% http://www.latex-project.org/lppl.txt
  18. %%
  19. %% and version 1.2 or later is part of all distributions of
  20. %% LaTeX version 1999/12/01 or later.
  21. \NeedsTeXFormat{LaTeX2e}
  22. \ProvidesPackage{polytechnique}
  23. [2016/01/17 v1.3.4, standard scientific documents layout for Ecole polytechnique (Palaiseau,France).]
  24. %%\CharacterTable
  25. %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  26. %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  27. %% Digits \0\1\2\3\4\5\6\7\8\9
  28. %% Exclamation \! Double quote \" Hash (number) \#
  29. %% Dollar \$ Percent \% Ampersand \&
  30. %% Acute accent \' Left paren \( Right paren \)
  31. %% Asterisk \* Plus \+ Comma \,
  32. %% Minus \- Point \. Solidus \/
  33. %% Colon \: Semicolon \; Less than \<
  34. %% Equals \= Greater than \> Question mark \?
  35. %% Commercial at \@ Left bracket \[ Backslash \\
  36. %% Right bracket \] Circumflex \^ Underscore \_
  37. %% Grave accent \` Left brace \{ Vertical bar \|
  38. %% Right brace \} Tilde \~}
  39. %%
  40. \DeclareOption{a4paper}{
  41. \PassOptionsToPackage{a4paper}{geometry}
  42. }
  43. \DeclareOption{fancysections}{
  44. \AtEndOfPackage{
  45. \titleformat{\chapter}
  46. [display]
  47. {\Huge\bfseries\sffamily}
  48. {\LARGE\chaptertitlename{} \thechapter}
  49. {0em}
  50. {}
  51. []
  52. \titleformat{\section}
  53. [display]
  54. {\color{rouge485}\LARGE\bfseries\sffamily\filcenter}
  55. {\thesection}
  56. {0em}
  57. {\MakeUppercaseWithNewline}
  58. [\vspace*{-0.5\baselineskip}%
  59. \includegraphics{\polyfiletlongrouge}]
  60. \titleformat{\subsection}
  61. [block]
  62. {\color{bleu315}\Large\scshape}
  63. {\thesubsection}
  64. {0.5em}
  65. {}
  66. [\vspace*{-0.3\baselineskip}%
  67. \includegraphics{\polyfiletcourtbleuclair}]
  68. \titleformat{\subsubsection}
  69. [block]
  70. {\color{bleu303}\large\scshape}
  71. {\thesubsubsection}
  72. {0.5em}
  73. {\textbullet{} }
  74. []
  75. }
  76. }
  77. \DeclareOption{notitlepage}{
  78. \renewcommand*{\maketitle}{
  79. \notitlepagelayout{}
  80. }
  81. }
  82. \DeclareOption{titlepage}{
  83. \renewcommand*{\maketitle}{
  84. \titlepagelayout{}
  85. }
  86. }
  87. \DeclareOption{oneside}{
  88. \AtEndOfPackage{
  89. \geometry{inner=\margecote,outer=\margecote}
  90. }
  91. }
  92. \DeclareOption{twoside}{
  93. \AtEndOfPackage{
  94. \geometry{inner=\margecoteinterieur,
  95. outer=\margecoteexterieur}
  96. }
  97. }
  98. \DeclareOption{sectionmark}{
  99. \AtEndOfPackage{
  100. \renewcommand{\enteteexterieur}[1]{
  101. \ifthesection{
  102. {\scshape\color{bleu303}
  103. \thesection{}.~\sectiontitle}
  104. }{
  105. }
  106. }
  107. }
  108. }
  109. \DeclareOption{chaptermark}{
  110. \AtEndOfPackage{
  111. \renewcommand{\enteteexterieur}[1]{
  112. \ifthechapter{
  113. {\scshape\color{bleu303}
  114. \thechapter{}.~\chaptertitle}
  115. }{
  116. }
  117. }
  118. }
  119. }
  120. \DeclareOption{markboth}{
  121. \AtEndOfPackage{
  122. \renewcommand{\enteteexterieurimpair}{
  123. \ifthesection{%Si la section a ete definie
  124. {\scshape\color{bleu303}
  125. \thesection{}.~\sectiontitle}
  126. }{
  127. }
  128. }
  129. \renewcommand{\enteteexterieurpair}{
  130. \ifthechapter{
  131. {\scshape\color{bleu303}
  132. \thechapter{}.~\chaptertitle}
  133. }{
  134. }
  135. }
  136. }
  137. }
  138. \DeclareOption{pagenumber}{
  139. \AtEndOfPackage{
  140. \RequirePackage{lastpage}
  141. \renewcommand{\piedcentre}{
  142. \setlength{\largeurfiletpiedcentre}
  143. {2\largeurfiletpiedcentre}
  144. \textcolor{bleu303}{\shortstack[c]{
  145. \rule{\largeurfiletpiedcentre}{0.3mm}\\
  146. \thepage/\pageref{LastPage}}}
  147. }
  148. }
  149. }
  150. \DeclareOption*{
  151. \PassOptionsToPackage{\CurrentOption}{geometry}
  152. }
  153. \ExecuteOptions{a4paper,notitlepage,oneside}
  154. \ProcessOptions*
  155. \RequirePackage{calc}
  156. \RequirePackage{color}
  157. \RequirePackage{geometry}
  158. \RequirePackage{graphicx}
  159. \RequirePackage{ifthen}
  160. \RequirePackage{ifpdf}
  161. \RequirePackage{lmodern}
  162. \RequirePackage[pagestyles]{titlesec}
  163. \definecolor{bleu303}{RGB}{0,62,92}
  164. \definecolor{rouge485}{RGB}{213,43,30}
  165. \definecolor{bleu315}{RGB}{0,104,128}
  166. \ifpdf
  167. \newcommand{\polyfiletlongrouge}
  168. {polytechnique-filetlongrouge.pdf}
  169. \newcommand{\polyfiletcourtbleuclair}
  170. {polytechnique-filetcourtbleuclair.pdf}
  171. \newcommand{\polyfiletcourtbleu}
  172. {polytechnique-filetcourtbleu.pdf}
  173. \newcommand{\polylogovert}
  174. {polytechnique-logovert.pdf}
  175. \newcommand{\polylogohori}
  176. {polytechnique-logohori.pdf}
  177. \newcommand{\polyarmes}
  178. {polytechnique-armes.pdf}
  179. \else
  180. \newcommand{\polyfiletlongrouge}
  181. {polytechnique-filetlongrouge.eps}
  182. \newcommand{\polyfiletcourtbleuclair}
  183. {polytechnique-filetcourtbleuclair.eps}
  184. \newcommand{\polyfiletcourtbleu}
  185. {polytechnique-filetcourtbleu.eps}
  186. \newcommand{\polylogovert}
  187. {polytechnique-logovert.eps}
  188. \newcommand{\polylogohori}
  189. {polytechnique-logohori.eps}
  190. \newcommand{\polyarmes}
  191. {polytechnique-armes.eps}
  192. \fi
  193. \newlength{\margehaut}
  194. \setlength{\margehaut}{40mm}
  195. \newlength{\hauteurentete}
  196. \setlength{\hauteurentete}{27mm}
  197. \newlength{\separationentete}
  198. \setlength{\separationentete}{12mm}
  199. \newlength{\margecote}
  200. \setlength{\margecote}{20mm}
  201. \newlength{\margecoteinterieur}
  202. \setlength{\margecoteinterieur}{22.5mm}
  203. \newlength{\margecoteexterieur}
  204. \setlength{\margecoteexterieur}{17.5mm}
  205. \newlength{\margebas}
  206. \setlength{\margebas}{35mm}
  207. \newlength{\separationpied}
  208. \setlength{\separationpied}{17.5mm}
  209. \newlength{\hauteurlogohori}
  210. \setlength{\hauteurlogohori}{15mm}
  211. \newlength{\separationtitre}
  212. \setlength{\separationtitre}{15mm}
  213. \newlength{\epaisseurtrait}
  214. \setlength{\epaisseurtrait}{1pt}
  215. \newlength{\separationlignestitre}
  216. \setlength{\separationlignestitre}{3mm}
  217. \newlength{\separationtitrecorps}
  218. \setlength{\separationtitrecorps}{15mm}
  219. \newlength{\hauteurlogopage}
  220. \setlength{\hauteurlogopage}{0.6\textheight}
  221. \newlength{\separationentetelogo}
  222. \setlength{\separationentetelogo}{20mm}
  223. \newlength{\largeurfiletpiedcentre}
  224. \setlength{\largeurfiletpiedcentre}{4mm}
  225. \newlength{\largeurlogovert}
  226. \setlength{\largeurlogovert}{\paperwidth/\real{7}}
  227. \newlength{\hauteurlogovert}
  228. \setlength{\hauteurlogovert}{\largeurlogovert*\real{1.361}}
  229. \newlength{\largeurlogohori}
  230. \setlength{\largeurlogohori}{\hauteurlogohori*\real{1.859}}
  231. \newlength{\distancetitrelogo}
  232. \setlength{\distancetitrelogo}{\separationtitre-\margehaut}
  233. \newlength{\separationlogotrait}
  234. \setlength{\separationlogotrait}{-\baselineskip*2+10mm}
  235. \newlength{\largeurminipage}
  236. \setlength{\largeurminipage}
  237. {(\textwidth-\largeurlogovert-0.5cm)/\real{2}}
  238. \newlength{\distancetitrecorps}
  239. \setlength{\distancetitrecorps}
  240. {\separationtitrecorps-\baselineskip*2}
  241. \newlength{\largeurtitreentete}
  242. \setlength{\largeurtitreentete}{\textwidth-\largeurlogohori
  243. -\separationentetelogo}
  244. \newlength{\decalageverticalentete}
  245. \setlength{\decalageverticalentete}
  246. {\hauteurlogohori/\real{2.6}}
  247. \geometry{
  248. top=\margehaut,headheight=\hauteurentete,
  249. headsep=\separationentete,
  250. bottom=\margebas,footskip=\separationpied
  251. }
  252. \newcommand{\piedcentre}{
  253. \textcolor{bleu303}{\shortstack[c]
  254. {\rule{\largeurfiletpiedcentre}{0.3mm}\\\thepage}}
  255. }
  256. \newcommand{\enteteexterieur}[1]{
  257. {\begin{minipage}[b]{\largeurtitreentete}
  258. \scshape#1\textcolor{bleu303}
  259. \polytitrecourtsave
  260. \end{minipage}}
  261. }
  262. \newcommand{\enteteinterieur}[1]{
  263. \includegraphics[height=\hauteurlogohori,width=2\largeurlogohori,keepaspectratio]{#1}
  264. }
  265. \newcommand{\enteteexterieurpair}{
  266. \enteteexterieur{\flushright}
  267. }
  268. \newcommand{\enteteexterieurimpair}{
  269. \enteteexterieur{}
  270. }
  271. \newcommand{\enteteinterieurpair}{
  272. \enteteinterieur{\polylogohori}
  273. }
  274. \newcommand{\enteteinterieurimpair}{
  275. \enteteinterieur{\polylogohori}
  276. }
  277. \newcommand{\entetes}{
  278. \newpagestyle{polytechnique}{
  279. \sethead[\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteinterieurpair}}]% left even
  280. []% center even
  281. [\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteexterieurpair}}]% right even
  282. {\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteexterieurimpair}}}% left odd
  283. {}% center odd
  284. {\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteinterieurimpair}}}% right odd
  285. \setfoot{}% left odd
  286. {\piedcentre}% center odd
  287. {}% right odd
  288. }
  289. \pagestyle{polytechnique}
  290. }
  291. \renewpagestyle{plain}{
  292. \sethead{}% left
  293. {}% center
  294. {}% right
  295. \setfoot{}% left
  296. {\piedcentre}% center
  297. {}% right
  298. }
  299. \pagestyle{plain}
  300. \newboolean{subtitle}\setboolean{subtitle}{false}
  301. \newcommand{\polysoustitresave}{}
  302. \def\subtitle{}
  303. \renewcommand*{\subtitle}[1]{
  304. \renewcommand*{\polysoustitresave}{#1}
  305. \setboolean{subtitle}{true}
  306. }
  307. \newcommand{\polytitresave}{}
  308. \newcommand{\polytitrecourtsave}{}
  309. \renewcommand*{\title}[2][{}]{
  310. \renewcommand*{\polytitresave}{#2}
  311. \ifthenelse{\equal{#1}{}}{
  312. \renewcommand*{\polytitrecourtsave}{#2}
  313. }{
  314. \renewcommand*{\polytitrecourtsave}{#1}
  315. }
  316. \entetes
  317. }
  318. \newcommand{\polyauthorsave}{}
  319. \renewcommand*{\author}[1]{
  320. \renewcommand*{\polyauthorsave}{#1}
  321. }
  322. \newcommand{\polydatesave}{\today}
  323. \renewcommand*{\date}[1]{
  324. \renewcommand*{\polydatesave}{#1}
  325. }
  326. \newcommand{\logo}[2][{}]{
  327. \ifthenelse{\equal{#1}{headers}}{
  328. \renewcommand{\enteteinterieurimpair}{
  329. \enteteinterieur{#2}
  330. }
  331. }{}
  332. \renewcommand{\titlepagebottomline}{
  333. \begin{minipage}{5\largeurlogohori}
  334. \centering
  335. \raisebox{-0.5\height}{
  336. \includegraphics[width=1.5\largeurlogohori]
  337. {\polylogohori}
  338. }
  339. \hspace{0.25\largeurlogohori}
  340. \raisebox{-0.5\height}{
  341. \includegraphics[height=\hauteurlogovert,
  342. width=1.5\largeurlogohori,
  343. keepaspectratio]{#2}
  344. }
  345. \end{minipage}
  346. }
  347. \renewcommand{\notitlepageupperline}{
  348. \noindent%
  349. \begin{minipage}{\textwidth}
  350. \centering
  351. \begin{minipage}{0.33\textwidth}
  352. \raisebox{-0.5\height}
  353. {\includegraphics[width=\largeurlogovert]
  354. {\polylogovert}
  355. }
  356. \end{minipage}%
  357. % \end{macrocode}
  358. \begin{minipage}{0.33\textwidth}
  359. \centering\polydatesave{}\\
  360. \polyauthorsave{}\\
  361. \includegraphics{\polyfiletcourtbleu}
  362. \end{minipage}%
  363. \begin{minipage}{0.33\textwidth}
  364. \flushright\raisebox{-0.5\height}
  365. {\includegraphics[height=\hauteurlogovert,
  366. width=1.75\largeurlogohori,
  367. keepaspectratio]{#2}
  368. }
  369. \end{minipage}
  370. \end{minipage}
  371. }
  372. }
  373. \newcommand{\notitlepageupperline}{
  374. \noindent
  375. \begin{minipage}[b]{\largeurminipage}
  376. \hspace{0cm}\polyauthorsave
  377. \end{minipage}%
  378. \hspace*{\fill}
  379. \includegraphics[width=\largeurlogovert]{\polylogovert}
  380. \hspace*{\fill}%
  381. \begin{minipage}[b]{\largeurminipage}
  382. \flushright\hspace{0cm}\polydatesave
  383. \end{minipage}%
  384. }
  385. \newcommand{\notitlepagelayout}{
  386. \thispagestyle{plain}
  387. \vspace*{\distancetitrelogo}
  388. \notitlepageupperline{}
  389. \\[\separationlogotrait]
  390. \begin{center}
  391. \textcolor{bleu303}
  392. {\rule{\textwidth}{\epaisseurtrait}}
  393. \\
  394. \color{bleu303}\Huge\scshape
  395. \MakeUppercaseWithNewline{\polytitresave}
  396. \ifthenelse{\boolean{subtitle}}{
  397. \\[\separationlignestitre]
  398. \Large\upshape\polysoustitresave\\\normalsize
  399. }{
  400. \\
  401. \normalsize
  402. }
  403. \textcolor{bleu303}
  404. {\rule{\textwidth}{\epaisseurtrait}}
  405. \end{center}
  406. \vspace*{\distancetitrecorps}
  407. }
  408. \newcommand{\titlepagebottomline}{
  409. \includegraphics[height=\hauteurlogovert]{\polylogovert}
  410. }
  411. \newcommand{\titlepagelayout}{
  412. \noindent\makebox[\textwidth][c]{%
  413. \raisebox{-\totalheight}[0pt][0pt]{%
  414. \includegraphics[height=\hauteurlogopage]{\polyarmes}}}
  415. \vspace*{0.125\textheight}
  416. \begin{center}
  417. \Huge\sffamily\bfseries\color{bleu303}
  418. \MakeUppercaseWithNewline{\polytitresave}\\
  419. \vspace*{0.2\textheight}
  420. \LARGE\hspace{0cm}\polysoustitresave\\
  421. \vspace*{0.15\textheight}
  422. \Large\mdseries\hspace{0cm}\polydatesave\\
  423. \includegraphics{\polyfiletcourtbleu}
  424. \\[0.4\baselineskip]
  425. \rmfamily\hspace{0cm}\polyauthorsave\\[\fill]
  426. $\;$\titlepagebottomline{}
  427. \vspace*{-0.5\margebas}
  428. \end{center}
  429. \thispagestyle{empty}
  430. \clearpage
  431. }
  432. \newcommand{\MakeUppercaseWithNewline}[1]{
  433. \begingroup
  434. \let\SavedOrgNewline\\%
  435. \DeclareRobustCommand{\\}{\SavedOrgNewline}%
  436. \MakeUppercase{#1}%
  437. \endgroup
  438. }
  439. \endinput
  440. %%
  441. %% End of file `polytechnique.sty'.