aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2026-01-11 12:34:35 -0500
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2026-01-11 12:34:35 -0500
commit3b18d762b95ba3c1dc929f909392e0c69bbda302 (patch)
tree57ebc24959c0cc4ab4db3ec3e03169a529c9ef2c
parentef2ba740a784c47f09f9cd5aedd0a096c00b845b (diff)
downloadweekschedule-3b18d762b95ba3c1dc929f909392e0c69bbda302.tar.gz
Added configurable minute lines at 15 and 30
-rw-r--r--weekschedule.cls28
1 files changed, 24 insertions, 4 deletions
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} {