diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-19 19:59:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-19 19:59:58 +0000 |
commit | e3bf523e628a1e9ff7b3ba31de512c0b08406147 (patch) | |
tree | 0854bd0b8524e0f64d82f13fcc9ea3cc1446e222 /Master/texmf-dist/source | |
parent | 9779dc3d6af91c41ab3e004e56912cfb35d59b16 (diff) |
pm-isomath (19may21)
git-svn-id: svn://tug.org/texlive/trunk@59269 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/pm-isomath/pm-isomath.dtx | 451 |
1 files changed, 281 insertions, 170 deletions
diff --git a/Master/texmf-dist/source/latex/pm-isomath/pm-isomath.dtx b/Master/texmf-dist/source/latex/pm-isomath/pm-isomath.dtx index 466885491a9..61a4df91da1 100644 --- a/Master/texmf-dist/source/latex/pm-isomath/pm-isomath.dtx +++ b/Master/texmf-dist/source/latex/pm-isomath/pm-isomath.dtx @@ -50,14 +50,14 @@ This work consists of this file pm-isomath.dtx, a README.txt file % % \iffalse %^^A The following trick uses the same date for every file header. -%<style>\NeedsTeXFormat{LaTeX2e}[2017/01/01] +%<style>\NeedsTeXFormat{LaTeX2e}[2019/01/01] %<*driver> \ProvidesFile{pm-isomath.dtx}[% %</driver> %<style>\ProvidesPackage{pm-isomath}[% %<txt>\ProvidesFile{README.txt}[% %<*driver,style,txt> - 2021/05/03 v.1.1.01 + 2021/05/15 v.1.1.07 %<txt> README file for pm-isomath.sty] %<style>Poor man package for typesetting ISO compliant math when using pdfLaTeX] %</driver,style,txt> @@ -104,7 +104,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file %</driver> % \fi % -% \CheckSum{460}% +% \CheckSum{501}% % \begin{abstract} % The ISO regulations for typesetting math in the field of physics % and technology are pretty stringent and imply legal questions @@ -113,8 +113,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file % fulfil such regulations may be rejected by the Court, % independently from its expert contents. % -% Authors may not like them, but in the filed of \emph{applied -% sciences}, or better, of \emph{experimental sciences} that +% Authors may not like them, but in the field of \emph{applied +% sciences}, or better, of \emph{experimental sciences}, that % use measured quantities and units of measure, they are compulsory. % % With \LuaLaTeX\ and \XeLaTeX, while using OpenType math fonts @@ -129,8 +129,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file % \section{Introduction} % The ISO regulations (formerly ISO\,31/XI, now ISO\,80000) are % stringent rules to typeset mathematics in the domains of physics -% and applied sciences; their title explicitly mentions “physics -% and technology”, but their careful reading lets understand that +% and experimental sciences; their title explicitly mentions “physics +% and technology”, but their careful reading lets us understand that % they apply to all sciences that use the “mathematics of % quantities”. Such entities form a special group or space, % where the elements are couples of two ordered entities $(x, y)$, @@ -145,7 +145,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % is always accompanied by a certain degree of uncertainty; % metrologists are the masters in measuring quantities % and handling their measures and uncertainties, but although -% for simplicity measures are handled by lay people as rational +% for simplicity laypeople handles measures as if hey were rational % numbers (after all aren't they the ratio of something to be % measured and the unit of measure?) we are facing the domain % of fuzzy sets. @@ -156,13 +156,13 @@ This work consists of this file pm-isomath.dtx, a README.txt file % where the ISO regulations set some order and establish % a long list of named quantities with their preferred symbols % and their “normal” units according to the prescriptions -% of the Comité International des Pois et Mésures, that +% of the Comité International des Poids et Mesures, that % established the International System of measures -% (Systhème International, SI). +% (Système International, SI). % % This ISO nomenclature is used uniformly by most, if not all, % people involved in applied sciences; therefore among the few -% letters of the Latin and Greek alphabets almost none is free +% letters of the Latin and Greek alphabets almost none is available % to be used for other purposes. % % This means that the usual math italic alphabet can be used for @@ -186,8 +186,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % academic and/or research institutions. % % For private users I'd suggest to download the PDF document -% \url{https://www.nist.gov/pml/special-publication-811-extended- -%contents}. This document has been produced by the National +% \url{https://www.nist.gov/pml/special-publication-811-extended- contents}. This document has been produced by the National % Institute for Science and Technology, the Institution that % several years ago was appointed to replace the United States % National Bureau of Standards. Their staff is made essentially @@ -206,10 +205,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file % is not a limitation set forth by the underlying interpreter % \pdfTeX. Matter of fact there exists the quite recent % LibertinusT1math fonts for \pdfLaTeX, created by Michael Sharpe, -% that, to my best knowledge, are the only math fonts with 256 glyph -% encodings. Package |libertinust1math| accepts the |ISO| option +% that, to my best knowledge, are the only math 8-bit encoded fonts with 256 glyphs. Package |libertinust1math| accepts the |ISO| option % that allows to fulfil the ISO regulations; it accepts other -% options; depending on which options are specified the number +% options; depending on which ones are specified the number % of math groups, beyond the essential first four ones, increases % by three to six units, reaching a maximum of ten; there remains % enough free math groups to satisfy most user requirements. @@ -218,15 +216,15 @@ This work consists of this file pm-isomath.dtx, a README.txt file % suffers from another handicap derived from the knuthian % original \TeX-the-program and by the NFSS (New Font Selection % Scheme, which is not new any more, because it dates back to -% 1994, when \LaTeX\,209 became obsolete and was substituted +% 1994, when \LaTeX\,2.09 became obsolete and was substituted % by \LaTeXe.). I am not complaining about these \pdfTeX\ and % \LaTeX\ limitations; for decades people have been happily % typesetting math with results that are much superior to any % other typesetting program at least when the latter does not % use some \TeX\ software. % -% The handicap I am talking about is the way math alphabets, at -% the moment, are handled by \pdfTeX\ and \LaTeX; such alphabets +% By now, the handicap I am talking about is the way math alphabets +% are handled by \pdfTeX\ and \LaTeX; such alphabets % are loaded in the form of math groups, the number of which % cannot exceed 16 (numbered from 0 to 15); each group loads % three sizes for normal math style, for script style and for @@ -250,7 +248,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % sufficient to handle any situation, but it is not so. The % author of this extension already reached the limit of~16 % without doing anything special -- at least he thought so, -% but he was evidently wrong. Users who use packages such +% but evidently he was wrong. Users who use packages such % as the Fourier or the KPfonts have to pay special attention % to the package documentation because they might specify % options that imply loading up to 14 math groups. @@ -283,7 +281,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % \item % All quantity and variable symbols are represented by one % letter (with as many appositions are needed); but no acronyms -% are allowed; in computer science programming many strings +% are allowed; in computer science programming, many strings % are called variables, in the sense that they may represent % variable data; but computer programs are not mathematics, % rather they are a special language that tells the computer @@ -291,11 +289,11 @@ This work consists of this file pm-isomath.dtx, a README.txt file % one that represents math. Unfortunately some acronyms have % gained strong popularity and wide usage, but they are % forbidden by the ISO rules; example: \emph{CMRR} is often -% used to mean ``common mode rejection ratio'', but this is +% used to mean “common mode rejection ratio”, but this is % an improper usage of mathematics. Obviously this rule % must be applied by the user, because \LaTeX\ is a % typesetting language and does not understand the real -% meaning of what it typesets. +% meaning of what it is being typeset. % \item % All quantity symbols must be set in italics, slanted type % is allowed, but serifed italics should be preferred unless @@ -304,7 +302,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % with the physical quantity $d$; the Napier number ‘e’ must be % set in upright font to avoid confusion with the elementary % electric charge $e$; the imaginary unit j in electrical -% engineering, (i in other applied sciences) must be set in +% engineering, (i in other applied sciences) must be set in % upright font in order to avoid confusion with the electric % current density $j$ or the electric current $i$; more % difficult: the transcendental number $\ISOpi=3.14159\dots$ @@ -321,7 +319,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % subscript $i$ is a variable because it represents the $i$-th % element in a sequence, such as $V_0, V_1, V_2, \dots$; on % the opposite $V_{\mathrm{i}}$ the subscript is an apposition -% because `i' means, say, ‘input’. +% because ‘i’ may mean, say, ‘input’. % \item % Upright bold roman or black board bold symbols represent sets. % \item @@ -330,9 +328,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file % treated as any other matrix; in general multirow and multicolumn % matrices are typeset with uppercase letters, while lowercase % ones are reserved for vectors; but in some sciences also vectors -% may have uppercase letters. Geometrical vectors that might be -% typeset with a medium series upper o lowercase italic letter -% with an arrow on top of it are not treated by the ISO +% may be represented by uppercase letters. Geometrical vectors that +% might be typeset with a medium series upper or lowercase italic +% letter with an arrow on top of it, are not treated by the ISO % regulations that speak of vectors irrespective if they are % considered as one column matrices or oriented segments; % apparently oriented segments should be treated the same as @@ -343,9 +341,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file % medium series sans serif fonts; the same rule applies % to labels used in sketches and drawings representing % machinery, electric circuitry, and the like when the label -% refers to an object and not to its measure: ``the lens -% $\mathsf{L}_1$'', ``the switch $\mathsf{S}_2$'', ``the -% planetary gear $\mathsf{G}_3$'', and so on. +% refers to an object and not to its measure: “the lens +% $\mathsf{L}_1$, “the switch $\mathsf{S}_2$”, “the +% planetary gear $\mathsf{G}_3$”, and so on. % \item % Tensors should be set in slanted bold sans serif font. % \item @@ -353,19 +351,19 @@ This work consists of this file pm-isomath.dtx, a README.txt file % letters.\label{enum:latin-greek} %\end{enumerate} % -% Such font rules for families, series and shapes are difficult +% Such font rules for families, series and shapes are difficult % to implement with \pdfLaTeX\ for many reasons that do not imply % only the limited number of math groups, but also the categories % of symbols; Greek letters in particular are troublesome for a % couple of reasons connected with rule~\ref{enum:latin-greek}: %\begin{itemize}[noitemsep] %\item -% Uppercase greek letters are taken from the ``operators'' +% Uppercase greek letters are taken from the “operators” % alphabet and are letter symbols; they are upright; % but if they represent quantities they must be in italics, % or at least slanted; %\item -% Lowercase Greek letters are taken from the ``letters'' math alphabet +% Lowercase Greek letters are taken from the “letters” math alphabet % and are ordinary symbols; they are oblique, and this is fine, % but as ordinary math symbols they cannot be modified by commands % such as |\mathrm|; furthermore upright lowercase Greek letters @@ -377,9 +375,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file % Greek letters, especially those packages for French typography, % where the national rules (in contrast with the ISO regulations) % require that all math entities typeset with Greek letters be -% upright. Among such packages therenare |fourier| and |kpfonts|. Other -% packages such as |newpxmath| and |newtxmath| are intended for -% general use, but with suitable options and extra math groups +% upright. Among such packages there are |fourier| and |kpfonts|. +% Other packages such as |newpxmath| and |newtxmath| are intended +% for general use, but with suitable options and extra math groups % let the user employ upright lowercase Greek letters as well as % oblique uppercase ones. % @@ -391,7 +389,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % actually using extra math alphabets beyond the small number % it uses for its full functionality. An option |ISO| is % already available to fulfil the ISO regulations. Maybe -% the only drawback of the fonts used is that they are intended to +% the only drawback of such fonts is that they are intended to % match the Libertinus text fonts that are blacker than the % standard Computer or Latin Modern ones. The auxiliary font % selection commands used in the |ISOmath| package are already @@ -403,12 +401,12 @@ This work consists of this file pm-isomath.dtx, a README.txt file % there are no difficulties with the number of math groups. % % \section{The poor man solution} -% The poor man solution is very simple in theory; it handles -% text fonts in math expressions through the |\text| command -% provided by the |amsmath| package; of course there are functionalities -% to chose families series and shapes in a comfortable way -% by means of the powerful command definition commands provided -% by the |xparse| package; for Greek letters it uses the +% The poor man solution described in this document is very simple in +% theory; it handles text fonts in math expressions through the |\text| +% command provided by the |amsmath| package; of course there are +% functionalities to chose families series and shapes in a +% comfortable~way by means of the powerful command definition commands +% provided by the |xparse| package; for Greek letters it uses the % functionalities of the |alphabeta| package, that allows to use % in text mode the same control sequences that are used % in math mode. The default families for Latin and Greek letters @@ -423,22 +421,23 @@ This work consists of this file pm-isomath.dtx, a README.txt file % series and shape that family allows; the default % family for Greek fonts are the Latin Modern compliant % LGR encoded collection of CBfonts; they are always -% available with any up to date and complete \TeX\ system +% available with any up-to-date and complete \TeX\ system % installation. % % This is also a disadvantage, in the sense that Latin Modern % fonts might not be the best ones to use with any specific % text font; for example they have an x-height smaller than % the Palatino ones, and a larger `em' unit compared to the -% Times ones; they have also a slightly lighter `color' -% than most other fonts. +% Times ones; they have also a slightly lighter “color” +% compared to most other fonts. % % Nevertheless they work very well with the ISO regulations % and in spite of the disadvantages listed above, they are % usable without problems. This very documentation is typeset % with Latin Modern fonts. The examples shown in a following % section show the ease with which the ISO regulations may be -% fulfilled. +% fulfilled. Some problems, though, still remain, and require the +% user intervention. % % There are other Greek fonts that may be used in place of % those of the CBfonts collection, especially those distributed @@ -450,7 +449,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % family is sufficiently rich of series and shapes, and may be used % also for the Latin fonts. % -% There are also the Greek fonts that are ``companions'' to the +% There are also the Greek fonts that are “companions” to the % Times fonts. So the user is not limited to the Latin Modern % fonts, but admittedly there is not a great choice and, if it % is necessary, the disadvantage of an unmatching Greek font is @@ -482,8 +481,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file % argument are respectively |lmr|, |m|, and |n| (normal, upright). % Notice the codes: |lmr|, |m|, and |n| are the codes that appear in % the |.fd| file to declare the possible family, series, and shape -% combinations available for a given family. Below further -% information is given in table~\ref{tab:lmr-series-shapes} on +% combinations available for a given family. Further +% information is given below in table~\ref{tab:lmr-series-shapes} on % page~\pageref{tab:lmr-series-shapes}, and how to discover these codes. % % Such default values, after loading |pm-isomath|, may be globally @@ -511,8 +510,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file %\begin{ttsintassi} %\cs{ISO}\meta{lettername}\marg{family}\oarg{series}\parg{shape} %\end{ttsintassi} -% where all the arguments are optional, including the first in -% spite of being surrounded by curly braces. Such optional +% where all the arguments are optional, including the first one +% in spite of being surrounded by curly braces. Such optional % arguments must follow that order but all possible combinations % are usable, for example: %\begin{ttsintassi} @@ -520,9 +519,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file %\cs{ISOalpha}\marg{family} %\cs{ISOalpha}\oarg{series} %\cs{ISOalpha}\parg{shape} +%\cs{ISOalpha}\oarg{series}\parg{shape} %\cs{ISOalpha}\marg{family}\oarg{series} %\cs{ISOalpha}\marg{family}\parg{shape} -%\cs{ISOalpha}\oarg{series}\parg{shape} %\cs{ISOalpha}\marg{family}\oarg{series}\parg{shape} %\end{ttsintassi} % This offers the maximum flexibility in using the necessary @@ -588,6 +587,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file %\begin{verbatim} %\[ \vectorsymbol{b} = \matrixsymbol{M}\vectorsymbol{a} \] %\end{verbatim} +% % \subparagraph{A resistivity value} % The resistivity of copper is $1.68\,\micro\ohm\,\mathrm{cm}$ (in text mode: 1.68\unit{\micro\ohm\,cm}) % is typeset with the following code @@ -597,6 +597,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % If the |siunitx| package has been loaded (as it is for typesetting % this documentation) its unit |ohm| is redefined so as to always be % an upright capital omega. +% %\subparagraph{A tensor} %\[ \vectorsymbol{D} =\epsilon_0\tensorsymbol{\epsilon}\ped{r}\vectorsymbol{E}\] %is typeset with the following code @@ -605,8 +606,9 @@ This work consists of this file pm-isomath.dtx, a README.txt file %\vectorsymbol{D} = \epsilon_0\tensorsymbol{\epsilon}\ped{r}\vectorsymbol{E} %\] %\end{verbatim} +% %\subparagraph{Solid angle} -% An energy flux of light form a isomorphic source that irradiates +% An energy flux of light form an isomorphic source that irradiates % the power $P$ through the solid angle $\Omega$ generates % a flux \[\Phi = \frac{P}{\Omega}\] is typeset with the following % code @@ -616,6 +618,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % where, as you see the uppercase Greek letters are slanted, % as the ISO rules require, instead of upright, as \LaTeX\ sets % them by default. +% % \subparagraph{A bold formula} % This is the very important inverse Laplace transform\footnote{Some % packages may have a control sequence to insert a Cauchy principal @@ -635,6 +638,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % Notice the the use of |\boldmath| does not imply the use % of new math groups; but the bold upright $\ISOpi$ is rendered % without any problem. +% % \subparagraph{Various styles of Greek fonts} Here are some % examples of Greek fonts in various styles; within the same % table bold and medium series fonts stay side by side, as well @@ -662,29 +666,49 @@ This work consists of this file pm-isomath.dtx, a README.txt file % fonts at the moment available to typeset mathematics do not % contain an upright symbol, but they contain the original slanted % symbol as used with the CM fonts. With a poor-man trick it is -% possible ti have available an upright symbol so as to describe +% possible to have available an upright symbol so as to describe % the Electrical field as the opposite of the electric potential % gradient. Compare the following formulas, where the second one % is ISO compliant: %\begin{align} -%E =-\nabla V = -\left( -%\frac{\partial V}{\partial x}\MathLatin{e}[b](it)_x + -%\frac{\partial V}{\partial y}\MathLatin{e}[b](it)_y + -%\frac{\partial V}{\partial z}\MathLatin{e}[b](it)_z + +%\vectorsymbol{E} &=-\nabla V = -\left( +%\frac{\partial V}{\partial x}\vectorsymbol{e}_x + +%\frac{\partial V}{\partial y}\vectorsymbol{e}_y + +%\frac{\partial V}{\partial z}\vectorsymbol{e}_z %\right)\\[\baselineskip] -%E =-\nabla V = -\left( -%\frac{\uppartial V}{\uppartial x}\MathLatin{e}[b](it)_x + -%\frac{\uppartial V}{\uppartial y}\MathLatin{e}[b](it)_y + -%\frac{\uppartial V}{\uppartial z}\MathLatin{e}[b](it)_z + +%\vectorsymbol{E} &=-\nabla V = -\left( +%\frac{\uppartial V}{\uppartial x}\vectorsymbol{e}_x + +%\frac{\uppartial V}{\uppartial y}\vectorsymbol{e}_y + +%\frac{\uppartial V}{\uppartial z}\vectorsymbol{e}_z %\right) %\end{align} % %\section{Final remarks} % This package |pm-isomath| is far from perfect, and its results are -% questionable; of course poor man solutions are just patches; -% incomplete solutions; but the results are not so bad. It has +% questionable; of course poor man solutions are just patches, +% incomplete solutions; nevertheless the results are not so bad. It has % the indubitable advantage that is does not use any math groups, -% therefore there is no risk to exceed the limit of 16~math groups. +% therefore there is no risk to exceed their limit of 16~math groups. +% +% As patches are not perfect, the above display of examples shows +% what can be done without human intervention. Attentive users +% have shown that the commands for vectors, matrices, and command +% do not perform well in certain circumstances. Such cases require +% some spacing corrections, but we were not capable to create +% sufficiently intelligent commands that could avoid human +% intervention. See below where, when and why human intervention +% is required. +% +%\section{Acknowledgements} +% I want to thank very much Laurent Van Deik, who remarked several +% typos and bugs; in particular he convinced me that the partial +% differential symbol, that in my previous version of this package +% was obtained by rotating and scaling the slanted one, had a +% different style from the other math glyphs; therefore I recreated +% the macro by applying an affine shearing transformation; I believe +% that this new solution, thanks to Laurent Van Deik's suggestion, +% is better suited to typeset ISO compliant math in a better way. +% He also helped a lot with the vector, matrix, and tensor macro testing. % % \StopEventually{} % @@ -692,14 +716,15 @@ This work consists of this file pm-isomath.dtx, a README.txt file % This package was loosely inspired by the |ISOmath| package % by Günter Milde, but tackles the problem of insufficient maximum % number of math font groups so as to avoid any problem with such -% group limitation, and therefore all the caveats in Milde's package. +% group limitation, and therefore to avoid all the caveats in +% Milde's package. % % That package is much more comfortable to use than this one; but % it is subject to a number of conditions that, depending on the % user environment, may even result in a complete failure. This % package avoids problems with math font groups because it does -% not use any, but it is not so comfortable to use because often -% the user has to specify optional settings. +% not use any, but it is not so comfortable to use because sometimes +% optional settings and spacing commands have to be specified. % % The preliminary lines have been already defined; therefore we % start with real code. @@ -712,13 +737,13 @@ This work consists of this file pm-isomath.dtx, a README.txt file % |alphabeta| and |xparse| have already been loaded in the document % preamble; this implies a weak loading order, that is this % package must be loaded after all the above packages are loaded; -% in facts if such packages are not loaded, they get loaded by this +% in facts if such packages are not, they get loaded by this % one, but without any option. The package % loading mechanism assures avoiding conflicts if packages are % loaded without options; this is why if one of the three packages % is loaded after this one but with some option specified, an % “Option clash” error flag is raised; this is where the -% “weak” loading error becomes a very “strong” one. +% “weak” loading order error becomes a very “strong” one. %\iffalse %<*style> @@ -726,7 +751,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % Then we verify if the document is being typeset with \pdfLaTeX; % if it is not, an error flag is raised and reading of this % package is immediately interrupted. For this purpose we need -% an engine-detecting package, and we generally use the |iftex| one. +% an engine-detecting package, and we use the |iftex| one. % \begin{macrocode} \@ifpackageloaded{iftex}{}{\RequirePackage{iftex}} \unless\ifPDFTeX @@ -753,44 +778,38 @@ This work consists of this file pm-isomath.dtx, a README.txt file \fi {\endinput}{\relax} % \end{macrocode} +% % Actually this package accepts an option: |engineer|. This % option is for deciding if the imaginary unit should be -% defined as ‘i’ or ‘j’. As we have remarked in the previous +% defined as ‘i’ or as ‘j’. As we have remarked in the previous % documentation, engineers, especially those who deal with -% electricity and electrical quantities, but also electronics, control, -% and telecommunications engineers, use ‘j’; all these -% varieties of engineers could not do anything in their profession -% if they don't use complex numbers and quantities (the latter -% called phasors). Possibly they are the applied scientists +% electricity and electrical quantities, but also electronics, +% automatic control systems, and telecommunications engineers, use ‘j’; +% all these varieties of engineers could not do anything in their +% profession if they don't use complex numbers and quantities (the +% latter called phasors). Possibly they are the applied scientists % who use complex numbers more often than any other scientist. % -% Note: this option has \emph{not} been used to prepare this +% Notice: this option has \emph{not} been used to prepare this % very document. % \begin{macrocode} \newif\ifengineer \engineerfalse \DeclareOption{engineer}{\engineertrue} \ProcessOptions*\relax % \end{macrocode} +% % Are the necessary packages already loaded? Notice that in previous % versions we just loaded |xparse| unless it was already loaded; % since 2020 the main functionalities of this package are already -% contained into the \LaTeX\ kernel, But we are going to use one +% contained into the \LaTeX\ kernel, but we are going to use one % of those “deprecated” functionalities that did not make their way -% to the \LaTeX\ kernel. We also use the |xfp| floating point -% computations available with the \LaTeX3 language. +% to the \LaTeX\ kernel. % \begin{macrocode} \@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}} \@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}} -\RequirePackage{xparse,xfp} +\RequirePackage{xparse} % \end{macrocode} % -% Since a trick on the ISO compliant upright partial differential -% symbol requires the functionalities of the |rotate| and |scale| -% functionalities, we load also the |graphicx| package if it has not -% been already loaded. -% \begin{macrocode} -\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}} -% \end{macrocode} % Now we have almost all software instruments available. We % define a macro to switch the definitions of certain math % Greek symbols; some of these are defined in the \LaTeX\ @@ -800,19 +819,28 @@ This work consists of this file pm-isomath.dtx, a README.txt file % to the regular ones but prefixed with the string |var|; % example |\epsilon| and |\varepsilon|, |\Omega| and |\varOmega|. % We switch the control sequence definitions between the |var|-less -% ones and the |var|-prefixed ones. The first group of lowercase +% and the |var|-prefixed ones. The first group of lowercase % letters is switched because the glyphs give a better match with -% those produced with the textual Greek glyphs obtained when -% the ISO macros are used. +% those produced with the textual Greek glyphs obtained when the ISO +% macros are used. Especially the Greek lowercase letter group is +% not appreciated by certain users, because they need to correct +% any previously typeset document that uses the standard \LaTeX\ +% symbols. They may easily revert to the previous settings by +% applying again the global switching macros +% \cs{switchvarlowercasegreekletters} and or +% \cs{switchvaruppercasegreekletters}. We discourage such reset, +% but users are free to chose what they need. % \begin{macrocode} \newcommand\switchvarsymbols[1]{% \letcs{\tempA}{#1}\csletcs{#1}{var#1}\cslet{var#1}{\tempA}} -%%%% +%%%% +\newcommand\switchvarlowercasegreekletters{% \switchvarsymbols{epsilon} \switchvarsymbols{theta} \switchvarsymbols{rho} -\switchvarsymbols{phi} -%%%%% +\switchvarsymbols{phi}} +%%%% +\newcommand\switchvaruppercasegreekletters{% \switchvarsymbols{Gamma} \switchvarsymbols{Delta} \switchvarsymbols{Theta} @@ -823,19 +851,24 @@ This work consists of this file pm-isomath.dtx, a README.txt file \switchvarsymbols{Upsilon} \switchvarsymbols{Phi} \switchvarsymbols{Psi} -\switchvarsymbols{Omega} +\switchvarsymbols{Omega}} +%%%%% +\switchvarlowercasegreekletters +\switchvaruppercasegreekletters % \end{macrocode} -% Eventually we load the |alphabeta| package; this package +% +% Eventually we load the |alphabeta| package; it % allows using the same macros used in math mode while % typesetting in text mode. We find it very useful in this % package. % \begin{macrocode} \@ifpackageloaded{alphabeta}{}{\RequirePackage{alphabeta}} % \end{macrocode} +% % The next line defines the default family, series and shape -% to be used in the macros that follow; as it can be seen -% the default family is the Latin Modern regular (or roman); -% the series is medium and the shape is normal (or upright). +% to be used in the macros that follow; as it can be seen, +% the default family is the Latin Modern roman; +% the series is medium one and the shape is normal (or upright) one. % The codes used are the same used in the font description % files with extension |.fd|. The name of these |.fd| files % is obtained by merging the encoding name with the family name; @@ -844,7 +877,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % files define the series they contain and that are identified % with codes such as |m| (medium); |bx| (bold extended); % |b| (bold). Other fonts, with different series may have -% also other codes. For each series the |.fd| defines the +% also other codes. For each series the |.fd| file defines the % codes for shapes, and for every valid combination of % series, shape and size it defines the specific font file % to use. @@ -858,8 +891,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file % trees of the \TeX\ system, and eventually find out the % codes for the available series and shapes. % -% For the Latin and Greek |.fd| files we have the series and -% shapes shown in table~\ref{tab:lmr-series-shapes}. +% For the Modern Latin and Greek |.fd| files we have the series +% and shapes shown in table~\ref{tab:lmr-series-shapes}. % %\begin{table}[!tb]\centering %\begin{tabular}{llllll} @@ -892,7 +925,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % & & & & small caps & sc \\ %\bottomrule %\end{tabular} -%\caption{Seres and shapes available with the Latin Modern regular family with Latin and Greek fonts} +%\caption{Series and shapes available with the Latin Modern regular family with Latin and Greek fonts} %\label{tab:lmr-series-shapes} %\end{table} % @@ -900,7 +933,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file \def\ISOfam{lmr}\def\ISOser{m}\def\ISOsha{n} % \end{macrocode} % -% As explained in the initial documentation all font changing +% As explained in the initial documentation, all font changing % commands are constructed in such a way as to have a default % family, series and shape common to both Latin and Greek fonts; % therefore with three optional arguments that the user can @@ -926,15 +959,15 @@ This work consists of this file pm-isomath.dtx, a README.txt file % mandatory argument is the Latin or Greek letter; the latter % one may be specified by the macros |\alpha|, |\beta|,\dots, % |\Omega|, the same ones that are normally used in math (although -% they are going to be used in textmode). +% they are going to be used in text mode). % \begin{macrocode} -\NewDocumentCommand\MathLatin{m gO{m}D(){it}}{\bgroup -\edef\y{\IfNoValueTF{#2}{\ISOfam}{#2}}% -\edef\x{\noexpand\egroup\noexpand\MLatin{\noexpand#1}{\y}}\x{#3}{#4}} +\NewDocumentCommand\MathLatin{m g O{m} D(){it}}{% + \bgroup\edef\y{\IfNoValueTF{#2}{\ISOfam}{#2}}% + \edef\x{\noexpand\egroup\noexpand\MLatin{\noexpand#1}{\y}}\x{#3}{#4}% +} -\providecommand\MLatin[4]{\text{% -\def\ISOfam{#2}\def\ISOser{#3}\def\ISOsha{#4}% -\ifcsstring{math@version}{bold}{\def\ISOser{bx}}{}% +\providecommand\MLatin[4]{\text{\def\ISOfam{#2}\def\ISOsha{#4}% +\ifcsstring{math@version}{bold}{\def\ISOser{bx}}{\def\ISOser{#3}}% \usefont{T1}{\ISOfam}{\ISOser}{\ISOsha}#1}} \NewDocumentCommand\MathGreek{ m g O{m} d()}{% @@ -942,9 +975,8 @@ This work consists of this file pm-isomath.dtx, a README.txt file \edef\x{\IfNoValueTF{#4}{\ISOsha}{#4}}% \MGreek{#1}{\y}{#3}{\x}} -\newcommand{\MGreek}[4]{\text{% -\def\ISOfam{#2}\def\ISOser{#3}\def\ISOsha{#4}% -\ifcsstring{math@version}{bold}{\def\ISOser{bx}}{}% +\newcommand{\MGreek}[4]{\text{\def\ISOfam{#2}\def\ISOsha{#4}% +\ifcsstring{math@version}{bold}{\def\ISOser{bx}}{\def\ISOser{#3}}% {\usefont{LGR}{\ISOfam}{\ISOser}{\ISOsha}#1}}} % \end{macrocode} @@ -1018,21 +1050,82 @@ This work consists of this file pm-isomath.dtx, a README.txt file % slanted shape. % \begin{macrocode} \AtBeginDocument{% -\providecommand\mathbfit[1]{\MathLatin{#1}{lmr}[bx](it)} -\providecommand\mathsfit[1]{\MathLatin{#1}{lmss}[m](sl)} -\providecommand\mathsfbfit[1]{\MathLatin{#1}{lmss}[bx](sl)}} + \providecommand\mathrmbf[1]{\MathLatin{#1}{lmr}[bx](n)} + \providecommand\mathbfit[1]{\MathLatin{#1}{lmr}[bx](it)} + \providecommand\mathsfit[1]{\MathLatin{#1}{lmss}[m](sl)} + \providecommand\mathsfbfit[1]{\MathLatin{#1}{lmss}[bx](sl)} + \providecommand\mathsfbf[1]{\MathLatin{#1}{lmss}[bx](n)} +} % \end{macrocode} % Package |ISOmath| defines macros for typesetting vectors, % matrices and tensors; we do the same, but avoid the -% abbreviation |sym| in place of |symbol|. +% abbreviation |sym| and replace it with |symbol|. +% The strange test with the digit ‘9’ is a dirty trick (described in +% the \TeX\-book) in order to discover if the symbol is a digit or a +% letter; With digits the vector and tensor symbols should be upright, +% while with letters they should be italic or slanted. The italic +% correction |\/| contained by the font selection command is useful +% in situations where the “text” produced by such command is followed +% by a tall or raised object % \begin{macrocode} \AtBeginDocument{% -\let\vectorsymbol\mathbfit -\let\matrixsymbol\mathbfit -\let\tensorsymbol\mathsfbfit} + \unless\ifdefined\vectorsymbol + \NewDocumentCommand\vectorsymbol{s m}{% + \ifnum 9<1#2\relax + \mathrmbf{#2}% + \else + \IfBooleanTF{#1}{\!}{}\mathbfit{#2\/}% + \fi}% + \fi + \unless\ifdefined\matrixsymbol\let\matrixsymbol\vectorsymbol\fi + \unless\ifdefined\tensorsymbol + \NewDocumentCommand\tensorsymbol{s m}{% + \ifnum 9<1#2\relax + \mathsfbf{#2}% + \else + \IfBooleanT{#1}{\!}\mathsfbfit{#2\/}% + \fi}% + \fi +} % \end{macrocode} % -% We now define some macros for setting some elements in the +% As shown in the previous various examples, such macros work pretty +% well, but in some circumstances they require human help; +% when the symbol is parenthesised, for example when it is the +% argument of a function, or when it is at the beginning of a math +% sub\,expression, it is not centred between the parentheses or has +% extra blank space at its left; this happens only if the vector or +% tensor symbol is a letter, while if it is a digit such extra space +% does not appear; such considerations hold true also for the +% |\matrixsymbol| command. +% Therefore a negative math kerning is required at the left of the +% literal symbol. For this purpose such commands have the variant with +% asterisk, therefore their syntax have these two similar forms: +%\begin{flushleft}\obeylines +%|\vectorsymbol|\marg{symbol} +%|\vectorsymbol*|\marg{symbol} +%|\tensorsymbol|\marg{symbol} +%|\tensorsymbol*|\marg{symbol} +%\end{flushleft} +% where the asterisk can be used by the author in order to eliminate +% spurious left blanc spaces; if the symbol is numeric, the asterisk +% presence is ignored: see the following examples: +%\begin{quote} +%Vector $\vectorsymbol{T}$ is null: $\vectorsymbol{T}=\vectorsymbol{0}$\\ +%Vector $\vectorsymbol*{T}$ is null: $\vectorsymbol*{T}=\vectorsymbol*{0}$\\ +%Tensor $\tensorsymbol{T}$ is null: $\tensorsymbol{T}=\tensorsymbol{0}$\\ +%Tensor $\tensorsymbol*{T}$ is null: $\tensorsymbol*{T}=\tensorsymbol{0}$ +%\end{quote} +%They are typeset with the following code: +%\begin{verbatim} +%Vector $\vectorsymbol{T}$ is null: $\vectorsymbol{T}=\vectorsymbol{0}$\\ +%Vector $\vectorsymbol*{T}$ is null: $\vectorsymbol*{T}=\vectorsymbol*{0}$\\ +%Tensor $\tensorsymbol{T}$ is null: $\tensorsymbol{T}=\tensorsymbol{0}$\\ +%Tensor $\tensorsymbol*{T}$ is null: $\tensorsymbol*{T}=\tensorsymbol{0}$ +%\end{verbatim} +% +% +% We now define the macros required to set some elements with the % proper fonts; the idea is the same as that for vectors, % matrices and tensors, except that these macros produce % directly the desired symbol without using arguments, if @@ -1042,7 +1135,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file % switch, set with the proper option on calling the package. % If such option has been specified in calling this package, % the |\iu| command is let to |\junit|, otherwise it's let -% to |\iunit|. In spite of this option driven aliases, both +% to |\iunit|. In spite of this option-driven aliases, both % commands |\iunit| and |\junit| are still available to the % user. % @@ -1059,17 +1152,16 @@ This work consists of this file pm-isomath.dtx, a README.txt file % constants; we define just |\uppi| because we think it is the % most used symbol in any kind of mathematics. The % $\ISOpi{lmss}(n)$ Greek letter in upright sans serif font -% may indicate the subatomic particle ``pion'' so that a -% similar macro, say, |\sspi| or, more expressively, |\pion| -% may be given a suitable definition. +% may indicate the subatomic particle “pion” so that a +% similar macro, say, |\pion| may be given a suitable definition. % % The differential symbol is not an operator, but it requires % a special treatment; a macro |\diff| for the differential -% symbol uses an empty `operator' and a negative shift to typeset -% an upright letter `d' with an operator spacing on its left, +% symbol uses an empty ‘operator’ and a negative shift to typeset +% an upright letter ‘d’ with an operator spacing on its left, % so that proper spacing is used in math typesetting; notice % that the given definition does not perform as the direct -% use of a thin math space before the upright `d', because +% use of a thin math space before the upright ‘d’, because % spacing between math atoms depends on their category, while % the thin space |\,| is absolute and does not change depending % on the preceding math atom. @@ -1084,29 +1176,47 @@ This work consists of this file pm-isomath.dtx, a README.txt file % ISO regulations such symbol should be upright. For use with % \pdfLaTeX the only font distributed with any \TeX system that % contains such an upright symbol is the LibertinusT1math one; -% all other OMS encoded fonts do no contain it. The defined -% command |\uppartial| name is identical to the one used by the -% LibertinusT1math font; therefore it is easy to check if this -% symbol has already been defined +% all other OMS encoded fonts available today do no contain it. +% The defined command |\uppartial| name is identical to the one used +% by the LibertinusT1math font; therefore it is easy to check if +% this symbol has already been defined. % % On \texttt{tex.stachexchange.com} some questions were asked on % how to produce a suitable upright partial differential symbol, % when fonts did not have one available. The solutions we found -% there are based on rotating and scaling the available slanted -% partial differential symbol. We follow a similar approach, -% although a shearing process would be a better solution; -% we avoid to redefine this symbol if it is already available. -% The default counterclockwise rotation is fixed to 22°, but may -% be changed by means of an optional argument. Of course this +% in that site were of different kinds: some were based on rotating and +% scaling the available slanted sign, while others used a shearing +% affine transformation of the available partial differential +% symbol. We follow a similar approach, but we avoid to redefine +% this symbol if it is already available. The used commands +% \cs{pdfsave}, \cs{pdfrestore}, and \cs{pdfsetmatrix} are little +% known internal commands of the |pdftex| interpreter\footnote{See +% the documentation with \texttt{texdoc pdftex-a} at §8.20}; they are +% sort of intermediate between \TeX\ and the PDF internals; they +% are used to form something similar to a group, within which some +% PDF settings are locally modified; in this case an affine +% shearing transformation is defined by means of a matrix (apparently +% made up of one row and four columns, but in reality it represents +% the alignment of the rows of a $2\times2$ matrix) that can do +% many things in a way that is more comfortable for the programmer +% compared to writing the actual PDF language~code. +% +% The default \meta{shearing coefficient} is fixed to 0.25, but it may +% be changed by means of an optional argument; see below. Of course this % solution is a patch; we tested it at several sizes but only % with the Latin Modern Type~1 fonts. May be with other fonts -% the results might need some adjustments. +% the results might need some adjustments. We also fixed some +% kerning adjustments so that the normal math spacings take place. +% The whole syntax is the following +%\begin{flushleft} +%\cs{uppartial}\oarg{shearing coefficient} +%\end{flushleft} % % The command |\unit| for appending the units of measure to % the numerical value of the measure is added if no packages % have already defined it; package |siunitx| is a particularly % recommended one, but its units and prefixes expressed by means -% of greek letters must be used only within its |\si| and |SI| +% of Greek letters must be used only within its |\si| and |\SI| % commands. Similar considerations hold true for the % |\ap| and |\ped| (apex and pedex, respectively; i.e\ % superscript and subscript); therefore such command definitions @@ -1142,14 +1252,15 @@ This work consists of this file pm-isomath.dtx, a README.txt file \providecommand*\diff{} \renewcommand*\diff{\ensuremath{\mathop{}\!\MathLatin{d}(n)}} % -\newbox{\PMpartial} +\newbox{\PMpartialbox} \AtBeginDocument{% -\@ifdefinable{\uppartial}% - {\NewDocumentCommand\uppartial{O{22}}{\setbox\PMpartial\hbox{$\partial$}% - \setbox\PMpartial=\hbox{% - \scalebox{1}[\fpeval{cosd #1}]{\rotatebox[origin=br]{#1}{\box\PMpartial}}% - }\raisebox{0.35ex}{\box\PMpartial}\mkern-1.25mu}}% -} +\unless\ifdefined\uppartial% + \NewDocumentCommand\uppartial{O{0.25}}{\bgroup% + \setbox\PMpartialbox\hbox{% + $\mkern1mu\partial$}\hspace{1.3\wd\PMpartialbox}% + \pdfsave\pdfsetmatrix{1 0 -#1 1}\llap{\box\PMpartialbox}\pdfrestore + \mkern-1.5mu\egroup} +\fi} % \providecommand*\micro{} \AtBeginDocument{\@ifpackageloaded{textcomp}% @@ -1184,7 +1295,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file \endinput % \end{macrocode} -%This is the end +%^^A This is the end %\begin{center} %\LARGE HAPPY \TeX{}ing\,! %\end{center} @@ -1194,24 +1305,24 @@ This work consists of this file pm-isomath.dtx, a README.txt file %\iffalse %<*txt> %\fi -% \begin{macrocode} - - This bundle has the LPPL maintenance status "author-maintained". - - The list of all files belonging to the PM-ISOmath bundle is - pm-isomath.dtx, a README.txt file - with the derived files: pm-isomath.sty, pm-isomath.pdf. - - The set of derived (unpacked) files belonging to the distribution - and covered by LPPL is created by the self unpacking file - pm-isomath.dtx which is the principal part of the distribution. - - In the TDS composed of various branches they should be in the - following folders: - .../tex/latex/pm-isomath/ contains pm-isomath.sty - .../doc/latex/pm-isomath/ contains pm-isomath.pdf and README.txt - .../source/latex/pm-isomath contians pm-isomath.dtx -% \end{macrocode} +^^A% \begin{macrocode} +^^A +^^A This bundle has the LPPL maintenance status "author-maintained". +^^A +^^A The list of all files belonging to the PM-ISOmath bundle is +^^A pm-isomath.dtx, a README.txt file +^^A with the derived files: pm-isomath.sty, pm-isomath.pdf. +^^A +^^A The set of derived (unpacked) files belonging to the distribution +^^A and covered by LPPL is created by the self unpacking file +^^A pm-isomath.dtx which is the principal part of the distribution. +^^A +^^A In the TDS composed of various branches they should be in the +^^A following folders: +^^A .../tex/latex/pm-isomath/ contains pm-isomath.sty +^^A .../doc/latex/pm-isomath/ contains pm-isomath.pdf and README.txt +^^A .../source/latex/pm-isomath contians pm-isomath.dtx +^^A% \end{macrocode} %\iffalse %</txt> %\fi |