Nav apraksta

polytechnique.sty 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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{xcolor}
  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. \colorlet{bleu303pale}{bleu303!20!white}
  165. \definecolor{rouge485}{RGB}{213,43,30}
  166. \definecolor{bleu315}{RGB}{0,104,128}
  167. \ifpdf
  168. \newcommand{\polyfiletlongrouge}
  169. {polytechnique-filetlongrouge.pdf}
  170. \newcommand{\polyfiletcourt}
  171. {polytechnique-filetcourt.pdf}
  172. \let\polyfiletcourtbleuclair\polyfiletcourt
  173. \let\polyfiletcourtbleu\polyfiletcourt
  174. \newcommand{\polylogovert}
  175. {polytechnique-logovert.pdf}
  176. \newcommand{\polylogohori}
  177. {polytechnique-logohori.pdf}
  178. \newcommand{\polyarmes}
  179. {polytechnique-armes.pdf}
  180. \else
  181. \newcommand{\polyfiletlongrouge}
  182. {polytechnique-filetlongrouge.eps}
  183. \newcommand{\polyfiletcourtbleuclair}
  184. {polytechnique-filetcourtbleuclair.eps}
  185. \newcommand{\polyfiletcourtbleu}
  186. {polytechnique-filetcourtbleu.eps}
  187. \newcommand{\polylogovert}
  188. {polytechnique-logovert.eps}
  189. \newcommand{\polylogohori}
  190. {polytechnique-logohori.eps}
  191. \newcommand{\polyarmes}
  192. {polytechnique-armes.eps}
  193. \fi
  194. \newlength{\margehaut}
  195. \setlength{\margehaut}{40mm}
  196. \newlength{\hauteurentete}
  197. \setlength{\hauteurentete}{27mm}
  198. \newlength{\separationentete}
  199. \setlength{\separationentete}{12mm}
  200. \newlength{\margecote}
  201. \setlength{\margecote}{20mm}
  202. \newlength{\margecoteinterieur}
  203. \setlength{\margecoteinterieur}{22.5mm}
  204. \newlength{\margecoteexterieur}
  205. \setlength{\margecoteexterieur}{17.5mm}
  206. \newlength{\margebas}
  207. \setlength{\margebas}{35mm}
  208. \newlength{\separationpied}
  209. \setlength{\separationpied}{17.5mm}
  210. \newlength{\hauteurlogohori}
  211. \setlength{\hauteurlogohori}{15mm}
  212. \newlength{\separationtitre}
  213. \setlength{\separationtitre}{15mm}
  214. \newlength{\epaisseurtrait}
  215. \setlength{\epaisseurtrait}{1pt}
  216. \newlength{\separationlignestitre}
  217. \setlength{\separationlignestitre}{3mm}
  218. \newlength{\separationtitrecorps}
  219. \setlength{\separationtitrecorps}{15mm}
  220. \newlength{\hauteurlogopage}
  221. \setlength{\hauteurlogopage}{0.6\textheight}
  222. \newlength{\separationentetelogo}
  223. \setlength{\separationentetelogo}{20mm}
  224. \newlength{\largeurfiletpiedcentre}
  225. \setlength{\largeurfiletpiedcentre}{4mm}
  226. \newlength{\largeurlogovert}
  227. \setlength{\largeurlogovert}{\paperwidth/\real{7}}
  228. \newlength{\hauteurlogovert}
  229. \setlength{\hauteurlogovert}{\largeurlogovert*\real{1.361}}
  230. \newlength{\largeurlogohori}
  231. \setlength{\largeurlogohori}{\hauteurlogohori*\real{1.859}}
  232. \newlength{\distancetitrelogo}
  233. \setlength{\distancetitrelogo}{\separationtitre-\margehaut}
  234. \newlength{\separationlogotrait}
  235. \setlength{\separationlogotrait}{-\baselineskip*2+10mm}
  236. \newlength{\largeurminipage}
  237. \setlength{\largeurminipage}
  238. {(\textwidth-\largeurlogovert-0.5cm)/\real{2}}
  239. \newlength{\distancetitrecorps}
  240. \setlength{\distancetitrecorps}
  241. {\separationtitrecorps-\baselineskip*2}
  242. \newlength{\largeurtitreentete}
  243. \setlength{\largeurtitreentete}{\textwidth-\largeurlogohori
  244. -\separationentetelogo}
  245. \newlength{\decalageverticalentete}
  246. \setlength{\decalageverticalentete}
  247. {\hauteurlogohori/\real{2.6}}
  248. \geometry{
  249. top=\margehaut,headheight=\hauteurentete,
  250. headsep=\separationentete,
  251. bottom=\margebas,footskip=\separationpied
  252. }
  253. \newcommand{\piedcentre}{
  254. \textcolor{bleu303}{\shortstack[c]
  255. {\rule{\largeurfiletpiedcentre}{0.3mm}\\\thepage}}
  256. }
  257. \newcommand{\enteteexterieur}[1]{
  258. {\begin{minipage}[b]{\largeurtitreentete}
  259. \scshape#1\textcolor{bleu303}
  260. \polytitrecourtsave
  261. \end{minipage}}
  262. }
  263. \newcommand{\enteteinterieur}[2][bleu303]{
  264. {%
  265. \color{#1}%
  266. \includegraphics[height=\hauteurlogohori,width=2\largeurlogohori,keepaspectratio]{#2}%
  267. }%
  268. }
  269. \newcommand{\enteteexterieurpair}{
  270. \enteteexterieur{\flushright}
  271. }
  272. \newcommand{\enteteexterieurimpair}{
  273. \enteteexterieur{}
  274. }
  275. \newcommand{\enteteinterieurpair}{
  276. \enteteinterieur{\polylogohori}
  277. }
  278. \newcommand{\enteteinterieurimpair}{
  279. \enteteinterieur{\polylogohori}
  280. }
  281. \newcommand{\entetes}{
  282. \newpagestyle{polytechnique}{
  283. \sethead[\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteinterieurpair}}]% left even
  284. []% center even
  285. [\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteexterieurpair}}]% right even
  286. {\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteexterieurimpair}}}% left odd
  287. {}% center odd
  288. {\raisebox{.5\hauteurlogohori}{\raisebox{-0.5\height}{\enteteinterieurimpair}}}% right odd
  289. \setfoot{}% left odd
  290. {\piedcentre}% center odd
  291. {}% right odd
  292. }
  293. \pagestyle{polytechnique}
  294. }
  295. \renewpagestyle{plain}{
  296. \sethead{}% left
  297. {}% center
  298. {}% right
  299. \setfoot{}% left
  300. {\piedcentre}% center
  301. {}% right
  302. }
  303. \pagestyle{plain}
  304. \newboolean{subtitle}\setboolean{subtitle}{false}
  305. \newcommand{\polysoustitresave}{}
  306. \def\subtitle{}
  307. \renewcommand*{\subtitle}[1]{
  308. \renewcommand*{\polysoustitresave}{#1}
  309. \setboolean{subtitle}{true}
  310. }
  311. \newcommand{\polytitresave}{}
  312. \newcommand{\polytitrecourtsave}{}
  313. \renewcommand*{\title}[2][{}]{
  314. \renewcommand*{\polytitresave}{#2}
  315. \ifthenelse{\equal{#1}{}}{
  316. \renewcommand*{\polytitrecourtsave}{#2}
  317. }{
  318. \renewcommand*{\polytitrecourtsave}{#1}
  319. }
  320. \entetes
  321. }
  322. \newcommand{\polyauthorsave}{}
  323. \renewcommand*{\author}[1]{
  324. \renewcommand*{\polyauthorsave}{#1}
  325. }
  326. \newcommand{\polydatesave}{\today}
  327. \renewcommand*{\date}[1]{
  328. \renewcommand*{\polydatesave}{#1}
  329. }
  330. \newcommand{\logo}[2][{}]{
  331. \ifthenelse{\equal{#1}{headers}}{
  332. \renewcommand{\enteteinterieurimpair}{
  333. \enteteinterieur{#2}
  334. }
  335. }{}
  336. \renewcommand{\titlepagebottomline}{
  337. \begin{minipage}{5\largeurlogohori}
  338. \centering
  339. \raisebox{-0.5\height}{
  340. \color{bleu303}
  341. \includegraphics[width=1.5\largeurlogohori]
  342. {\polylogohori}
  343. }
  344. \hspace{0.25\largeurlogohori}
  345. \raisebox{-0.5\height}{
  346. \includegraphics[height=\hauteurlogovert,
  347. width=1.5\largeurlogohori,
  348. keepaspectratio]{#2}
  349. }
  350. \end{minipage}
  351. }
  352. \renewcommand{\notitlepageupperline}{
  353. \noindent%
  354. \begin{minipage}{\textwidth}
  355. \centering
  356. \begin{minipage}{0.33\textwidth}
  357. \raisebox{-0.5\height}
  358. {\color{bleu303}%
  359. \includegraphics[width=\largeurlogovert]
  360. {\polylogovert}
  361. }
  362. \end{minipage}%
  363. % \end{macrocode}
  364. \begin{minipage}{0.33\textwidth}
  365. \color{bleu303}%
  366. \centering\polydatesave{}\\
  367. \polyauthorsave{}\\
  368. \includegraphics{\polyfiletcourtbleu}
  369. \end{minipage}%
  370. \begin{minipage}{0.33\textwidth}
  371. \color{bleu303}%
  372. \flushright\raisebox{-0.5\height}
  373. {\includegraphics[height=\hauteurlogovert,
  374. width=1.75\largeurlogohori,
  375. keepaspectratio]{#2}
  376. }
  377. \end{minipage}
  378. \end{minipage}
  379. }
  380. }
  381. \newcommand{\notitlepageupperline}{
  382. \noindent
  383. \begin{minipage}[b]{\largeurminipage}
  384. \color{bleu303}%
  385. \hspace{0cm}\polyauthorsave
  386. \end{minipage}%
  387. \hspace*{\fill}
  388. {\color{bleu303}%
  389. \includegraphics[width=\largeurlogovert]{\polylogovert}}
  390. \hspace*{\fill}%
  391. \begin{minipage}[b]{\largeurminipage}
  392. \color{bleu303}%
  393. \flushright\hspace{0cm}\polydatesave
  394. \end{minipage}%
  395. }
  396. \newcommand{\notitlepagelayout}{
  397. \thispagestyle{plain}
  398. \vspace*{\distancetitrelogo}
  399. \notitlepageupperline{}
  400. \\[\separationlogotrait]
  401. \begin{center}
  402. \textcolor{bleu303}
  403. {\rule{\textwidth}{\epaisseurtrait}}
  404. \\
  405. \color{bleu303}\Huge\scshape
  406. \MakeUppercaseWithNewline{\polytitresave}
  407. \ifthenelse{\boolean{subtitle}}{
  408. \\[\separationlignestitre]
  409. \Large\upshape\polysoustitresave\\\normalsize
  410. }{
  411. \\
  412. \normalsize
  413. }
  414. \textcolor{bleu303}
  415. {\rule{\textwidth}{\epaisseurtrait}}
  416. \end{center}
  417. \vspace*{\distancetitrecorps}
  418. }
  419. \newcommand{\titlepagebottomline}{
  420. \includegraphics[height=\hauteurlogovert]{\polylogovert}
  421. }
  422. \newcommand{\titlepagelayout}{
  423. \noindent\makebox[\textwidth][c]{%
  424. \raisebox{-\totalheight}[0pt][0pt]{%
  425. \color{bleu303pale}%
  426. \includegraphics[height=\hauteurlogopage]{\polyarmes}}}
  427. \vspace*{0.125\textheight}
  428. \begin{center}
  429. \Huge\sffamily\bfseries\color{bleu303}
  430. \MakeUppercaseWithNewline{\polytitresave}\\
  431. \vspace*{0.2\textheight}
  432. \LARGE\hspace{0cm}\polysoustitresave\\
  433. \vspace*{0.15\textheight}
  434. \Large\mdseries\hspace{0cm}\polydatesave\\
  435. \includegraphics{\polyfiletcourtbleu}
  436. \\[0.4\baselineskip]
  437. \rmfamily\hspace{0cm}\polyauthorsave\\[\fill]
  438. $\;$\titlepagebottomline{}
  439. \vspace*{-0.5\margebas}
  440. \end{center}
  441. \thispagestyle{empty}
  442. \clearpage
  443. }
  444. \newcommand{\MakeUppercaseWithNewline}[1]{
  445. \begingroup
  446. \let\SavedOrgNewline\\%
  447. \DeclareRobustCommand{\\}{\SavedOrgNewline}%
  448. \MakeUppercase{#1}%
  449. \endgroup
  450. }
  451. \endinput
  452. %%
  453. %% End of file `polytechnique.sty'.