Add LaTeX model from virli course
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
nemunaire 2022-02-19 00:32:49 +01:00
parent 917a307d25
commit 313597aede
5 changed files with 108 additions and 5 deletions

View File

@ -0,0 +1 @@
\renewcommand\section{\@startsection{section}{1}{\z@}{\z@}{5mm}{\section@box}}

42
tutorial/adlin.sty Normal file
View File

@ -0,0 +1,42 @@
\tcbuselibrary{skins,breakable}
\newtcbox{\section@box}{tile,before=\noindent,after=,
fontupper=\normalfont\Large\bfseries,capture=minipage,colback=ForestGreen!80,coltext=white,
boxsep=0mm,top=4mm,bottom=4mm,left=\oddsidemargin+1in,right=\oddsidemargin+1in,
spread sidewards,fuzzy halo=1mm with ForestGreen!50!black}
\newtcolorbox{alertbox}[1][]{breakable,enhanced,
before skip balanced=2mm,after skip balanced=3mm,
tile,left=11mm,right=2mm,top=1mm,bottom=1mm,
colback=white!0,
sharp corners,
underlay={%
\path[fill=OrangeRed!80!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=10mm]interior.north west);
},#1}
\newtcolorbox{codebox}[1][]{breakable,enhanced,
before skip balanced=2mm,after skip balanced=3mm,
tile,left=11mm,right=2mm,top=1mm,bottom=1mm,
colback=white!0,
sharp corners,
underlay={%
\path[fill=black,draw=none] (interior.south west) rectangle node[white]{\huge\bfseries\texttt >\_} ([xshift=10mm]interior.north west);
},#1}
\newtcolorbox{questionbox}[1][]{breakable,enhanced,
before skip balanced=2mm,after skip balanced=3mm,
tile,left=11mm,right=2mm,top=1mm,bottom=1mm,
colback=white!0,
sharp corners,
underlay={%
\path[fill=MidnightBlue!85!gray,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries ?} ([xshift=10mm]interior.north west);
},#1}
\newtcolorbox{morebox}[1][]{breakable,enhanced,
before skip balanced=2mm,after skip balanced=3mm,
tile,left=7mm,right=7mm,top=1mm,bottom=1mm,
colback=white!0,
sharp corners,
underlay={%
\path[fill=ForestGreen!50!white,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries (} ([xshift=6mm]interior.north west);
\path[fill=ForestGreen!50!white,draw=none] (interior.south east) rectangle node[white]{\Huge\bfseries )} ([xshift=-6mm]interior.north east);
},#1}

View File

@ -0,0 +1,47 @@
function Div(el)
if el.classes[1] == "warning"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{alertbox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{alertbox}"))
elseif el.classes[1] == "code"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{codebox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{codebox}"))
elseif el.classes[1] == "question"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{questionbox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{questionbox}"))
elseif el.classes[1] == "more"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\begin{morebox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{morebox}"))
end
return el
end

View File

@ -22,3 +22,14 @@
% In french, list item starts with dash, not bullet
\renewcommand\labelitemi{---}
\usepackage{etoolbox}
\usepackage{tcolorbox}
\usepackage{../adlin}
\usepackage{../adlin-section}
\makeatletter
\pretocmd{\subsection}{\addtocontents{toc}{\protect\addvspace{-5\p@}}}{}{}
\pretocmd{\subsubsection}{\addtocontents{toc}{\protect\addvspace{-6\p@}}}{}{}
\makeatother

View File

@ -1,16 +1,18 @@
PANDOCOPTS = --pdf-engine=xelatex \
PANDOCOPTS = --pdf-engine=lualatex \
--standalone \
--number-sections \
--toc \
-f markdown+smart \
-M fontsize=12pt \
-M papersize=a4paper \
-M mainfont="Linux Libertine O" \
-M monofont="FantasqueSansMono-Regular" \
-M sansfont="Linux Biolinum O" \
-M papersize=a4 \
-M mainfont="Linux Libertine" \
-M monofont="FantasqueSansMono" \
-M sansfont="Linux Biolinum" \
-M colorlinks=true \
-M linkcolor="black" \
-M urlcolor="ForestGreen" \
-M indent=true \
-V toc-title="Sommaire" \
-V pdfa \
--lua-filter=../colored-blocks.lua \
--include-in-header=../../tutorial/header.tex