texlive[68382] Master/texmf-dist: non-decimal-units (27sep23)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 27 22:03:11 CEST 2023


Revision: 68382
          https://tug.org/svn/texlive?view=revision&revision=68382
Author:   karl
Date:     2023-09-27 22:03:11 +0200 (Wed, 27 Sep 2023)
Log Message:
-----------
non-decimal-units (27sep23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/non-decimal-units/README.md
    trunk/Master/texmf-dist/doc/latex/non-decimal-units/non-decimal-units.pdf
    trunk/Master/texmf-dist/doc/latex/non-decimal-units/non-decimal-units.tex
    trunk/Master/texmf-dist/tex/latex/non-decimal-units/non-decimal-units.sty

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.pdf
    trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.tex

Modified: trunk/Master/texmf-dist/doc/latex/non-decimal-units/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/non-decimal-units/README.md	2023-09-27 20:02:55 UTC (rev 68381)
+++ trunk/Master/texmf-dist/doc/latex/non-decimal-units/README.md	2023-09-27 20:03:11 UTC (rev 68382)
@@ -5,7 +5,7 @@
 
 See [non-decimal-units.pdf](docs/non-decimal-units.pdf) for the documentation.
 
-Contents last updated 2023-09-26.
+Contents last updated 2023-09-27.
 
 <!-- Package available via CTAN at https://www.ctan.org/pkg/non-decimal-units -->
 

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

Modified: trunk/Master/texmf-dist/doc/latex/non-decimal-units/non-decimal-units.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/non-decimal-units/non-decimal-units.tex	2023-09-27 20:02:55 UTC (rev 68381)
+++ trunk/Master/texmf-dist/doc/latex/non-decimal-units/non-decimal-units.tex	2023-09-27 20:03:11 UTC (rev 68382)
@@ -18,7 +18,7 @@
 
 \section{Preface} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Many historical unit systems were non-decimal. For example, the Danish rigsdaler\footnote{\url{https://en.wikipedia.org/wiki/Danish_rigsdaler}} --- where 1 \nduName{danish rigsdaler}{0} consists of \nduFactor{danish rigsdaler}{0} \nduName{danish rigsdaler}{1}, each again consisting of \nduFactor{danish rigsdaler}{1} \nduName{danish rigsdaler}{2} for a total of 96 \nduName{danish rigsdaler}{2} or  per \nduName{danish rigsdaler}{0} --- was used from 1625 to 1875, when currency was decimalised to the current system of 1 krone = 100 øre.
+Many historical unit systems were non-decimal. For example, the Danish rigsdaler\footnote{\url{https://en.wikipedia.org/wiki/Danish_rigsdaler}} --- where 1 \nduName{danish rigsdaler}{0} consists of \nduFactor{danish rigsdaler}{1}~\nduName{danish rigsdaler}{1}, each again consisting of \nduFactor{danish rigsdaler}{2}~\nduName{danish rigsdaler}{2} for a total of 96 \nduName{danish rigsdaler}{2} per \nduName{danish rigsdaler}{0} --- was used from 1625 to 1875, when currency was decimalised to the current system of 1 krone = 100 øre.
 
 % https://en.wikipedia.org/wiki/Non-decimal_currency
 
@@ -191,13 +191,13 @@
 		},
 		{
 			doc name = set aligned for environment,
-			doc description = {initially not set},
+			doc description = {initially set for \texttt{tabular}},
 		},
 	}
 
 	Setting \docAuxKey*{aligned} will format the presently displayed header in aligned boxes, desirable in tabular contexts.
 
-	In this document, the \docAuxKey*{set aligned for environment} key has been set for \texttt{tabular}, which means that all values in the tables are automatically aligned. It can be set multiple times, once for each required environment.
+	Additionally, the \docAuxKey*{set aligned for environment} key can be set to an environment name, causing \docAuxKey*{aligned} to automatically be set aligned for those enviroments, using \docAuxCommand*{AtBeginEnvironment}. It can be set multiple times, once for each required environment.
 
 \begin{dispExample*}{
 	title=Example usage: \docAuxCommand*{nduHeader} and \docAuxCommand*{nduValue} macros with \docAuxKey*{aligned} key.
@@ -249,7 +249,7 @@
 
 Basic arithmetic functions can be used to build a result for display. Internally, this is done by converting the value to a representation, which is the total number of the smallest usable unit, eg. \nduValue{danish rigsdaler}{1.2.3} is 131 \nduName{danish rigsdaler}{2}.
 
-Results can be gathered in two ways, either manually via the \docAuxCommand*{nduMath} macro, or automatically via the \docAuxKey*{add to variable} and \docAuxKey*{subtract from variable} keys, the latter being especially suitable in tabular contexts.
+Results can be gathered in two ways, either manually via the \docAuxCommand*{nduMath} macro, or automatically via the \docAuxKey{add to variable} and \docAuxKey{subtract from variable} keys, the latter being especially suitable in tabular contexts.
 
 \begin{docCommands}[]{
 	{
@@ -262,7 +262,7 @@
 	}
 }
 
-The first arguments of \docAuxCommand*{nduMath} are identical to those of the \refCom{nduValue} macro. In addition, it has \meta{operator} (one of \texttt{+ - * /}) and \meta{variable} arguments. The first time a variable is used, it is assumed that the value is 0. The given value is then converted to its internal representation and stored in the variable. The command does not expand to any output.
+The first arguments of \docAuxCommand*{nduMath} are identical to those of the \refCom{nduValue} macro. In addition, it has \meta{variable} and \meta{operator} (one of \texttt{+ - * /}) arguments. The first time a variable is used, it is assumed that the value is 0. The given value is then converted to its internal representation and stored in the variable. The command does not expand to any output.
 
 Note that mixing units in the same variable is not currently supported, and will likely give incorrect results.
 
@@ -339,8 +339,24 @@
 \end{dispExample}
 \end{docKeys}
 
-\subsection{Accessing Information About Units} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{docKey}
+	{normalize}
+	{}
+	{initially not set}
 
+Reformats an amount, which is useful for quick conversions.
+
+\begin{dispExample*}{
+	title=Example usage: \docAuxKey*{normalize} key
+}
+100 \nduName{danish rigsdaler}{2} equal
+\nduValue{danish rigsdaler}[normalize]{..100} % 1.0.4
+\end{dispExample*}
+\end{docKey}
+
+
+\section{Accessing Information About Units} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \begin{docCommand}
 	{nduName}
 	{\marg{unit name}\marg{segment}}

Deleted: trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.tex	2023-09-27 20:02:55 UTC (rev 68381)
+++ trunk/Master/texmf-dist/doc/latex/non-decimal-units/test.tex	2023-09-27 20:03:11 UTC (rev 68382)
@@ -1,232 +0,0 @@
-% !TEX TS-program = LuaLaTeX-shell-escape
-\documentclass{article}
-\usepackage{trace}
-
-\usepackage{non-decimal-units.preamble}
-
-%\nduset{logging}
-
-\makeatletter
-
-\begin{document}
-
-
-\nduNewMacro{rigsdaler.mark.skilling}
-	[unit groups/rigsdaler.mark.skilling,segment 0/symbol={R\textsuperscript{dl}}]
-	{myRdl}
-\myRdl{1.2.3}
-
-\end{document}
-
-\nduValue{sletdaler.mark}{1.2}%
-
-
-%\traceon
-\nduValue{sletdaler.mark}[restrict segment depth=2]{1.2}%
-%\traceoff
-
-%\end{document}
-
-
-\nduValue{danish rigsbankdaler}{.120}
-
-
-normalize 120 skilling = \nduValue{danish rigsdaler}[
-	normalize,
-	treat zero as nil,
-]{..120} = 1.1.8
-
-
-\nduValue{danish rigsbankdaler}{.100}
-
-\nduValue{sletdaler.mark}{1.2}%
-
-\rbd{1.2} = 1.2
-
-\rbd{.100} = 1.4
-
-\rdl{..120} = 1.1.8
-
-
-
-%\end{document}
-
-\nduAliasOrGroup{danish rigsbankdaler} == \nduAliasOrGroup{rigsbankdaler.skilling}
-
-\nduValue{danish rigsbankdaler}{50.10} == \nduValue{rigsbankdaler.skilling}{50.10}
-
-\begingroup
-\nduset{
- 	aliases/danish sletdaler,
-	restrict segment depth=2,
-}
-
-\nduset{
-	unit groups/sletdaler.mark.skilling.penning/restrict segment depth=2,
-}
-\endgroup
-
-\nduValue{danish rigsdaler}[
-	restrict segment depth=2,
-	segment separator=!,
-]{1..3} = 1!3
-
-\nduValue{sletdaler.mark.skilling}[
-	restrict segment depth=2,
-	segment separator=!,
-]{1..2} = 1!2
-
-
-factor: \pgfkeysvalueof{/ndu/base units/rigsdaler/factors/ort}
-
-factor: \pgfkeysvalueof{/ndu/base units/rigsdaler/factors/mark}
-
-factor: \pgfkeysvalueof{/ndu/base units/tønde/factors/skæppe}
-
-
-%\nduFactor{danish rigsdaler}{0}
-
-\nduFactor{danish rigsdaler}{1} \nduSymbol{danish rigsdaler}{1} per \nduSymbol{danish rigsdaler}{0}
-
-\nduFactor{danish rigsdaler}{2} \nduSymbol{danish rigsdaler}{2} per \nduSymbol{danish rigsdaler}{1}
-
-\nduFactor{danish rigsdaler}{3} \nduSymbol{danish rigsdaler}{3} per \nduSymbol{danish rigsdaler}{2}
-
-%\nduFactor{danish rigsdaler}{4} \nduSymbol{danish rigsdaler}{4} per \nduSymbol{danish rigsdaler}{3}
-
-%\end{document}
-
-
-\section{Aligned math test}
-
-	testing with 1.2.3.4 = 1*6*16*12 + 2*16*12 + 3*12 + 4 = 1576
-
-	\csdef{ndu at repr@TEST}{0}
-	init as 0: \csuse{ndu at repr@TEST}
-
-	\nduConvertToRepr at helper{danish rigsdaler}{TEST}{0}{1}
-	no conv, add rdl: 0 + 1 = 1 --- is \csuse{ndu at repr@TEST}
-	
-	\nduConvertToRepr at helper{danish rigsdaler}{TEST}{1}{2}
-	conv to mk, add mk: 1*6 + 2 = 8 --- is \csuse{ndu at repr@TEST}
-	
-	\nduConvertToRepr at helper{danish rigsdaler}{TEST}{2}{3}
-	conv to sk, add sk: 8*16 + 3 = 131 --- is \csuse{ndu at repr@TEST}
-	
-	\nduConvertToRepr at helper{danish rigsdaler}{TEST}{3}{4}
-	conv to pg, add pg: 131*12 + 4 = 1576 --- is \csuse{ndu at repr@TEST}
-	
-	\nduConvertToRepr at helper{danish rigsdaler}{TEST}{4}{0}
-	no conv, no add: --- is \csuse{ndu at repr@TEST}
-
-\nduResult{danish rigsdaler}{TEST}
-
-
-\nduValue{danish rigsdaler}[replace nil with=---]{1..3} = 1.---.3.---
-
-\nduValue{danish rigsdaler}{1..3} = 1..3
-
-\nduValue{danish rigsdaler}{1.2.3} = 1.2.3
-
-\nduConvertToRepr{danish rigsdaler}{baz}{1.2.3.4} 1.2.3.4 =
-baz: \nduResult{danish rigsdaler}{baz}
-
-\nduConvertToRepr{danish rigsdaler}{foo}{1.2.3} 1.2.3 =
-foo: \nduResult{danish rigsdaler}{foo}
-
-foo with local zero as nil: \nduResult{danish rigsdaler}[treat zero as nil]{foo}
-
-Setting depth to 2
-
-\traceon
-\nduset{
-%	unit groups/rigsdaler.mark.skilling.penning/restrict segment depth=2,
-	aliases/danish rigsdaler,
-	restrict segment depth=2,
-}
-\traceoff
-
-\nduConvertToRepr{danish rigsdaler}{zap}{1.2.3.4} 1.2.3.4 =
-zap: \nduResult{danish rigsdaler}{zap}
-
-\nduConvertToRepr{danish rigsdaler}{bar}{1.2.3} 1.2.3 =
-bar: \nduResult{danish rigsdaler}{bar}
-
-
-\section{Zero test}
-
-should be 1.0.1: \nduValue{danish rigsdaler}{1.0.1}
-
-should be 1..1: \nduValue{danish rigsdaler}[treat zero as nil]{1.0.1}
-
-
-\section{Math test}
-
-\nduMath{danish rigsdaler}{math}{+}{..8}
-\nduResult{danish rigsdaler}{math}
-
-\nduMath{danish rigsdaler}{math}{+}{..8}
-\nduResult{danish rigsdaler}{math}
-
-\nduMath{danish rigsdaler}{math}{+}{..9}
-\nduResult{danish rigsdaler}{math}
-
-\nduMath{danish rigsdaler}{math}{-}{..8}
-\nduResult{danish rigsdaler}{math} = 0.1.1
-
-\nduMath{danish rigsdaler}{math}{+}{..8}
-\nduResult{danish rigsdaler}{math} = 0.1.9
-
-\nduMath{danish rigsdaler}{math}{*}{2}
-\nduResult{danish rigsdaler}{math} = 0.3.2
-
-\section{Aligned math test}
-
-\begingroup
-\nduset{
-	aligned,
-	cell width=3em,
-	replace nil with=---,
-	treat zero as nil,
-	add to variable=example 2
-}
-\begin{tabular}{r r}
-	\toprule
-	& \nduHeader{danish rigsdaler} \\
-	\midrule
-	a & \nduValue{danish rigsdaler}{1.2.3} \\
-	b & \nduValue{danish rigsdaler}{100.1.} \\
-	c & \nduValue{danish rigsdaler}{0..15} \\
-	\bottomrule
-	total & \nduResult{danish rigsdaler}{example 2} \\
-\end{tabular}  = 101.4.2
-\endgroup
-
-\end{document}
-
-Does not work because 1 ort = 1.5 mark
-
-\section{All coins test}
-
-\nduMath{danish rigsdaler all coins}{all coins}{+}{..10}
-\nduResult{danish rigsdaler all coins}{all coins}
-
-\nduMath{danish rigsdaler all coins}{all coins}{+}{...100}
-\nduResult{danish rigsdaler all coins}{all coins}
-
-\nduMath{danish rigsdaler all coins}{all coins}{+}{.5}
-\nduResult{danish rigsdaler all coins}{all coins}
-
-\nduMath{danish rigsdaler all coins}{all coins}{+}{....10}
-\nduResult{danish rigsdaler all coins}{all coins} = XXXX
-
-\end{document}
-
-segment depth: \pgfkeysvalueof{/ndu/aliases/danish rigsdaler/segment depth}
-
-restrict segment depth: \pgfkeysvalueof{/ndu/aliases/danish rigsdaler/restrict segment depth}
-
-segment depth: \pgfkeysvalueof{/ndu/unit groups/sletdaler.mark.skilling/segment depth}
-
-restrict segment depth: \pgfkeysvalueof{/ndu/unit groups/sletdaler.mark.skilling/restrict segment depth}
-

Modified: trunk/Master/texmf-dist/tex/latex/non-decimal-units/non-decimal-units.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/non-decimal-units/non-decimal-units.sty	2023-09-27 20:02:55 UTC (rev 68381)
+++ trunk/Master/texmf-dist/tex/latex/non-decimal-units/non-decimal-units.sty	2023-09-27 20:03:11 UTC (rev 68382)
@@ -1,4 +1,4 @@
-\ProvidesPackage{non-decimal-units}[2023/09/26 Macros for displaying and manipulating historical non-decimal units]
+\ProvidesPackage{non-decimal-units}[2023/09/27 Macros for displaying and manipulating historical non-decimal units]
 
 % License: CC-BY-SA 4.0
 % Author: Mikkel Eide Eriksen <mikkel.eriksen at gmail.com>



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