studium/LaTeX_pdf/template.tex
Antoine Pelletier fbedcf97e3 wip
2026-09-28 16:35:30 +02:00

156 lines
5.5 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[11pt]{article}
% ---------- Encoding & fonts (pdflatex-compatible, no external fonts needed) ----------
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
% Unicode chars pdflatex doesn't know out of the box
\DeclareUnicodeCharacter{2212}{\ensuremath{-}} % − minus sign
\DeclareUnicodeCharacter{2192}{\ensuremath{\rightarrow}}
\DeclareUnicodeCharacter{2190}{\ensuremath{\leftarrow}}
\DeclareUnicodeCharacter{2264}{\ensuremath{\leq}}
\DeclareUnicodeCharacter{2265}{\ensuremath{\geq}}
\DeclareUnicodeCharacter{00D7}{\ensuremath{\times}}
% ---------- Page geometry (matches assignment.cls) ----------
\usepackage[left=2cm,right=2cm,top=1.5cm,bottom=2cm]{geometry}
\usepackage{setspace}
\setstretch{1.08}
% ---------- Math ----------
\usepackage{amsmath,amssymb}
% ---------- Colour & boxes ----------
\usepackage[dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\tcbuselibrary{skins,breakable}
\newtcolorbox{defbox}[1][]{%
enhanced, breakable, colback=blue!5, colframe=blue!65!black,
fonttitle=\bfseries, coltitle=white, title={#1},
boxrule=0.8pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt
}
\newtcolorbox{theobox}[1][]{%
enhanced, breakable, colback=red!5, colframe=red!55!black,
fonttitle=\bfseries, coltitle=white, title={#1},
boxrule=0.8pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt
}
\newtcolorbox{exbox}[1][]{%
enhanced, breakable, colback=green!5, colframe=green!40!black,
fonttitle=\bfseries, coltitle=white, title={#1},
boxrule=0.8pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt
}
% Word-highlight box, matching assignment.cls's \hword
\newtcbox{\hword}[1][orange]{on line, arc=0.3mm, auto outer arc,
colback=#1!12!, colframe=#1!60!, colupper=black, boxsep=0mm,
left=0.3mm, right=0.3mm, top=0.4mm, bottom=0.4mm,
boxrule=0.2mm, bottomrule=0.2mm, toprule=0.2mm}
% ---------- Tables ----------
\usepackage{calc}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\providecommand{\passthrough}[1]{#1}
\providecommand{\pandocbounded}[1]{#1}
% Fix for a real bug (see jgm/pandoc#11201): longtable >= 4.21 (shipped with
% recent TeX Live, e.g. 2026) combined with the caption package's longtable
% patch tries to reference a counter literally named "none" as a placeholder
% for uncaptioned tables, which was never actually defined anywhere, crashing
% with "LaTeX Error: No counter 'none' defined." Defining it as an unused
% dummy counter satisfies that reference harmlessly.
\newcounter{none}
% ---------- Code listings (pandoc --listings), matching assignment.cls ----------
\usepackage{listings}
\usepackage{pmboxdraw} % box-drawing glyphs (├ └ │ ─ ...) under pdflatex
\lstset{
% listings is not UTF-8 aware under pdflatex: map multibyte chars explicitly
literate=
{├}{{\textSFviii}}1 {└}{{\textSFii}}1 {┌}{{\textSFi}}1 {┐}{{\textSFiii}}1 {┘}{{\textSFiv}}1 {┤}{{\textSFix}}1
{┬}{{\textSFvi}}1 {┴}{{\textSFvii}}1 {┼}{{\textSFv}}1 {│}{{\textSFxi}}1 {─}{{\textSFx}}1
{é}{{\'e}}1 {è}{{\`e}}1 {ê}{{\^e}}1 {ë}{{\"e}}1 {à}{{\`a}}1 {â}{{\^a}}1
{ù}{{\`u}}1 {û}{{\^u}}1 {ü}{{\"u}}1 {ô}{{\^o}}1 {ö}{{\"o}}1 {î}{{\^i}}1
{ï}{{\"i}}1 {ç}{{\c{c}}}1 {É}{{\'E}}1 {È}{{\`E}}1 {À}{{\`A}}1 {Ç}{{\c{C}}}1
{«}{{\guillemotleft}}1 {»}{{\guillemotright}}1 {’}{{'}}1 {…}{{...}}3 {−}{{-}}1 {–}{{--}}1 {—}{{---}}1
{≤}{{$$\leq$$}}1 {≥}{{$$\geq$$}}1 {×}{{$$\times$$}}1
{→}{{$$\rightarrow$$}}2 {←}{{$$\leftarrow$$}}2,
framerule=1pt,
frame=tb,
emphstyle={\small\ttfamily\bfseries\color{Orange}},
numbers=left,
numberstyle=\tiny\color{black},
basicstyle=\small\ttfamily,
keywordstyle=\bfseries\color{BrickRed},
identifierstyle=\bfseries\color{black},
stringstyle=\bfseries\color{ForestGreen},
commentstyle=\bfseries\color{Violet},
breaklines=true,
columns=fixed,
basewidth=.5em,
backgroundcolor=\color{Gray!5},
tabsize=2,
showspaces=false,
showstringspaces=false,
}
% ---------- Links ----------
\usepackage[colorlinks=true,linkcolor=blue!60!black,urlcolor=blue!60!black,citecolor=blue!60!black]{hyperref}
% caption is loaded AFTER hyperref on purpose: it needs to detect hyperref's
% presence at load time to patch longtable's anchor/bookmark generation
% correctly. Loading it before hyperref (as an earlier version of this
% template did) is a known cause of exactly the
% "LaTeX Error: No counter 'none' defined" crash on \begin{longtable}.
\usepackage{caption}
\captionsetup{skip=6pt}
% Failsafe belt-and-braces: bypass hyperref's auto-computed \theHtable /
% \theHfigure chain entirely.
\providecommand{\theHtable}{\thetable}
\providecommand{\theHfigure}{\thefigure}
% ---------- Section styling ----------
\usepackage{sectsty}
\sectionfont{\Large\bfseries}
\subsectionfont{\large\bfseries\color{black!80}}
\usepackage{graphicx}
\begin{document}
% ---------- Header (matches assignment.cls's \assignmentTitle) ----------
\begin{flushleft}
$if(student-name)$\textbf{Student Name:} $student-name$\\$endif$
$if(student-id)$\textbf{Student ID:} $student-id$$endif$
\end{flushleft}
$if(logo)$
\begin{flushright}\vspace{-15mm}
\includegraphics[height=1cm]{$logo$}
\end{flushright}
$endif$
$if(course)$
\begin{flushleft}\vspace{0mm}
\textbf{\large $course$}
\end{flushleft}
$endif$
$if(subtitle)$
\begin{flushleft}\vspace{-3.5mm}
\textbf{\large $subtitle$}
\end{flushleft}
$endif$
\noindent\rule{\linewidth}{.6pt}
\vspace{4mm}
$body$
\end{document}