diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-07 21:26:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-07 21:26:34 +0000 |
commit | 5eb5c2bd75077417694f9ca3e361d48456d5aec5 (patch) | |
tree | ba68a6b3e3d763b2e65e6aff70b6f406ece6b0e6 | |
parent | de3f4265bc7c8c0a53616804c4d9e03dc39a0b47 (diff) |
isphysicalmath (6jan24)
git-svn-id: svn://tug.org/texlive/trunk@69334 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/isphysicalmath/README.md | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/isphysicalmath/isphysicalmath-doc.pdf | bin | 104769 -> 122194 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.dtx | 437 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/isphysicalmath/isphysicalmath.sty | 168 |
5 files changed, 538 insertions, 118 deletions
diff --git a/Master/texmf-dist/doc/latex/isphysicalmath/README.md b/Master/texmf-dist/doc/latex/isphysicalmath/README.md index af03bf862fa..f4b21a8e316 100644 --- a/Master/texmf-dist/doc/latex/isphysicalmath/README.md +++ b/Master/texmf-dist/doc/latex/isphysicalmath/README.md @@ -5,7 +5,7 @@ Author: Mario Fantini, <marfant7@gmail.com> License: LaTeX Project Public License lppl -Copyright (c) 2023 Mario Fantini +Copyright (c) 2024 Mario Fantini --- @@ -18,15 +18,15 @@ If you are interested in the form of math and physics, here comes `isphysicalmat as far as international scientific notation and formatting of formulas, quantities, numerical values, factors, dimensions, measurement units. -So, `isphysicalmath` package helps user to write mathematical and physical contents, - according to the scientific notation (international mainly), in an elegant way. +So, isphysicalmath` package helps user to write mathematical and physical contents, +according to the scientific notation (international mainly), in an elegant way. # Dependencies -`isphysicalmath` has not dependencies. +`isphysicalmath` has xstring package dependency. -Internally, it uses standard commands like: \textnormal, \hspace{}; however, +Internally, it uses standard commands like: \textnormal, \hspace{}, \,; however, it performs its activity in complex math environment too. @@ -54,6 +54,8 @@ The documentation is `isphysicalmath-doc.pdf` mainly. It contains: - option 'comma' + - command 'comma' + - isphysicalmath url - Copyright @@ -61,22 +63,6 @@ The documentation is `isphysicalmath-doc.pdf` mainly. It contains: - Change History -# Build isphysicalmath.sty -``` -cd isphysicalmath -latex isphysicalmath.ins -``` - -# Build the documentation - -``` -cd isphysicalmath -latex isphysicalmath.dtx -makeindex -s gglo.ist -o isphysicalmath.gls isphysicalmath.glo -latex isphysicalmath.dtx -dvipdf isphysicalmath.dvi -``` - # Credits Thanks to all TeX/LaTeX contributors, in particular to Scott Pakin @@ -86,12 +72,16 @@ and services. # URL -Package home URL: https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath +Package home URL: + +https://ctan.org/pkg/isphysicalmath + +https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath # License -Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license @@ -111,3 +101,14 @@ This work consists of the files isphysicalmath.dtx and isphysicalmath.ins and the derived file isphysicalmath.sty. +# Change History + +- v1.0.0 + +2023.09.18 First version. + + +- v1.1.0 + +2024.01.03 improvements have been brought, see isphysicalmath-doc.pdf. + diff --git a/Master/texmf-dist/doc/latex/isphysicalmath/isphysicalmath-doc.pdf b/Master/texmf-dist/doc/latex/isphysicalmath/isphysicalmath-doc.pdf Binary files differindex d69e59aec52..ef449a6d1d9 100644 --- a/Master/texmf-dist/doc/latex/isphysicalmath/isphysicalmath-doc.pdf +++ b/Master/texmf-dist/doc/latex/isphysicalmath/isphysicalmath-doc.pdf diff --git a/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.dtx b/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.dtx index a95d88e6610..48dad58b76f 100644 --- a/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.dtx +++ b/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.dtx @@ -29,31 +29,156 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] %<package>\ProvidesPackage{isphysicalmath} %<*package> -[2023/09/18 v1.0.0 .dtx isphysicalmath file] +[2024/01/03 v1.1.0 .dtx isphysicalmath file] %</package> -%<package>% option [dc]: changes dots in commas. +%<package>\RequirePackage{xstring} +%<package>% +%<package>% Notation section: +%<package>% option [dc]: changes dots in commas (\ispmc), or commas in dots (\ispmrc). %<package>\DeclareOption{dc}{ -%<package>\def\ispmdc#1.#2{{#1,#2}} +%<package>\def\ispmc#1.#2{{#1,#2}} +%<package>\def\ispmrc#1,#2{{#1.#2}} %<package>} -%<package>% option [comma]: scientific international notation for thousands. +%<package>% +%<package>% option [comma]: scientific international notation for thousands and their multiples. %<package>\DeclareOption{comma}{ -%<package> \def\ispmnovem#1#2#3#4#5#6#7#8#9{#1#2#3,#4#5#6,#7#8#9} -%<package> \def\ispmocto#1#2#3#4#5#6#7#8{#1#2,#3#4#5,#6#7#8} -%<package> \def\ispmseptem#1#2#3#4#5#6#7{#1,#2#3#4,#5#6#7} -%<package> \def\ispmsex#1#2#3#4#5#6{#1#2#3,#4#5#6} -%<package> \def\ispmquinque#1#2#3#4#5{#1#2,#3#4#5} -%<package> \def\ispmquattuor#1#2#3#4{#1,#2#3#4} +%<package>\def\ispmc#1{% +%<package>\StrLen{#1}[\temp]% +%<package>\ifnum\temp=4% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\unoq,\dueq\treq\quattroq% +%<package>\fi% +%<package>\ifnum\temp=5% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq% +%<package>\fi% +%<package>\ifnum\temp=6% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq% +%<package>\fi% +%<package>\ifnum\temp=7% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +%<package>\fi% +%<package>\ifnum\temp=8% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +%<package>\fi% +%<package>\ifnum\temp=9% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\StrChar{#1}{9}[\noveq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +%<package>\fi% +%<package>} %<package>} %<package>\ExecuteOptions{dc} %<package>\ExecuteOptions{comma} %<package>\ProcessOptions\relax -%<package>% space between value and measurement unit -%<package>\newcommand{\ispms}{\hspace{0.5mm}} +%<package>% +%<package>% command \ispmcomma: scientific international notation for thousands and their multiples. +%<package>\newcommand{\ispmcomma}[1]{% +%<package>\StrLen{#1}[\temp]% +%<package>\ifnum\temp=4% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\unoq,\dueq\treq\quattroq% +%<package>\fi% +%<package>\ifnum\temp=5% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq% +%<package>\fi% +%<package>\ifnum\temp=6% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq% +%<package>\fi% +%<package>\ifnum\temp=7% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +%<package>\fi% +%<package>\ifnum\temp=8% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +%<package>\fi% +%<package>\ifnum\temp=9% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\StrChar{#1}{9}[\noveq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +%<package>\fi% +%<package>} +%<package>% +%<package>% +%<package>% Formatting section: +%<package>% a small space between value and measurement unit +%<package>\newcommand{\ispms}{\,} %<package>% normal text rendering for first measurement unit %<package>\newcommand{\ispmntone}[1]{\textnormal{#1}} -%<package>% jolly: the default setting is --- normal text rendering for a generic 'entity'. +%<package>% jolly: the default setting consists in --- a $0.15\ispmone{mm}$ of space +%<package>% and normal text rendering for a generic 'entity'. %<package>% If you are a developer, you can modify it when and how you want. -%<package>\newcommand{\ispm}[1]{\textnormal{#1}} +%<package>\newcommand{\ispm}[1]{\hspace{0.15mm}\textnormal{#1}} %<package>% normal text rendering for first and second measurement units %<package>\newcommand{\ispmnttwo}[2]{\textnormal{#1}\textnormal{#2}} %<package>% space between first and second measurement units @@ -64,14 +189,21 @@ %<package>% \ispm if you have two measurement units %<package>% e.g. $L = 20 \ispmtwo{N}{m}$ %<package>\newcommand{\ispmtwo}[2]{\ispms\ispmnttwo\ispmss{#1}\ispmnttwo\ispmss{#2}} -%<package>% normal text rendering for third measurement unit -%<package>\newcommand{\ispmntr}[1]{\textnormal{#1}} %<package>% ispm if you have three measurement units %<package>% e.g. $V = 8 \ispmtwo{m}{m}\ispmthird{m}$ -%<package>\newcommand{\ispmthird}[1]{\ispmss\ispmntr{#1}} +%<package>\newcommand{\ispmthird}[1]{\ispmss\ispm{#1}} +%<package>% and so on until ninth measurement unit +%<package>\newcommand{\ispmfourth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmfifth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmsixth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmseventh}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmeighth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmninth}[1]{\ispmss\ispm{#1}} +%<package>% If you don't want numerical order, you could use generic \ispmn command +%<package>\newcommand{\ispmn}[1]{\ispmss\ispm{#1}} %<*driver> \documentclass{ltxdoc} -\usepackage{isphysicalmath}[2023/09/18] +\usepackage{isphysicalmath}[2024/01/03] \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} @@ -83,13 +215,10 @@ \renewcommand*\contentsname{General index}% \tableofcontents% \clearpage} - \EnableCrossrefs \CodelineIndex -\RecordChanges \begin{document} - \DocInput{isphysicalmath.dtx} - \PrintChanges +\DocInput{isphysicalmath.dtx} \end{document} %</driver> % \fi @@ -110,10 +239,6 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% -% -%\changes{v1.0.0}{2023/09/18}{Initial version} -% %\indice % %\GetFileInfo{isphysicalmath.dtx} @@ -152,19 +277,20 @@ %\textsl{isphysicalmath} acting is valid too. % %\section{Dependencies} -% \textsl{isphysicalmath} has not dependencies. +%\label{sec:dependencies} +%\textsl{isphysicalmath} has \textsl{xstring} package dependency. % %Internally, it uses standard \LaTeX{} built-in commands like: \texttt{\textbackslash textnormal}, -%\texttt{\textbackslash hspace\{\}}; +%\texttt{\textbackslash hspace\{\}}, \texttt{\textbackslash ,}; % however, it performs its activity in complex math environment too. %\newpage %\section{Usage} -% +%\label{sec:usage} %\DescribeMacro{\ispm} % -%\textit{hp.} It is a jolly command. The default setting substitutes the famous -% \LaTeX{} built-in command \texttt{\textbackslash textnormal}, in other words -% \texttt{\textbackslash textnormal} is the value of \texttt{\textbackslash ispm} +%\textit{hp.} It is a jolly command. +%The default setting consists in --- a $0.15\ispmone{mm}$ of space and normal text rendering for a generic 'entity'. +%In other words <\texttt{\textbackslash textnormal}> and <0.15mm> are the values of \texttt{\textbackslash ispm} % variable. So, if you are a developer you can modify this variable how and when you want. % I use it for generic ``entities''. \\ %\textit{th.} Default setting: normal text rendering for a generic ``entity''.\\ @@ -202,33 +328,59 @@ %|\ispmone|\marg{the second %measurement unit in place of the II argument (denominator)} %|\ispmthird|\marg{third measurement unit in place of III argument} \\ \\ % +%\DescribeMacro{ ~\ } And so on until ninth measurement unit, having: \\ +%\DescribeMacro{\ispmfourth}\\ +%\DescribeMacro{\ispmfifth} \\ +%\DescribeMacro{\ispmsixth}\\ +%\DescribeMacro{\ispmseventh} \\ +%\DescribeMacro{\ispmeighth} \\ +%\DescribeMacro{\ispmninth} ~\ \\ \\ +%\DescribeMacro{\ispmn} +% +%If you don't want to follow a numerical order, you can use this command. +% +%\textit{hp.} You have three measurement units. \\ +%\textit{th.} Horizontal space between the first measurement unit +%and numerical value, horizontal space between the first +%measurement unit and the second %measurement unit, horizontal space between +%the second measurement unit and third measurement unit; normal text +%rendering for all the measurement units.\\ +%|\ispmtwo|\marg{the first measurement unit in place of the I argument}\marg{the second +%measurement unit in place of the II argument}% +%|\ispmn|\marg{third measurement unit in place of III argument} \\ +% Or, e.g. if you have a fraction [see In-depth formatting' +%(\autoref{subsec:inDepthFormatting})]:\\ +%|\ispmone|\marg{the first measurement unit in place of the I argument (numerator)} +%|\ispmn|\marg{the second %measurement unit in place of the II argument (denominator)} +%|\ispmn|\marg{third measurement unit in place of III argument} \\ \\ +% +% %\begin{environment}{dc} % option \textit{dc} \\ %\textbackslash usepackage\oarg{dc}\{isphysicalmath\} \\ % -%$\forall x,y, \ldots \in \mathbb{N}$:\\ -%|\ispmdc| \meta{x.y} \\ +%$\forall x,y,\ldots,+\infty \in \mathbb{N}$:\\ +%|\ispmc| \meta{x.y} \\ +%|\ispmrc| \meta{x,y} \\ %\end{environment} % %\begin{environment}{comma} % option \textit{comma} \\ %\textbackslash usepackage\oarg{comma}\{isphysicalmath\} \\ % -%$\forall a,b,c,d,e,f,g,h,i \in \mathbb{N}$: \\ -%|\ispmnovem| \meta{abcdefghi} \\ -%|\ispmocto| \meta{abcdefgh} \\ -%|\ispmseptem| \meta{abcdefg} \\ -%|\ispmsex| \meta{abcdef} \\ -%|\ispmquinque| \meta{abcde} \\ -%|\ispmquattuor| \meta{abcd} \\ +%$\forall a,b,c,d,e,f,g,h,i \in \mathbb{N}$ [0,9]: \\ +%|\ispmc|\{abcdefghi\} \\ +%|\ispmc|\{abcdefghi\}.aa \\ %\end{environment} %\newpage % \section{In-depth usage} %\subsection{In-depth formatting} %\label{subsec:inDepthFormatting} +% \textsl{isphysicalmath} command, in mathematical environments, can be joined or detached to previous term; +%while, in not mathematical environments, \textsl{isphysicalmath} command must be joined to previous term. \\ \\ % \textsl{isphysicalmath} automatical settings: % \begin{itemize} -% \item 0.5\ispmone{mm} between numerical value and first +% \item a small space between numerical value and first % measurement unit, <<first>> if there are others. % \item 0.15\ispmone{mm} between two or three % measurement units, or between measurement units and their factors. @@ -261,6 +413,7 @@ % \item With one measurement unit. % % \[F = 1 \ispmone{N}\] +% \[P = 1 \ispmone{bar}\] % % The code: %\begin{center} @@ -268,6 +421,7 @@ %\[ %F = 1 \ispmone{N} %\] +%\[P = 1 \ispmone{bar}\] %\end{verbatim} %\end{center} % @@ -378,49 +532,86 @@ %\end{verbatim} %\end{center} % +%\item With inner mathematical environments (e). +% +%\[ +%P_p = (V_{cls})(\gamma_{cls}) = (29.6\ispmone{m$^3$})\Big(25\frac{\ispmone{kN}}{\ispmone{m$^3$}}\Big) = 740 \ispmone{kN} +%\] +% +%The code: +%\begin{center} +%\begin{verbatim} +%\[ +%P_p = (V_{cls})(\gamma_{cls}) = (29.6\ispmone{m$^3$}) +%\Big(25\frac{\ispmone{kN}} +%{\ispmone{m$^3$}}\Big) = 740 \ispmone{kN} +%\] +%\end{verbatim} +%\end{center} +% %\item About physical quantities dimensions. % %e.g. %\[ -%F = m a = \ispmtwo{[M]}{[L]}\ispmthird{[T$^{-2}$]} +%F = m a \equiv \ispmtwo{[M]}{[L]}\ispmthird{[T]$^{-2}$} %\] %The code: %\begin{center} %\begin{verbatim} -%F = m a = \ispmtwo{[M]}{[L]}\ispmthird{[T$^{-2}$]} +%F = m a \equiv \ispmtwo{[M]}{[L]}\ispmthird{[T]$^{-2}$} +%\end{verbatim} +%\end{center} +% +%\item Final example. +% +%e.g. +%\[1\ispmtwo{a}{b}\ispmthird{c}\ispmfourth{d}\ispmfifth{e}\ispmsixth{f}\ispmseventh{g}\ispmeighth{h}\ispmninth{i}\] +%\[1\ispmone{a}\ispmn{b}\ispmn{c}\ispmn{d}\ispmn{e}\ispmn{f}\ispmn{g}\ispmn{h}\ispmn{i}\] +%The code: +%\begin{center} +%\begin{verbatim} +%\[1\ispmtwo{a}{b}\ispmthird{c}\ispmfourth{d}\ispmfifth{e} +%\ispmsixth{f}\ispmseventh{g}\ispmeighth{h}\ispmninth{i}\] +% +%\[1\ispmone{a}\ispmn{b}\ispmn{c}\ispmn{d}\ispmn{e} +%\ispmn{f}\ispmn{g}\ispmn{h}\ispmn{i}\] %\end{verbatim} %\end{center} +% %\end{itemize} %\end{description} % %\newpage %\subsection{In-depth notation} -% -%Option \textsl{dc} and option \textsl{comma} are compatible, -%you can use both in the same document; e.g.: \\ -%\texttt{\textbackslash usepackage[comma, dc]\{isphysicalmath\}} \\ -%\begin{center} -% 1,234 \\ -% 1,234,567 -%\end{center} +%\label{subsec:in-depthNotation} +%Option \textsl{dc} and option \textsl{comma} are not compatible, but you can use option \textsl{dc} and +%\texttt{\textbackslash ispmcomma} command, both in the same document. \\ \\ +%\texttt{\textbackslash usepackage[dc]\{isphysicalmath\}} \\ +%\texttt{\textbackslash usepackage[comma]\{isphysicalmath\}} \\ \\ +%In a document by \textsl{dc} option: \\ +%1,234 \\ \\ +%In an other document by \textsl{comma} option: \\ +%1,234,567 \\ \\ +%Both in the same document, by \textsl{dc} option and \texttt{\textbackslash ispmcomma} command:\\ +%1,234 1,234,567 \\ \\ %The code: %\begin{verbatim} -%\ispmdc 1.234 \\ -%\ispmseptem 1234567 +%\ispmc 1.234 \\ +%\ispmc{1234567} \\ +%\ispmc 1.234 \ispmcomma{1234567} %\end{verbatim} % %\subsubsection{option <dc>} -% +%\label{subsubsec:optionDc} %\textsl{Usage}: \texttt{\textbackslash usepackage[dc]\{isphysicalmath\}} \\ % %The code of this option is not mine, it already exists in \LaTeX{} literature, % I discovered it in \tiny\url{https://en.wikibooks.org/wiki/LaTeX}\normalsize. \\ % -%This option changes dots in commas. It is useful for some users who don't +%This option by \texttt{\textbackslash ispmc} changes dots in commas. It is useful for some users who don't %use scientific international notation. It is convenient for users who %respect scientific international notation, so they change dots -%in commas to select thousands and not to separate the unit from -%negative numbers. \\ +%in commas to select thousands and not to express numbers under the unit. \\ % %e.g. %\begin{center} @@ -429,48 +620,97 @@ %The code: %\begin{center} %\begin{verbatim} -%\ispmdc 1.234 +%\ispmc 1.234 %\end{verbatim} %\end{center} +%~\ \\ +%This option by \texttt{\textbackslash ispmrc} changes commas in dots. It is useful for some users who want to +%use scientific international notation. It is convenient for users who +%respect scientific international notation, so they change commas +%in dots to express numbers under the unit. \\ % -%\subsubsection{option <comma>} +%e.g. +%\begin{center} +% 1,234 becomes 1.234 +%\end{center} +%The code: +%\begin{center} +%\begin{verbatim} +%\ispmrc 1,234 +%\end{verbatim} +%\end{center} % +%\subsubsection{option <comma>} +%\label{subsubsec:optionComma} %\textsl{Usage}: \texttt{\textbackslash %\{usepackage\}[comma]\{isphysicalmath\}} \\ % %It adds comma after every three digits, according to international %scientific notation. % -%For this task there are six ispm commands, in the next \textsl{isphysicalmath} -%version I'll automate this goal introducing one single ispm command. \\ %\begin{center} % 100,000,000 \\ -% 10,000,000 \\ -% 1,000,000 \\ -% 100,000 \\ -% 10,000 \\ -% 1,000 +% 100,000,000.00\\ +% 10,000,000.00 \\ +% 1,000,000.00 \\ +% 100,000.00 \\ +% 10,000.00 \\ +% 1,000.00 %\end{center} % %The code: %\begin{center} %\begin{verbatim} -%\ispmnovem 100000000 \\ -%\ispmocto 10000000 \\ -%\ispmseptem 1000000 \\ -%\ispmsex 100000 \\ -%\ispmquinque 10000 \\ -%\ispmquattuor 1000 +%\ispmc{100000000} \\ +%\ispmc{100000000}.00 \\ +%\ispmc{10000000}.00 \\ +%\ispmc{1000000}.00 \\ +%\ispmc{100000}.00 \\ +%\ispmc{10000}.00 \\ +%\ispmc{1000}.00 +%\end{verbatim} +%\end{center} +%\subsubsection{command <comma>} +%\label{subsubsec:commandComma} +%\textsl{Usage}: \texttt{\textbackslash +%\{usepackage\}[dc]\{isphysicalmath\}} \\ +%or \\ +%\texttt{\textbackslash \{usepackage\}\{isphysicalmath\}} \\ +%It adds comma after every three digits, according to international +%scientific notation. +% +%\begin{center} +% 100,000,000 \\ +% 100,000,000.00\\ +% 10,000,000.00 \\ +% 1,000,000.00 \\ +% 100,000.00 \\ +% 10,000.00 \\ +% 1,000.00 +%\end{center} +% +%The code: +%\begin{center} +%\begin{verbatim} +%\ispmcomma{100000000} \\ +%\ispmcomma{100000000}.00 \\ +%\ispmcomma{10000000}.00 \\ +%\ispmcomma{1000000}.00 \\ +%\ispmcomma{100000}.00 \\ +%\ispmcomma{10000}.00 \\ +%\ispmcomma{1000}.00 %\end{verbatim} %\end{center} %\newpage % %\section{isphysicalmath url}% -%Package home URL: \tiny \url{https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath} \normalsize% +%Package home URL: +%\tiny \url{https://ctan.org/pkg/isphysicalmath} \\ +%\url{https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath} \normalsize% % %\section{Copyright} % -%Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +%Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> % %This file may be distributed and/or modified under the conditions of %the \LaTeX\ Project Public License, either version 1.3 of this license @@ -486,5 +726,52 @@ % % This work consists of the files isphysicalmath.dtx and isphysicalmath.ins % and the derived file isphysicalmath.sty. +%\section{Change history} +%\subsection{v1.0.0} +%2023.09.18 First version. +%\subsection{v1.1.0} +%2024.01.03 Following improvements have been brought: +%\begin{enumerate} +%\item \autoref{sec:dependencies} changed. +%\item URL \tiny \url{https://ctan.org/pkg/isphysicalmath} \normalsize specified. +%\item Original \textsl{comma} option changed in command, and new \textsl{comma} option \texttt{\textbackslash ispmc} added. +%\item Example added in \autoref{subsec:inDepthFormatting}. +%\item Doc \textsl{dc} option improved in \autoref{sec:usage}. +%\item \textsl{dc} option changed in \texttt{\textbackslash ispmc}. +%\item \textsl{dc} option improved adding \texttt{\textbackslash ispmrc} to change commas in dots. +%\item Doc \textsl{comma} option improved in \autoref{sec:usage}. +%\item Doc \textsl{comma} option changed in \autoref{subsec:in-depthNotation}. +%\item Option \textsl{comma} improved, now the goal is reached by a single command. +%\item \autoref{subsubsec:optionComma} changed. +%\item \autoref{subsubsec:commandComma} added. +%\item Following commands added: +%\begin{itemize} +% \item \texttt{\textbackslash ispmfourth}; +% \item \texttt{\textbackslash ispmfifth}; +% \item \texttt{\textbackslash ispmsixth}; +%\item \texttt{\textbackslash ispmseventh}; +%\item \texttt{\textbackslash ispmeighth}; +%\item \texttt{\textbackslash ispmninth}; +%\item \texttt{\textbackslash ispmn}. +%\end{itemize} +%\item Example `With inner mathematical environments (e)' added in \autoref{subsec:inDepthFormatting}. +%\item Example `Final example' added in \autoref{subsec:inDepthFormatting}. +%\item \autoref{subsubsec:optionDc} changed. +%\item \texttt{\textbackslash ispm} command changed, so \autoref{sec:usage} changed. +%\item `About physical quantities dimensions' (\autoref{subsec:inDepthFormatting}) improved. +%\item Clarified in \autoref{subsec:inDepthFormatting} when to join or to detach formatting commands to previous term. +%\item Year of the copyright modified. +%\item README.md: +%\begin{itemize} +%\item Year of the copyright modified. +%\item `Change History' added. +%\item `URL' modified. +%\item `Documentation' modified. +%\item `Dependencies' modified. +%\item `Build the documentation' removed. +%\item `Build isphysicalmath.sty' removed. +%\end{itemize} +%\end{enumerate} +% % \Finale \endinput diff --git a/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.ins b/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.ins index c4b638a7b3a..2cbd19533c8 100644 --- a/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.ins +++ b/Master/texmf-dist/source/latex/isphysicalmath/isphysicalmath.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +%% Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license diff --git a/Master/texmf-dist/tex/latex/isphysicalmath/isphysicalmath.sty b/Master/texmf-dist/tex/latex/isphysicalmath/isphysicalmath.sty index 8de492a4f9d..c16db962b60 100644 --- a/Master/texmf-dist/tex/latex/isphysicalmath/isphysicalmath.sty +++ b/Master/texmf-dist/tex/latex/isphysicalmath/isphysicalmath.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +%% Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -22,30 +22,155 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{isphysicalmath} -[2023/09/18 v1.0.0 .dtx isphysicalmath file] -% option [dc]: changes dots in commas. +[2024/01/03 v1.1.0 .dtx isphysicalmath file] +\RequirePackage{xstring} +% +% Notation section: +% option [dc]: changes dots in commas (\ispmc), or commas in dots (\ispmrc). \DeclareOption{dc}{ -\def\ispmdc#1.#2{{#1,#2}} +\def\ispmc#1.#2{{#1,#2}} +\def\ispmrc#1,#2{{#1.#2}} } -% option [comma]: scientific international notation for thousands. +% +% option [comma]: scientific international notation for thousands and their multiples. \DeclareOption{comma}{ - \def\ispmnovem#1#2#3#4#5#6#7#8#9{#1#2#3,#4#5#6,#7#8#9} - \def\ispmocto#1#2#3#4#5#6#7#8{#1#2,#3#4#5,#6#7#8} - \def\ispmseptem#1#2#3#4#5#6#7{#1,#2#3#4,#5#6#7} - \def\ispmsex#1#2#3#4#5#6{#1#2#3,#4#5#6} - \def\ispmquinque#1#2#3#4#5{#1#2,#3#4#5} - \def\ispmquattuor#1#2#3#4{#1,#2#3#4} +\def\ispmc#1{% +\StrLen{#1}[\temp]% +\ifnum\temp=4% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\unoq,\dueq\treq\quattroq% +\fi% +\ifnum\temp=5% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\unoq\dueq,\treq\quattroq\cinqueq% +\fi% +\ifnum\temp=6% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\unoq\dueq\treq,\quattroq\cinqueq\seiq% +\fi% +\ifnum\temp=7% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +\fi% +\ifnum\temp=8% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\StrChar{#1}{8}[\ottoq]% +\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +\fi% +\ifnum\temp=9% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\StrChar{#1}{8}[\ottoq]% +\StrChar{#1}{9}[\noveq]% +\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +\fi% +} } \ExecuteOptions{dc} \ExecuteOptions{comma} \ProcessOptions\relax -% space between value and measurement unit -\newcommand{\ispms}{\hspace{0.5mm}} +% +% command \ispmcomma: scientific international notation for thousands and their multiples. +\newcommand{\ispmcomma}[1]{% +\StrLen{#1}[\temp]% +\ifnum\temp=4% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\unoq,\dueq\treq\quattroq% +\fi% +\ifnum\temp=5% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\unoq\dueq,\treq\quattroq\cinqueq% +\fi% +\ifnum\temp=6% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\unoq\dueq\treq,\quattroq\cinqueq\seiq% +\fi% +\ifnum\temp=7% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +\fi% +\ifnum\temp=8% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\StrChar{#1}{8}[\ottoq]% +\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +\fi% +\ifnum\temp=9% +\StrChar{#1}{1}[\unoq]% +\StrChar{#1}{2}[\dueq]% +\StrChar{#1}{3}[\treq]% +\StrChar{#1}{4}[\quattroq]% +\StrChar{#1}{5}[\cinqueq]% +\StrChar{#1}{6}[\seiq]% +\StrChar{#1}{7}[\setteq]% +\StrChar{#1}{8}[\ottoq]% +\StrChar{#1}{9}[\noveq]% +\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +\fi% +} +% +% +% Formatting section: +% a small space between value and measurement unit +\newcommand{\ispms}{\,} % normal text rendering for first measurement unit \newcommand{\ispmntone}[1]{\textnormal{#1}} -% jolly: the default setting is --- normal text rendering for a generic 'entity'. +% jolly: the default setting consists in --- a $0.15\ispmone{mm}$ of space +% and normal text rendering for a generic 'entity'. % If you are a developer, you can modify it when and how you want. -\newcommand{\ispm}[1]{\textnormal{#1}} +\newcommand{\ispm}[1]{\hspace{0.15mm}\textnormal{#1}} % normal text rendering for first and second measurement units \newcommand{\ispmnttwo}[2]{\textnormal{#1}\textnormal{#2}} % space between first and second measurement units @@ -56,11 +181,18 @@ % \ispm if you have two measurement units % e.g. $L = 20 \ispmtwo{N}{m}$ \newcommand{\ispmtwo}[2]{\ispms\ispmnttwo\ispmss{#1}\ispmnttwo\ispmss{#2}} -% normal text rendering for third measurement unit -\newcommand{\ispmntr}[1]{\textnormal{#1}} % ispm if you have three measurement units % e.g. $V = 8 \ispmtwo{m}{m}\ispmthird{m}$ -\newcommand{\ispmthird}[1]{\ispmss\ispmntr{#1}} +\newcommand{\ispmthird}[1]{\ispmss\ispm{#1}} +% and so on until ninth measurement unit +\newcommand{\ispmfourth}[1]{\ispmss\ispm{#1}} +\newcommand{\ispmfifth}[1]{\ispmss\ispm{#1}} +\newcommand{\ispmsixth}[1]{\ispmss\ispm{#1}} +\newcommand{\ispmseventh}[1]{\ispmss\ispm{#1}} +\newcommand{\ispmeighth}[1]{\ispmss\ispm{#1}} +\newcommand{\ispmninth}[1]{\ispmss\ispm{#1}} +% If you don't want numerical order, you could use generic \ispmn command +\newcommand{\ispmn}[1]{\ispmss\ispm{#1}} \endinput %% %% End of file `isphysicalmath.sty'. |