No Description

polytechnique.sty 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. [2015/04/29 v1.3.0, 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}{0em}
  56. {\MakeUppercase}
  57. [\vspace*{-0.5\baselineskip}%
  58. \includegraphics{\polyfiletlongrouge}]
  59. \titleformat{\subsection}
  60. [hang]
  61. {\color{bleu315}\Large\scshape}
  62. {\thesubsection}
  63. {0.5em}
  64. {}
  65. [\vspace*{-0.3\baselineskip}%
  66. \includegraphics{\polyfiletcourtbleuclair}]
  67. \titleformat{\subsubsection}
  68. [block]
  69. {\color{bleu303}\large\scshape}
  70. {\thesubsubsection}
  71. {0.5em}
  72. {\textbullet{} }
  73. []
  74. }
  75. }
  76. \DeclareOption{notitlepage}{
  77. \AtBeginDocument{
  78. \renewcommand*{\maketitle}{
  79. \notitlepagelayout{}
  80. }
  81. }
  82. }
  83. \DeclareOption{titlepage}{
  84. \AtBeginDocument{
  85. \renewcommand*{\maketitle}{
  86. \titlepagelayout{}
  87. }
  88. }
  89. }
  90. \DeclareOption{oneside}{
  91. \AtEndOfPackage{
  92. \geometry{left=\margecote,right=\margecote}
  93. }
  94. }
  95. \DeclareOption{twoside}{
  96. \AtEndOfPackage{
  97. \geometry{inner=\margecoteinterieur,
  98. outer=\margecoteexterieur}
  99. }
  100. }
  101. \DeclareOption{sectionmark}{
  102. \AtEndOfPackage{
  103. \renewcommand{\enteteinterieur}[1]{
  104. \ifthesection{
  105. \raisebox{\decalageverticalentete}
  106. {\scshape\color{bleu303}
  107. \thesection{}.~\sectiontitle}
  108. }{
  109. }
  110. }
  111. }
  112. }
  113. \DeclareOption{chaptermark}{
  114. \AtEndOfPackage{
  115. \renewcommand{\enteteinterieur}[1]{
  116. \ifthechapter{
  117. \raisebox{\decalageverticalentete}
  118. {\scshape\color{bleu303}
  119. \thechapter{}.~\chaptertitle}
  120. }{
  121. }
  122. }
  123. }
  124. }
  125. \DeclareOption{markboth}{
  126. \AtEndOfPackage{
  127. \renewcommand{\enteteinterieurimpair}{
  128. \ifthesection{%Si la section a ete definie
  129. \raisebox{\decalageverticalentete}
  130. {\scshape\color{bleu303}
  131. \thesection{}.~\sectiontitle}
  132. }{
  133. }
  134. }
  135. \renewcommand{\enteteinterieurpair}{
  136. \ifthechapter{
  137. \raisebox{\decalageverticalentete}
  138. {\scshape\color{bleu303}
  139. \thechapter{}.~\chaptertitle}
  140. }{
  141. }
  142. }
  143. }
  144. }
  145. \DeclareOption{pagenumber}{
  146. \AtEndOfPackage{
  147. \RequirePackage{lastpage}
  148. \renewcommand{\piedcentre}{
  149. \setlength{\largeurfiletpiedcentre}
  150. {2\largeurfiletpiedcentre}
  151. \textcolor{bleu303}{\shortstack[c]{
  152. \rule{\largeurfiletpiedcentre}{0.3mm}\\
  153. \thepage/\pageref{LastPage}}}
  154. }
  155. }
  156. }
  157. \DeclareOption*{
  158. \PassOptionsToPackage{\CurrentOption}{geometry}
  159. }
  160. \ExecuteOptions{a4paper,notitlepage,oneside}
  161. \ProcessOptions\relax
  162. \RequirePackage{calc}
  163. \RequirePackage{color}
  164. \RequirePackage{geometry}
  165. \RequirePackage{graphicx}
  166. \RequirePackage{ifthen}
  167. \RequirePackage{ifpdf}
  168. \RequirePackage{lmodern}
  169. \RequirePackage[pagestyles]{titlesec}
  170. \definecolor{bleu303}{RGB}{0,62,92}
  171. \definecolor{rouge485}{RGB}{213,43,30}
  172. \definecolor{bleu315}{RGB}{0,104,128}
  173. \ifpdf
  174. \newcommand{\polyfiletlongrouge}{filetlongrouge.pdf}
  175. \newcommand{\polyfiletcourtbleuclair}
  176. {filetcourtbleuclair.pdf}
  177. \newcommand{\polyfiletcourtbleu}{filetcourtbleu.pdf}
  178. \newcommand{\polylogovert}{logovert.pdf}
  179. \newcommand{\polylogohori}{logohori.pdf}
  180. \newcommand{\polyarmes}{armes.pdf}
  181. \else
  182. \newcommand{\polyfiletlongrouge}{filetlongrouge.eps}
  183. \newcommand{\polyfiletcourtbleuclair}
  184. {filetcourtbleuclair.eps}
  185. \newcommand{\polyfiletcourtbleu}{filetcourtbleu.eps}
  186. \newcommand{\polylogovert}{logovert.eps}
  187. \newcommand{\polylogohori}{logohori.eps}
  188. \newcommand{\polyarmes}{armes.eps}
  189. \fi
  190. \newlength{\margehaut}
  191. \setlength{\margehaut}{40mm}
  192. \newlength{\hauteurentete}
  193. \setlength{\hauteurentete}{27mm}
  194. \newlength{\separationentete}
  195. \setlength{\separationentete}{12mm}
  196. \newlength{\margecote}
  197. \setlength{\margecote}{20mm}
  198. \newlength{\margecoteinterieur}
  199. \setlength{\margecoteinterieur}{22.5mm}
  200. \newlength{\margecoteexterieur}
  201. \setlength{\margecoteexterieur}{17.5mm}
  202. \newlength{\margebas}
  203. \setlength{\margebas}{35mm}
  204. \newlength{\separationpied}
  205. \setlength{\separationpied}{17.5mm}
  206. \newlength{\hauteurlogohori}
  207. \setlength{\hauteurlogohori}{15mm}
  208. \newlength{\separationtitre}
  209. \setlength{\separationtitre}{15mm}
  210. \newlength{\epaisseurtrait}
  211. \setlength{\epaisseurtrait}{1pt}
  212. \newlength{\separationlignestitre}
  213. \setlength{\separationlignestitre}{3mm}
  214. \newlength{\separationtitrecorps}
  215. \setlength{\separationtitrecorps}{15mm}
  216. \newlength{\hauteurlogopage}
  217. \setlength{\hauteurlogopage}{0.6\textheight}
  218. \newlength{\separationentetelogo}
  219. \setlength{\separationentetelogo}{20mm}
  220. \newlength{\largeurfiletpiedcentre}
  221. \setlength{\largeurfiletpiedcentre}{4mm}
  222. \newlength{\largeurlogovert}
  223. \setlength{\largeurlogovert}{\paperwidth/\real{7}}
  224. \newlength{\hauteurlogovert}
  225. \setlength{\hauteurlogovert}{\largeurlogovert*\real{1.361}}
  226. \newlength{\largeurlogohori}
  227. \setlength{\largeurlogohori}{\hauteurlogohori*\real{1.859}}
  228. \newlength{\distancetitrelogo}
  229. \setlength{\distancetitrelogo}{\separationtitre-\margehaut}
  230. \newlength{\separationlogotrait}
  231. \setlength{\separationlogotrait}{-\baselineskip*2+10mm}
  232. \newlength{\largeurminipage}
  233. \setlength{\largeurminipage}
  234. {(\textwidth-\largeurlogovert)/\real{2}}
  235. \newlength{\distancetitrecorps}
  236. \setlength{\distancetitrecorps}
  237. {\separationtitrecorps-\baselineskip*2}
  238. \newlength{\largeurtitreentete}
  239. \setlength{\largeurtitreentete}{\textwidth-\largeurlogohori
  240. -\separationentetelogo}
  241. \newlength{\decalageverticalentete}
  242. \setlength{\decalageverticalentete}
  243. {\hauteurlogohori/\real{2.6}}
  244. \geometry{
  245. top=\margehaut,headheight=\hauteurentete,
  246. headsep=\separationentete,
  247. bottom=\margebas,footskip=\separationpied
  248. }
  249. \newcommand{\piedcentre}{
  250. \textcolor{bleu303}{\shortstack[c]
  251. {\rule{\largeurfiletpiedcentre}{0.3mm}\\\thepage}}
  252. }
  253. \newcommand{\enteteinterieur}[1]{
  254. \raisebox{\decalageverticalentete}
  255. {\begin{minipage}[b]{\largeurtitreentete}
  256. \scshape#1\textcolor{bleu303}
  257. \polytitresave
  258. \end{minipage}}
  259. }
  260. \newcommand{\enteteexterieur}{
  261. \includegraphics[height=\hauteurlogohori]{\polylogohori}
  262. }
  263. \newcommand{\enteteinterieurpair}{
  264. \enteteinterieur{}
  265. }
  266. \newcommand{\enteteinterieurimpair}{
  267. \enteteinterieur{\flushright}
  268. }
  269. \newcommand{\entetes}{
  270. \newpagestyle{polytechnique}{
  271. \sethead[\enteteinterieurpair]% left even
  272. []% center even
  273. [\enteteexterieur]% right even
  274. {\enteteexterieur}% left odd
  275. {}% center odd
  276. {\enteteinterieurimpair}% right odd
  277. \setfoot{}% left odd
  278. {\piedcentre}% center odd
  279. {}% right odd
  280. }
  281. \pagestyle{polytechnique}
  282. }
  283. \renewpagestyle{plain}{
  284. \sethead{}% left
  285. {}% center
  286. {}% right
  287. \setfoot{}% left
  288. {\piedcentre}% center
  289. {}% right
  290. }
  291. \pagestyle{plain}
  292. \newboolean{subtitle}\setboolean{subtitle}{false}
  293. \newcommand{\polysoustitresave}{}
  294. \newcommand*{\subtitle}[1]{
  295. \renewcommand*{\polysoustitresave}{#1}
  296. \setboolean{subtitle}{true}
  297. }
  298. \newcommand{\polytitresave}{}
  299. \renewcommand*{\title}[1]{
  300. \renewcommand*{\polytitresave}{#1}
  301. \entetes
  302. }
  303. \newcommand{\polyauthorsave}{}
  304. \renewcommand*{\author}[1]{
  305. \renewcommand*{\polyauthorsave}{#1}
  306. }
  307. \newcommand{\polydatesave}{\today}
  308. \renewcommand*{\date}[1]{
  309. \renewcommand*{\polydatesave}{#1}
  310. }
  311. \newcommand{\logo}[1]{
  312. \renewcommand{\titlepagebottomline}{
  313. \includegraphics[height=1.5\hauteurlogohori]
  314. {\polylogohori}
  315. \hspace{0.05\textwidth}
  316. \includegraphics[height=\hauteurlogovert,
  317. width=1.5\largeurlogohori,
  318. keepaspectratio]{#1}%
  319. }
  320. \renewcommand{\notitlepageupperline}{
  321. \noindent
  322. \begin{minipage}{\textwidth}
  323. \parbox{0.333\textwidth}
  324. {\raisebox{-0.5\height}
  325. {\includegraphics[width=\largeurlogovert]
  326. {\polylogovert}
  327. }
  328. }
  329. \parbox{0.333\textwidth}
  330. {\centering\polydatesave{}\\
  331. \polyauthorsave{}\\
  332. \includegraphics{\polyfiletcourtbleu}
  333. }
  334. \parbox{0.333\textwidth}
  335. {\flushright\raisebox{-0.5\height}
  336. {\includegraphics[height=\hauteurlogovert,
  337. width=1.5\largeurlogohori,
  338. keepaspectratio]{#1}
  339. }
  340. }
  341. \end{minipage}
  342. }
  343. }
  344. \newcommand{\notitlepageupperline}{
  345. \noindent
  346. \begin{minipage}[b]{\largeurminipage}
  347. \hspace{0cm}\polyauthorsave
  348. \end{minipage}
  349. \hspace*{\fill}
  350. \includegraphics[width=\largeurlogovert]{\polylogovert}
  351. \hspace*{\fill}
  352. \begin{minipage}[b]{\largeurminipage}
  353. \flushright\hspace{0cm}\polydatesave
  354. \end{minipage}
  355. }
  356. \newcommand{\notitlepagelayout}{
  357. \thispagestyle{plain}
  358. \vspace*{\distancetitrelogo}
  359. \notitlepageupperline{}
  360. \\[\separationlogotrait]
  361. \begin{center}
  362. \textcolor{bleu303}
  363. {\rule{\textwidth}{\epaisseurtrait}}
  364. \\
  365. \color{bleu303}\Huge\scshape
  366. \MakeUppercaseWithNewline{\polytitresave}
  367. \ifthenelse{\boolean{subtitle}}{
  368. \\[\separationlignestitre]
  369. \Large\upshape\polysoustitresave\\\normalsize
  370. }{
  371. \\
  372. \normalsize
  373. }
  374. \textcolor{bleu303}
  375. {\rule{\textwidth}{\epaisseurtrait}}
  376. \end{center}
  377. \vspace*{\distancetitrecorps}
  378. }
  379. \newcommand{\titlepagebottomline}{
  380. \includegraphics[height=\hauteurlogovert]{\polylogovert}
  381. }
  382. \newcommand{\titlepagelayout}{
  383. \noindent\makebox[\textwidth][c]{%
  384. \raisebox{-\totalheight}[0pt][0pt]{%
  385. \includegraphics[height=\hauteurlogopage]{\polyarmes}}}
  386. \vspace*{0.125\textheight}
  387. \begin{center}
  388. \Huge\sffamily\bfseries\color{bleu303}
  389. \MakeUppercaseWithNewline{\polytitresave}\\
  390. \vspace*{0.2\textheight}
  391. \LARGE\hspace{0cm}\polysoustitresave\\
  392. \vspace*{0.15\textheight}
  393. \Large\mdseries\hspace{0cm}\polydatesave\\
  394. \includegraphics{\polyfiletcourtbleu}
  395. \\[0.4\baselineskip]
  396. \rmfamily\hspace{0cm}\polyauthorsave\\[\fill]
  397. $\;$\titlepagebottomline{}
  398. \vspace*{-0.5\margebas}
  399. \end{center}
  400. \thispagestyle{empty}
  401. \clearpage
  402. }
  403. \newcommand{\MakeUppercaseWithNewline}[1]{
  404. \begingroup
  405. \let\SavedOrgNewline\\%
  406. \DeclareRobustCommand{\\}{\SavedOrgNewline}%
  407. \MakeUppercase{#1}%
  408. \endgroup
  409. }
  410. \endinput
  411. %%
  412. %% End of file `polytechnique.sty'.