From 869728581626dd361d7c3c9bd8d4804b72850c5e Mon Sep 17 00:00:00 2001
From: Sébastien Dailly <sebastien@dailly.me>
Date: Fri, 21 Mar 2025 14:22:07 +0100
Subject: Declare the column index as argument

---
 common/99_sidebar.tex | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'common/99_sidebar.tex')

diff --git a/common/99_sidebar.tex b/common/99_sidebar.tex
index 5bc96cd..57d76ad 100755
--- a/common/99_sidebar.tex
+++ b/common/99_sidebar.tex
@@ -26,6 +26,17 @@
 % 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
@@ -38,12 +49,12 @@
 \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
-- 
cgit v1.2.3

