From 29f0b0efcee3b462b5469aec45763e820f3311a2 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 13 Jun 2024 10:25:52 +0200 Subject: Added all the styles requirements --- common/Makefile.common | 5 +- common/classes/tex/DUClasses/DUclasses.sty | 40 ++++++ common/classes/tex/DUStyle/DUStyle.sty | 63 +++++++++ common/classes/tex/DUcenter/DUcenter.sty | 12 ++ common/classes/tex/DUcolumns/DUcolumn.sty | 31 ++++ .../classes/tex/DUpygments/DUpygments-arduino.sty | 127 +++++++++++++++++ .../classes/tex/DUpygments/DUpygments-colorful.sty | 149 +++++++++++++++++++ .../classes/tex/DUpygments/DUpygments-default.sty | 130 +++++++++++++++++ .../classes/tex/DUpygments/DUpygments-monokai.sty | 143 +++++++++++++++++++ common/classes/tex/DUpygments/DUpygments-tango.sty | 157 +++++++++++++++++++++ common/classes/tex/DUpygments/pygments_css2sty.py | 66 +++++++++ common/classes/tex/DUsidebar/DUsidebar.sty | 58 ++++++++ common/classes/tex/DUsmallcaps/DUsmallcaps.sty | 4 + readme.rst | 2 +- 14 files changed, 983 insertions(+), 4 deletions(-) create mode 100755 common/classes/tex/DUClasses/DUclasses.sty create mode 100644 common/classes/tex/DUStyle/DUStyle.sty create mode 100644 common/classes/tex/DUcenter/DUcenter.sty create mode 100755 common/classes/tex/DUcolumns/DUcolumn.sty create mode 100644 common/classes/tex/DUpygments/DUpygments-arduino.sty create mode 100644 common/classes/tex/DUpygments/DUpygments-colorful.sty create mode 100644 common/classes/tex/DUpygments/DUpygments-default.sty create mode 100644 common/classes/tex/DUpygments/DUpygments-monokai.sty create mode 100644 common/classes/tex/DUpygments/DUpygments-tango.sty create mode 100644 common/classes/tex/DUpygments/pygments_css2sty.py create mode 100644 common/classes/tex/DUsidebar/DUsidebar.sty create mode 100644 common/classes/tex/DUsmallcaps/DUsmallcaps.sty diff --git a/common/Makefile.common b/common/Makefile.common index a05db25..c3f6959 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -83,10 +83,9 @@ tmp/%.tex: %.rst $(INCLUDED_PDF) $(SOURCES) | tmp # Generate each pdf with latex tmp/%.pdf: tmp/%.tex tmp/model.tex $(BIBS) | tmp - set TEXINPUTS=.:$(MODEL):$$(TEXINPUTS) # Make the first run in batch mode (no pdf produced) - $(TEX) -output-directory tmp --halt-on-error --draftmode $< - $(TEX) -output-directory tmp $< + TEXMFHOME=$(MODEL)/../common/classes $(TEX) -output-directory tmp --halt-on-error --draftmode $< + TEXMFHOME=$(MODEL)/../common/classes $(TEX) -output-directory tmp $< #bibtex tmp/$*.aux && $(TEX) -output-directory tmp $< || echo "no bib" while grep 'Rerun to get ' tmp/$*.log ; do \ $(TEX) -output-directory tmp $< ;\ diff --git a/common/classes/tex/DUClasses/DUclasses.sty b/common/classes/tex/DUClasses/DUclasses.sty new file mode 100755 index 0000000..737fbf1 --- /dev/null +++ b/common/classes/tex/DUClasses/DUclasses.sty @@ -0,0 +1,40 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{DUclasses}[2019/08/13 Docutils custom classes] + +\RequirePackage{xstring} +\RequirePackage{environ} + +% +% Permet d'appliquer des paramètres aux styles de classes, et fournis quelques styles +% correspondant +% +% .. container:: textcolor-white centering +% +% Ceci est un test +% +% Sur plusieurs lignes + +% Mise à jour de l'environnement DUclass + +% class handling for environments (block-level elements) +% \begin{DUclass}{foo-bar} tries \DUCLASSfoo[bar] and +% \end{DUclass}{foo} tries \endDUCLASSfoo +\ifx\DUclass\undefined + \newenvironment{DUclass}[1]% + {\StrCut{#1}{-}\csA\csB + \def\DocutilsClassFunctionName{DUCLASS\csA}% arg cannot be used in end-part of environment. + \csname \DocutilsClassFunctionName \endcsname{\csB}}% + {\csname end\DocutilsClassFunctionName \endcsname}% +\fi + + +% Creation d'une boite de hauteur fixe +\NewEnviron{DUCLASShbox}[1]{ + \parbox[s][#1][c]{\linewidth}{\BODY} +} + +% Mise en couleur du texte +\newcommand{\DUCLASStextcolor}[1]{\color{#1}} + +\NewEnviron{DUCLASScentering}{\centering\BODY\par} + diff --git a/common/classes/tex/DUStyle/DUStyle.sty b/common/classes/tex/DUStyle/DUStyle.sty new file mode 100644 index 0000000..666d703 --- /dev/null +++ b/common/classes/tex/DUStyle/DUStyle.sty @@ -0,0 +1,63 @@ +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{DUStyle}[2018/02/25 DUStyle Package] + +% The macro can be used to create your own style : +% the style will apply by declaring a custom class : + +%\createIconifiedDUStyle{warning}{orange}{!}{large} +%\createIconifiedDUStyle{note}{blue}{}{large} + +% .. admonition:: Title +% :class: warning + +% .. sidebar:: Title +% :class: note + +\RequirePackage{tikz} +\RequirePackage{mdframed} +\RequirePackage{xcolor} +\RequirePackage{ifthen} + +% Background color for the frame. +\definecolor{DUStyle@lightGray}{RGB}{245, 245, 245} + +% arg1 : The circle backround color +% arg2 : The dot content +% arg3 : The title environment +% arg4 : The title +\newcommand{\DUStyle@iconizedTitle}[4]{% + \begin{#3}% + \ifthenelse{\equal{#2}{}} + {} + {% + \tikz[baseline]{% + \node[circle,fill=#1,inner sep=3pt,anchor=base] at (0, 0)% + {\color{DUStyle@lightGray}#2}; + }% + } + {#4} + \end{#3} +} + +\newcommand{\DUStyle@colorBox}[2]{% + \begin{mdframed}[topline=false, + bottomline=false, + rightline=false, + linecolor=#1, + linewidth=3pt, + skipabove=0.5cm, + %backgroundcolor=DUStyle@lightGray + ]% + #2 + \end{mdframed} +} + +% Create two commands with the same style : +% - for the admonition colored box +% - for the titles in styles (sidebar, admonitions...) +\newcommand\createIconifiedDUStyle[4]{% + \expandafter\newcommand\csname DUadmonition#1\endcsname[1]{\DUStyle@colorBox{#2}{##1}} + \expandafter\newcommand\csname DUtitle#1\endcsname[1]{\DUStyle@iconizedTitle{#2}{#3}{#4}{##1}} +} + + diff --git a/common/classes/tex/DUcenter/DUcenter.sty b/common/classes/tex/DUcenter/DUcenter.sty new file mode 100644 index 0000000..f5e0781 --- /dev/null +++ b/common/classes/tex/DUcenter/DUcenter.sty @@ -0,0 +1,12 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{DUcenter}[2017/04/16 Docutils center role] + +% +% Permet de centrer un texte en utilisant la classe « center » +% +% .. class:: center +% +% Ce texte sera centré + +\newcommand{\DUrolecenter}[1]{\begin{center}#1\end{center}} + diff --git a/common/classes/tex/DUcolumns/DUcolumn.sty b/common/classes/tex/DUcolumns/DUcolumn.sty new file mode 100755 index 0000000..d8e7141 --- /dev/null +++ b/common/classes/tex/DUcolumns/DUcolumn.sty @@ -0,0 +1,31 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{DUcolumn}[2017/04/16 Docutils multicol] + +\RequirePackage{multicol} + +% +% .. container:: paracol2 +% +% Create a section of two column using paracol +% +% +% .. container:: multicols2 +% +% Create a section of two column using multicols + +\newenvironment{DUCLASSparacol2}% + {\begin{paracol}{2}} + {\end{paracol}} + +\newenvironment{DUclasstparacol3}% + {\begin{paracol}{2}} + {\end{paracol}} + +\newenvironment{DUCLASSmulticols2}% + {\begin{multicols}{2}} + {\end{multicols}} + +\newenvironment{DUCLASSmulticols3}% + {\begin{multicols}{3}} + {\end{multicols}} + diff --git a/common/classes/tex/DUpygments/DUpygments-arduino.sty b/common/classes/tex/DUpygments/DUpygments-arduino.sty new file mode 100644 index 0000000..c1f623b --- /dev/null +++ b/common/classes/tex/DUpygments/DUpygments-arduino.sty @@ -0,0 +1,127 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{DUpygments-arduino}[2017/04/16 Docutils Pygments] + +% Stylesheet for syntax highlight with Docutils +% Generated by pygments_css2sty.py from a Pygments CSS style +% (output of `pygmentize -S