texlive[74945] Master/texmf-dist: cistercian (14apr25)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 14 21:51:59 CEST 2025


Revision: 74945
          https://tug.org/svn/texlive?view=revision&revision=74945
Author:   karl
Date:     2025-04-14 21:51:59 +0200 (Mon, 14 Apr 2025)
Log Message:
-----------
cistercian (14apr25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.pdf
    trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.tex
    trunk/Master/texmf-dist/tex/latex/cistercian/cistercian.sty

Modified: trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.tex	2025-04-14 19:51:45 UTC (rev 74944)
+++ trunk/Master/texmf-dist/doc/latex/cistercian/cistercian-doc.tex	2025-04-14 19:51:59 UTC (rev 74945)
@@ -34,9 +34,9 @@
   \texorpdfstring{
     \texttt{samcarter}\\
     \url{https://github.com/samcarter/cistercian}\\
-%    \url{https://ctan.org/pkg/cistercian}
+    \url{https://ctan.org/pkg/cistercian}
   }{samcarter}}
-\date{Version v0.1 \textendash{} 2025/04/12}
+\date{Version v0.2 \textendash{} 2025/04/14}
 \packagename{cistercian}
 
 \begin{document}
@@ -43,6 +43,12 @@
 \maketitle
 \thispagestyle{scrheadings}
 
+\begin{tcolorbox}[width=.8\textwidth,center,sidebyside=false,title={Note}]
+Users, for whom compilation speed is important and who do not need the possibility to modify the appearance of the numerals via Ti\emph{k}Z options, should have a look at the amazingly fast and very versatile \href{https://ctan.org/pkg/xistercian}{xistercian} package instead.
+
+The two packages are not meant to be combined.
+\end{tcolorbox}
+
 \section{Introduction}
 
 The \saminline|cistercian| package is meant for displaying Cistercian numerals in \LaTeX{}.
@@ -64,12 +70,10 @@
 
 Several variants were in use, in this package we are adopting the glyph shapes as shown in \url{https://commons.wikimedia.org/wiki/File:Cistercian_digits_(vertical).svg}.
 
-\clearpage
 \section{Overview numerals}
 
 \begin{center}
-\tikzset{
-  /cistercian/.cd,
+\cistercianset{
   height=4.5ex,
   stroke=0.3ex
 }
@@ -125,7 +129,7 @@
 \cistercian[scale=2,draw=red]{3141}
 \end{tcblisting}
 
-Another option \TikZ\ option which might be useful for the Cistercian numerals is \saminline|line join|, which changes how the lines connect to each other. This alters the appearance of the numbers quite a bit and can help to blend them in with the surrounding font.
+Another \TikZ\ option which might be useful for the Cistercian numerals is \saminline|line join|, which changes how the lines connect to each other. This alters the appearance of the numbers quite a bit and can help to blend them in with the surrounding font.
 \begin{tcblisting}{title={Line join (miter)},environment lower args={scalebox}{5}}
 \cistercian[line join=round]{53}
 \cistercian[line join=bevel]{53}
@@ -132,14 +136,28 @@
 \cistercian[line join=miter]{53}
 \end{tcblisting}
 
-\section{Alternatives}
+Besides using these option as optional argument, they can also be set globally using the macro \saminline|\cistercianset|:
+\begin{tcblisting}{title={Global options},listing only}
+\cistercianset{%
+  height=1cm,
+  width=0.2cm,
+  stroke=0.1cm,
+  draw=red,
+}
+\end{tcblisting}
 
-User, for whom compilation speed is important and who do not need the possibility to modify the appearance of the numerals via Ti\emph{k}Z options, should have a look at the amazingly fast and very versatile \href{https://ctan.org/pkg/xistercian}{xistercian} package.
-
 %\section{Testing}
 %
-%\foreach \macro in {1,...,999}{
-%  \macro:\cistercian[scale=10,line join=bevel]{\macro}
+%\cistercianset{%
+%  height=1cm,
+%%  width=0.2cm,
+%%  stroke=0.1cm,
+%  draw=red,
+%%line join=bevel
 %}
+%
+%\foreach \macro in {1,...,10}{
+%  \macro:\cistercian{\macro}
+%}
 
-\end{document}
\ No newline at end of file
+\end{document}

Modified: trunk/Master/texmf-dist/tex/latex/cistercian/cistercian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/cistercian/cistercian.sty	2025-04-14 19:51:45 UTC (rev 74944)
+++ trunk/Master/texmf-dist/tex/latex/cistercian/cistercian.sty	2025-04-14 19:51:59 UTC (rev 74945)
@@ -12,22 +12,28 @@
 % See https://www.latex-project.org/lppl.txt
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{cistercian}[2025/04/12 version v0.1 Cistercian numerals]
+\ProvidesPackage{cistercian}[2025/04/14 version v0.2 Cistercian numerals]
 
 \RequirePackage{tikz}
 \newlength{\cistercian at I}
 
 \tikzset{
+  code/.code={#1},
   /cistercian/.search also={/tikz,/pgf},
   /cistercian/.cd,
-  height/.store in   = \cistercian at height,
-  height             = \cistercian at I,
-  width/.store in    = \cistercian at width,
-  width              = \cistercian at height/3,
-  stroke/.store in   = \cistercian at stroke,
-  stroke             = \cistercian at height/10,
+  height/.store in      = \cistercian at height,
+  height                = \cistercian at I,
+  width/.store in       = \cistercian at width,
+  width                 = \cistercian at height/3,
+  stroke/.store in      = \cistercian at stroke,
+  stroke                = \cistercian at height/10,
 }
 
+\newcommand*{\cistercian at set}{}
+\newcommand{\cistercianset}[1]{%
+  \renewcommand*{\cistercian at set}{/cistercian/.cd,#1}
+}
+
 % #1: optional arguments to be passed to the tikzpicture
 % #2: number to be displayed
 \newcommand{\cistercian}[2][]{%
@@ -34,7 +40,7 @@
   \ifnum#2<10000
   \unless\ifnum#2<0
     \setlength{\cistercian at I}{\fontcharht\font`I}%
-    \begin{tikzpicture}[baseline,/cistercian/.cd,#1]%
+    \begin{tikzpicture}[baseline,/cistercian/.cd,code={\pgfkeysalsofrom\cistercian at set},#1]%
       %
       % store scaling factor
       \pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}%
@@ -61,6 +67,10 @@
       \cistercian at digit[xscale=-1]{\cistercian at tens}{\cistercian at ones}{\cistercian at scalingfactor*\cistercian at stroke}
       \cistercian at digit[yscale=-1,yshift=-\cistercian at height]{\cistercian at hundreds}{\cistercian at thousands}{\cistercian at scalingfactor*\cistercian at stroke}
       \cistercian at digit[xscale=-1,yscale=-1,yshift=-\cistercian at height]{\cistercian at thousands}{\cistercian at hundreds}{\cistercian at scalingfactor*\cistercian at stroke}
+      %
+      % debug
+      %\draw[red,line width=0.1pt] (0,0) rectangle (\cistercian at width,\cistercian at height);
+      %\draw[red,line width=0.1pt] (0,\cistercian at height) rectangle ++(\cistercian at width,-\cistercian at width-.5*\cistercian at stroke);
     \end{tikzpicture}%
   \fi\fi%
 }
@@ -71,69 +81,57 @@
 % #4: stroke width
 \newcommand{\cistercian at digit}[4][]{%
   % making sure all numerals have the same width
-  \path[#1,line width=#4] (0,0) -- (\cistercian at width,0);
+  \path[#1,line width=#4] (0,0) -- (\cistercian at width+.5*\cistercian at stroke,\cistercian at height);
+  %
   % drawing the stem for zero
-  \draw[#1,line width=#4] (0,.5*\cistercian at stroke) -- ++(0,\cistercian at height-\cistercian at stroke)
-  % adding features depending in the digit
-  \ifcase #2 \or % 1
-    -- ++(\cistercian at width,0)
+  \draw[#1,line width=#4,overlay] (0,.5*\cistercian at stroke) -- ++(0,\cistercian at height-\cistercian at stroke)
+  %  
+  \ifcase #2 
+  \or % 1
+    -- ++(\cistercian at width+.5*\cistercian at stroke,0)
   \or % 2
-    ++(0,-\cistercian at width) -- ++(\cistercian at width,0)
-    \ifnum3=#3%
+       ++(0,-\cistercian at width) 
+    -- ++(\cistercian at width+.5*\cistercian at stroke,0)
+  \or % 3
+    \ifnum3=#3
+      (-\cistercian at width,\cistercian at height-\cistercian at width-.5*\cistercian at stroke) -- (0,\cistercian at height) -- (\cistercian at width,\cistercian at height-\cistercian at width-.5*\cistercian at stroke)
     \else
-      (0,.5*\cistercian at stroke) -- (0,\cistercian at height)
-    \fi
-  \or % 3
-    % several special case to make sure the line joints with the other site of the number look nice
-    \ifnum1=#3%
-      ++(0,0) -- ++(.5*\cistercian at stroke,0)
-    \fi
-    \ifnum3=#3%
-      ++(-\cistercian at width,-\cistercian at width) -- ++(\cistercian at width,\cistercian at width)
-    \fi
-    \ifnum1=#3%
-      ++(-\cistercian at width,0) -- ++(\cistercian at width,0)
-    \fi
-    \ifnum5=#3%
-      ++(0,0) -- ++(.5*\cistercian at stroke,0)
-    \fi
-    \ifnum7=#3%
-      ++(0,0) -- ++(.5*\cistercian at stroke,0)
-    \fi
-    \ifnum9=#3%
-      ++(0,0) -- ++(.5*\cistercian at stroke,0)
-    \fi
-    -- (\cistercian at width,\cistercian at height-\cistercian at width-.5*\cistercian at stroke)
+      \ifodd#3
+        -- ++(.5*\cistercian at stroke,0) 
+      \fi
+      -- ++(\cistercian at width,-\cistercian at width)
+    \fi 
   \or % 4
-    ++(0ex,-\cistercian at width) -- ++(\cistercian at width,\cistercian at width)
-    \ifnum3=#3%
-    \else
-      (0,.5*\cistercian at stroke) -- (0,\cistercian at height)
-    \fi
+       ++(0,-\cistercian at width) 
+    -- ++(\cistercian at width,\cistercian at width)
   \or % 5
-    -- ++(\cistercian at width,0ex) -- ++(-\cistercian at width,-\cistercian at width)
+    -- ++(\cistercian at width,0) 
+    -- ++(-\cistercian at width,-\cistercian at width)
   \or % 6
-    ++(\cistercian at width,.5*\cistercian at stroke) -- ++(0ex,-\cistercian at width-.5*\cistercian at stroke)
-    \ifnum3=#3%
-    \else
-      (0,.5*\cistercian at stroke) -- (0,\cistercian at height)
-    \fi
+       ++(\cistercian at width,.5*\cistercian at stroke) 
+    -- ++(0,-\cistercian at width-.5*\cistercian at stroke)
   \or % 7
-    --  ++(\cistercian at width,0ex) -- ++(0,-\cistercian at width)
+    -- ++(\cistercian at width,0) -- ++(0,-\cistercian at width)
   \or % 8
     ++(0,-\cistercian at width) -- ++(\cistercian at width,0) -- ++(0,\cistercian at width+.5*\cistercian at stroke)
-    \ifnum3=#3%
-    \else
+  \or % 
+    -- ++(\cistercian at width,0) -- ++(0,-\cistercian at width) -- ++(-\cistercian at width,0) 
+  \fi
+  %
+  \ifnum#2>0
+    \unless\ifodd#2
+      \unless\ifodd#3
+        (0,.5*\cistercian at stroke) -- (0,\cistercian at height)
+      \fi
+    \fi
+  \else
+    \ifnum0=#3
       (0,.5*\cistercian at stroke) -- (0,\cistercian at height)
     \fi
-  \or % 9
-    --  ++(\cistercian at width,0ex) -- ++(0,-\cistercian at width) -- ++(-\cistercian at width,0)
-  \fi  
+  \fi
+  %
+  % close path
   ;
-  \ifnum0=#2%
-  \ifnum0=#3%
-    \draw[#1,line width=#4] (0,.5*\cistercian at stroke) -- ++(0,\cistercian at height-.5*\cistercian at stroke);
-  \fi\fi
 }
 
 % for \pagenumbering{cistercian}



More information about the tex-live-commits mailing list.