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

138 lines
4.2 KiB
TeX

\documentclass[11pt]{article}
% ---------- Encoding & fonts (pdflatex-compatible, no external fonts needed) ----------
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
% ---------- 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}
\lstset{
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}