From 3b18d762b95ba3c1dc929f909392e0c69bbda302 Mon Sep 17 00:00:00 2001
From: "Douglas B. Rumbaugh" <doug@douglasrumbaugh.com>
Date: Sun, 11 Jan 2026 12:34:35 -0500
Subject: Added configurable minute lines at 15 and 30

---
 weekschedule.cls | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

(limited to 'weekschedule.cls')

diff --git a/weekschedule.cls b/weekschedule.cls
index 39b0256..d411537 100644
--- a/weekschedule.cls
+++ b/weekschedule.cls
@@ -47,6 +47,9 @@
 \newcommand{\@weekdaydisplay}{Monday,Tuesday,Wednesday,Thursday,Friday}
 \newcommand{\@daycount}{5}
 
+% Minute line configuration
+\newcommand{\@minutelineinterval}{0}  % 0=off, 30=half-hour, 15=quarter-hour
+
 % ============================================
 % User-facing configuration commands
 % ============================================
@@ -97,6 +100,11 @@
 \newcommand{\sethourheight}[1]{\renewcommand{\@hourheight}{#1}}
 \newcommand{\setpadding}[1]{\renewcommand{\@padding}{#1}}
 
+% Minute line configuration
+\newcommand{\minutelinesoff}{\renewcommand{\@minutelineinterval}{0}}
+\newcommand{\minutelinesthirty}{\renewcommand{\@minutelineinterval}{30}}
+\newcommand{\minutelinesfifteen}{\renewcommand{\@minutelineinterval}{15}}
+
 % ============================================
 % Internal time parsing
 % ============================================
@@ -196,11 +204,23 @@
             \draw[gray] (0, -\hour*\hourheight) -- (\gridwidth, -\hour*\hourheight);
         }
 
-        % Draw half-hour lines (dashed)
+        % Draw minute lines (dashed) based on configuration
         \pgfmathtruncatemacro{\lasthour}{\endhour-1}
-        \foreach \hour in {\starthour,...,\lasthour} {
-            \draw[gray, dashed, line width=0.25pt] (0, -\hour*\hourheight-0.5*\hourheight) -- (\gridwidth, -\hour*\hourheight-0.5*\hourheight);
-        }
+        \pgfmathtruncatemacro{\minuteinterval}{\@minutelineinterval}
+        \ifnum\minuteinterval=30
+            % Draw half-hour lines
+            \foreach \hour in {\starthour,...,\lasthour} {
+                \draw[gray, dashed, line width=0.25pt] (0, -\hour*\hourheight-0.5*\hourheight) -- (\gridwidth, -\hour*\hourheight-0.5*\hourheight);
+            }
+        \fi
+        \ifnum\minuteinterval=15
+            % Draw quarter-hour lines
+            \foreach \hour in {\starthour,...,\lasthour} {
+                \draw[gray, dashed, line width=0.25pt] (0, -\hour*\hourheight-0.25*\hourheight) -- (\gridwidth, -\hour*\hourheight-0.25*\hourheight);
+                \draw[gray, dashed, line width=0.25pt] (0, -\hour*\hourheight-0.5*\hourheight) -- (\gridwidth, -\hour*\hourheight-0.5*\hourheight);
+                \draw[gray, dashed, line width=0.25pt] (0, -\hour*\hourheight-0.75*\hourheight) -- (\gridwidth, -\hour*\hourheight-0.75*\hourheight);
+            }
+        \fi
 
         % Draw all events
         \foreach \evnum in {1,...,\the@numevents} {
-- 
cgit v1.2.3

