diff options
Diffstat (limited to 'common/99_sidebar.tex')
-rwxr-xr-x | common/99_sidebar.tex | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/common/99_sidebar.tex b/common/99_sidebar.tex index ab599a0..57d76ad 100755 --- a/common/99_sidebar.tex +++ b/common/99_sidebar.tex @@ -1,15 +1,60 @@ +\usepackage{paracol} \newlength{\notesep} +% All the models uses two columns. +% At any time in the RST document, you can add elements in the sidebar using +% the sidebar directive. +% +% .. sidebar:: Informations +% +% * 17 allée des cerisiers +% * 75001 Paris |phoneicon| +% * 01 23 45 67 89 |mailicon| +% * email@example |noicon| +% +% You can close the sidebar at any time, but this requires to use latex code in the document +% +% .. raw:: latex +% +% \flushpage +% \end{paracol} +% \newgeometry{left=3cm,right=3cm,bottom=1cm,top=1cm} + + +% Switch in paracol mode from the begining of the document +% This can be disabled by defining \nocolumns before loading +% this template. +% +% \def\nocolumns{} +% +% The column is supposed to be on the left on the document, with the index 0. You +% can change this by defining a counter sidebarindex with +% +% \newcounter{sidebarindex} +% \setcounter{sidebarindex}{1} + +\ifdefined\sidebarindex +\else + \newcommand\sidebarindex{0} +\fi + +\ifdefined\nocolumns +\else + \AtBeginDocument{% + \begin{paracol}{2} + } +\fi + \def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} \let\endchangemargin=\endlist \ifdefinedcolor{backsidecolor}{% - \backgroundcolor{c[0]}{backsidecolor} + \backgroundcolor{c[\sidebarindex]}{backsidecolor} }{} % Une commande dédiée pour les notes de marge \newcommand{\DUsidebar}[1]{% - \switchcolumn[0] + \switchcolumn[\sidebarindex] \begin{changemargin}{0.7cm}{0.7cm} % Sélectionne la police alternative \AltFont\selectfont @@ -21,8 +66,9 @@ \ifdefinedcolor{textsidecolor}{\color{black}}{} } +% If the column is still active, make it go to the bottom of the page. +\makeatletter \AtEndDocument{% - % Make the column go to the bottom - \flushpage - \end{paracol} + \ifthenelse{\equal{\@currenvir}{paracol}}{\flushpage\end{paracol}}{} } +\makeatother |