commit c6065a132db413fcdc96e261bca6cd68b397faad Author: Matthieu Boyer Date: Fri Nov 22 12:36:28 2024 +0100 Initial Commit diff --git a/npr.cls b/npr.cls new file mode 100644 index 0000000..56821e0 --- /dev/null +++ b/npr.cls @@ -0,0 +1,198 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Document Setup +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Class Definition +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{npr} + +\LoadClass[twocolumns, twoside]{article} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Package Imports +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage[top=20mm,bottom=25 mm, left= 10 mm, right = 10mm,columnsep=20pt]{geometry} +% Basics +\RequirePackage[english,french]{babel} % Language hyphenation and typographical rules +\renewcommand*{\dotFFN}{} % Remove dot afer footnote markers +\RequirePackage[utf8]{inputenc} +\RequirePackage{tipa} +\RequirePackage{nth} % Date Formatting for the Months +\RequirePackage{yfonts} % Support for old german fonts +\newcommand{\hsc}[1]{{\footnotesize\MakeUppercase{#1}}} % Cheaty small caps to handle italic and such % FIXME: WTF IS THAT +\RequirePackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text + +\RequirePackage{enumitem} % Customized lists +\setlist[itemize]{noitemsep} % Make itemize lists more compact +\RequirePackage{pdfpages} +\RequirePackage{multicol} + +\RequirePackage{blindtext} % Lorem ipsum +\RequirePackage[sc]{mathpazo} % Use the Palatino font % Cringe +\RequirePackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs +\linespread{1.05} % Line spacing - Palatino needs more space between lines +\RequirePackage{microtype} % Slightly tweak font spacing for aesthetics +\RequirePackage{abstract} % Allows abstract customization +\renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold +\renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text + +\RequirePackage{booktabs} % Horizontal rules in tables + +% Maths +\RequirePackage{siunitx} +\RequirePackage{mathtools, mathrsfs} +\RequirePackage{amssymb, amsthm} +\RequirePackage{physics} +\RequirePackage{fancybox} +\RequirePackage{esvect} +%\RequirePackage{tikz-feynman} +%\RequirePackage{natbib} + +\RequirePackage{graphicx} % Picture Input Customization +\RequirePackage[absolute, overlay]{textpos} % Allows for absolute positioning of elements (namely date and number on the top of the first page) +\RequirePackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures +\RequirePackage{subcaption} % Multiple Captions +\RequirePackage{wrapfig} % Figures with text next to it + +\RequirePackage{tcolorbox} % Fancy Boxes +\RequirePackage{xcolor} +\definecolor{physics_blue}{RGB}{96, 165, 165} % Blue color used in the official graphical theme of the physics department + +\RequirePackage{tikz} % TikZ ist kein Zeichenprogramm = Life = Time And Relative Dimension In Space +\usetikzlibrary{decorations.markings, decorations.text} % Libs for fun arrows and nodes +\usetikzlibrary{calc} % Lib for Relative Positioning +\RequirePackage{varwidth} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Title Customisation +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{titlesec} % Allows customization of titles +\renewcommand\thesection{\Roman{section}} % Roman numerals for the sections +\renewcommand\thesubsection{\roman{subsection}} % roman numerals for subsections + \titleformat{\section}[block]{\Large\scshape\centering}{\thesection.}{1em}{}[] % Change the look of the section titles +\titleformat{\subsection}[block]{\large\bfseries\sffamily\centering}{\thesubsection.}{1em}{} % Change the look of the subsection titles +\titleformat{\subsubsection}[block]{\large\sffamily}{\thesubsubsection.}{1em}{} % Change the look of the subsubsection titles + +% Modify ToC Name Lines +\addto\captionsfrench{ + \renewcommand{\contentsname}% + {\vspace{-1.2cm}}% +} + +% Main Title of Edition +\RequirePackage{titling} % Customizing the title section +\setlength{\droptitle}{-7\baselineskip} % Move the title up +\pretitle{% +\centering +%\Huge +\bfseries +\textgoth +} + + +% Article title formatting +\posttitle{\centering +\begin{tikzpicture} + \draw[white] (0, 1) -- (1, 1); + \draw[draw=none, fill=physics_blue] (-6.5, -4.2) rectangle (6.5, -5.7); + \draw[draw=none, shading=axis, left color = physics_blue, right color = white] (6.48, -4.2) rectangle (8, -5.7); + \draw[draw=none, shading=axis, left color = white, right color = physics_blue] (-6.48, -4.2) rectangle (-8, -5.7); + \draw (0, -3) node{\includegraphics[width=0.7\linewidth]{Main_pict/NPR.png}}; + \draw (-4.5, -4.95) node[text width=3cm, rectangle, text centered]{\large\sffamily Normale Physics Review}; + \draw (4.5, -4.95) node{\includegraphics[width=2.5cm]{Main_pict/Logo_DepPhys-ENS_Blanc_justeENS.pdf}}; + \draw (0, -6.5) node{\large\textit{--- Fights Bohr-dom ---}}; +\end{tikzpicture} + +\vspace{-1.5cm} +} + + +% Blue highlight for title +\newcommand{\highlight}[1]{\texorpdfstring{\begin{tikzpicture}[baseline=-4pt] + \draw (0, 0) node[white](A){#1}; + \coordinate[shift={(0, -0.1)}] (B) at (A.north east); + \coordinate[shift={(0, 0.05)}] (C) at (A.south east); + \coordinate[shift={(0, 0.05)}] (D) at (A.south west); + \coordinate[shift={(0, -0.1)}] (E) at (A.north west); + \coordinate[shift={(0.5, 0)}] (F) at (B); + \coordinate[shift={(0.5, 0)}] (G) at (C); + \coordinate[shift={(-0.5, 0)}] (H) at (D); + \coordinate[shift={(-0.5, 0)}] (I) at (E); + \coordinate[shift={(-0.02, 0)}] (B2) at (B); + \coordinate[shift={(-0.02, 0)}] (C2) at (C); + \coordinate[shift={(0.02, 0)}] (D2) at (D); + \coordinate[shift={(0.02, 0)}] (E2) at (E); + \draw[draw=none, fill=physics_blue] (B) -- (C) -- (D) -- (E); + \draw[draw=none, shading=axis, left color=physics_blue, right color=white] (B2) -- (F) -- (G) -- (C2) -- cycle; + \draw[draw=none, shading=axis, right color=physics_blue, left color=white] (D2) -- (H) -- (I) -- (E2) -- cycle; + \draw (0, 0) node{#1}; +\end{tikzpicture}}{#1}} + +% Blue underlining for subsections +\newcommand{\substyle}[2][0.47\textwidth]{\texorpdfstring{\begin{tikzpicture}[baseline=-4pt] + \draw (0, 0) node[white](A){\begin{varwidth}{#1}\centering#2\end{varwidth}}; + \coordinate[shift={(0, 0.0)}] (C) at (A.south east); + \coordinate[shift={(0, 0.0)}] (D) at (A.south west); + \draw[draw=physics_blue, line width=1.5pt] (C) -- (D); + \draw (0, 0) node{\begin{varwidth}{#1}\centering#2\end{varwidth}}; +\end{tikzpicture}}{#2}} + +% Boxes to put aside text in (explanations, ...) % TODO: Think about modification with wrapfigures ? What usage ? +\newcommand{\boxedtext}[2]{\begin{center} + \begin{tikzpicture} + \draw (0, 0) node[anchor=south, rectangle, text centered](A){\begin{varwidth}{0.85\linewidth} + \sffamily #1 + \end{varwidth}}; + \draw[draw=none, fill=physics_blue] ([shift={(-0.1, 0)}]A.south west) -- ([shift={(-0.1, 0)}]A.north west) arc (180:90:0.1) -- ([shift={(0, 0.1)}]A.north east) arc (90:0:0.1) -- ([shift={(0.1, 0)}]A.south east) -- cycle; + \draw[thick] (-0.475\linewidth, 0) -- (0.475\linewidth, 0); + \draw (0, 0) node[anchor=south, rectangle, text centered]{\begin{varwidth}{0.85\linewidth} + \sffamily #1 + \end{varwidth}}; + \draw (0, 0) node[anchor=north, rectangle, text justified, text width = 0.9\linewidth, shift={(0, -0.1)}](B){#2}; + \draw[thick] let \p1 = (B.south) in (-0.475\linewidth, \y1-0.5) -- (0.475\linewidth, \y1-0.5); + \end{tikzpicture} +\end{center}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Headers and footers +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{fancyhdr} +\RequirePackage{float} + +\pagestyle{fancy} % All pages have headers and footers +\fancyhead{} % Blank out the default header +\fancyfoot{} % Blank out the default footer +\fancyhead[C]{Normale Physics Review~$\bullet$~\datepubli~$\bullet$ \numedition} % Custom header text +\fancyfoot[RO,LE]{\thepage} % Custom footer text +\renewcommand{\footrulewidth}{1pt} + +\fancypagestyle{plain}{ + \fancyhf{} + \fancyfoot[C]{\thepage} + \fancyfoot[L]{ISSN 2967-8919} + \renewcommand{\headrulewidth}{0.0pt} +} + +\RequirePackage{perpage} % Make footnote numbering page-specific +\MakePerPage{footnote} +\renewcommand{\thefootnote}{\fnsymbol{footnote}} % Replace footnote numbering by symbol + + +% TODO: Think about what the hell this is ? +\def\restrictionaux#1#2{{#1\,\smash{\vrule height .8\ht1 depth .85\dp1}}_{\,#2}} +\def\restriction#1#2{\mathchoice + {\setbox1\hbox{${\displaystyle #1}_{\scriptstyle #2}$} + \restrictionaux{#1}{#2}} + {\setbox1\hbox{${\textstyle #1}_{\scriptstyle #2}$} + \restrictionaux{#1}{#2}} + {\setbox1\hbox{${\scriptstyle #1}_{\scriptscriptstyle #2}$} + \restrictionaux{#1}{#2}} + {\setbox1\hbox{${\scriptscriptstyle #1}_{\scriptscriptstyle #2}$} + \restrictionaux{#1}{#2}}} + +\newenvironment{Figure} % Fixes figures in multicols environments +{\par\medskip\noindent\minipage{\linewidth}} +{\endminipage\par\medskip} + +% Hyperref breaks everything +\RequirePackage[hidelinks]{hyperref} % For hyperlinks in the PDF