diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-12 22:41:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-12 22:41:34 +0000 |
commit | f7669a5c50eb09a4bbc24749b2358081fc008a66 (patch) | |
tree | e2947320c5b44e2e8c58c430ffabc5a4b5931875 /Master/texmf-dist/source/latex/SIstyle/sistyle.dtx | |
parent | d80b07e0e893dbfd60b9066eb5301370e7dbef3c (diff) |
SIstyle 2.1
git-svn-id: svn://tug.org/texlive/trunk@1829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/SIstyle/sistyle.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/SIstyle/sistyle.dtx | 124 |
1 files changed, 97 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/SIstyle/sistyle.dtx b/Master/texmf-dist/source/latex/SIstyle/sistyle.dtx index 5598727e1fb..4805e97aeb7 100644 --- a/Master/texmf-dist/source/latex/SIstyle/sistyle.dtx +++ b/Master/texmf-dist/source/latex/SIstyle/sistyle.dtx @@ -1,31 +1,37 @@ -% \iffalse (meta-comment) -% ----------------------------------------------------------------- +% \iffalse +% ------------------------------------------------------------------- +% The SIstyle package +% for SI units and number typesetting +% ------------------------------------------------------------------- +% % File: sistyle.dtx % Author: Danie Els (dnjels@sun.ac.za) % -% This file is part of the SIstyle package. +% Documentation and Source file for this package to use with LaTeX2e % -% Copyright 2004 by Danie Els. All rights reserved. +% Copyright (C) 2004-2006 Danie Els +% All rights reserved. % % This work may be distributed and/or modified under the conditions -% of the LaTeX Project Public License, either version 1.3 of this +% of the LaTeX Project Public License, either version 1.3c of this % license or (at your option) any later version. The latest version % of the license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2003/12/01 or later. +% http://www.latex-project.org/lppl +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. % -% This work has the LPPL maintenance status "author-maintained". +% This Current Maintainer of this work is Danie Els (dnjels@sun.ac.za) % -% ----------------------------------------------------------------- -% This file contains the documentations and source code for the -% SIstyle package for use with LaTeX2e. See the file 'readme.txt' +% This package consists of the files sistyle.dtx and sistyle.ins as +% well as the derived file sistyle.sty. See the file 'readme.txt' % for a list of all the files as well as directions for the % installation of this package. -% ----------------------------------------------------------------- +% ------------------------------------------------------------------- % \fi % -% \CheckSum{0} +% \CheckSum{767} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -51,7 +57,7 @@ %<package>\ProvidesPackage{sistyle} %<driver>\ProvidesFile{sistyle.drv} %\ProvidesFile{sistyle.dtx} - [2004/07/09 v2.0 SI units and numbers (DNJ Els)] + [2006/07/11 v2.1 SI units and numbers (DNJ Els)] %<*driver> \documentclass[a4paper]{ltxdoc} \usepackage{calc} @@ -83,6 +89,8 @@ % % \changes{v1.0}{2004/02/01}{Initial version} % \changes{v2.0}{2004/07/09}{Better display math detection with \cs{displaywidth}} +% \changes{v2.1}{2004/07/09}{Add user definable commands for \cs{mathrm}, \cs{mathsf}, \cs{mathtt}} +% % % \DoNotIndex{\,} % \DoNotIndex{\., \;} @@ -646,6 +654,20 @@ % package can be changed. The following commands are provided: % % \begin{cmddef}[ll] +% \cmd{\SImathrm}\marg{math font command} & |[|default: |{\mathrm} ]|\\ +% \cmd{\SImathsf}\marg{math font command} & |[|default: |{\mathsf} ]|\\ +% \cmd{\SImathtt}\marg{math font command} & |[|default: |{\mathtt} ]| +% \end{cmddef} +% +% \vspace{-\topsep} +% \begin{itemize} +% \item\cmd{\SImathrm}: Sets the default math serif font. +% \item\cmd{\SImathsf}: Sets the default math sanserif font. +% \item\cmd{\SImathtt}: Sets the default math typewriter font. +% \end{itemize} +% \vspace{-\topsep} +% +% \begin{cmddef}[ll] % \cmd{\SIdefaultMfam}\marg{math font command} & |[|default: |{\mathrm} ]|\\ % \cmd{\SIdefaultNfam}\marg{math font command} & |[|default: |{\mathrm} ]|\\ % \cmd{\SIdefaultTfam}\marg{text font family} & |[|default: |{\rmfamily}]| @@ -655,7 +677,7 @@ % \begin{itemize} % \item\cmd{\SIdefaultMfam}: Sets the default math font of the units. % \item\cmd{\SIdefaultNfam}: Sets the default math font of the numbers. -% \item\cmd{\SIdefaultTfam}: Set the default text font when text +% \item\cmd{\SIdefaultTfam}: Sets the default text font when text % components are included with the units (e.g., from the % \pkg{textcomp} package) % \end{itemize} @@ -888,10 +910,34 @@ % which work both in text and math mode. Note that \pkg{SIstyle} typeset % all its symbols in math mode which will cause \pkg{gensymb} to provide % only math symbols. The result is that only the \cmd{\mathrm} versions -% of the symbols are then output in a document, thereby ingnoring the +% of the symbols are then output in a document, thereby ignoring the % font changing mechanism of \pkg{SIstyle}. % % +% +% \subsection{\pkg{arev}} +% +% The \pkg{arev} sanserif font has a slanted math sanserif font. To get an upright +% math font the \cmd{\mathrm} font must be used in place of \cmd{\mathsf}. The +% package \pkg{textcomp} is included inside \pkg{arev}, but it do not give the +% proper symbol for \pkg{arev}. We can use the \cmd{\textmu} symbol from the +% BeraSans typewriter font loaded internaly by \pkg{arev} +% +% \begin{Item}{Example} +% \begin{Itabb} +% |\usepackage{arev}|\\ +% |\usepackage{sistyle}|\\ +% | \SImathsf{\mathrm}|\\ +% | \SIdefaultTfam{\sffamily}|\\ +% | \newcommand*{\micro}{\ensureupmath{\text{\ttfamily\textmu}}}|\\ +% | \newcommand*{\ohm}{\ensureupmath{\Omega}}|\\ +% | \newcommand*{\degC}{\ensureupmath{{}^{\circ}\kern-\scriptspace C}}|\\ +% | \newcommand*{\degF}{\ensureupmath{{}^{\circ}\kern-\scriptspace F}}| +% \end{Itabb} +% \end{Item} +% +% +% %^^A================================================================= % \clearpage % \part{Typesetting SI Units}\label{prt:SI} @@ -1003,8 +1049,8 @@ % $(\SI{}{\degC})$.'' % % \begin{figure}[!b] -% \sbox{\tboxa}{\includegraphics{fig1}}^^A -% \sbox{\tboxb}{\includegraphics{fig2}}^^A +% \sbox{\tboxa}{\includegraphics{figs/fig1}}^^A +% \sbox{\tboxb}{\includegraphics{figs/fig2}}^^A % \setlength{\tdima}{\wd\tboxa}^^A % \addtolength{\tdima}{\wd\tboxb}^^A % \addtolength{\tdima}{1em}^^A @@ -1397,13 +1443,37 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\SI@mathrm} +% \begin{macro}{\SI@mathsf} +% \begin{macro}{\SI@mathtt} +% \begin{macro}{\SImathrm} +% \begin{macro}{\SImathsf} +% \begin{macro}{\SImathtt} +% Make user commands to override \cmd{\mathrm}, \cmd{\mathsf} +% and \cmd{\mathtt}, +% \begin{macrocode} +\newcommand*{\SI@mathrm}{\mathrm} +\newcommand*{\SI@mathsf}{\mathsf} +\newcommand*{\SI@mathtt}{\mathtt} +\newcommand*{\SImathrm}[1]{\renewcommand*{\SI@mathrm}{#1}} +\newcommand*{\SImathsf}[1]{\renewcommand*{\SI@mathsf}{#1}} +\newcommand*{\SImathtt}[1]{\renewcommand*{\SI@mathtt}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% % \begin{macro}{\SIdefaultMfam} % \begin{macro}{\SI@defaultMfam} % The default upright math font for typesetting SI units. This % is normally the \cmd{\mathrm} command, but the user may select % a different font. % \begin{macrocode} -\newcommand*{\SI@defaultMfam}{\mathrm} +\newcommand*{\SI@defaultMfam}{\SI@mathrm} \newcommand*{\SIdefaultMfam}[1]{\renewcommand*{\SI@defaultMfam}{#1}} % \end{macrocode} % \end{macro} @@ -1415,7 +1485,7 @@ % a different font, for example \cmd{\mathnormal} to obtain % old-style digits. % \begin{macrocode} -\newcommand*{\SI@defaultNfam}{\mathrm} +\newcommand*{\SI@defaultNfam}{\SI@mathrm} \newcommand*{\SIdefaultNfam}[1]{\renewcommand*{\SI@defaultNfam}{#1}} % \end{macrocode} % \end{macro} @@ -1465,10 +1535,10 @@ \ifmmode \ifdim\displaywidth>0pt\relax%--- DISPLAY MATH ------------ \ifnum\the\fam=\SI@sffam - \let\SI@mfam=\mathsf + \let\SI@mfam=\SI@mathsf \let\SI@tfam=\sffamily \else \ifnum\the\fam=\SI@ttfam - \let\SI@mfam=\mathtt + \let\SI@mfam=\SI@mathtt \let\SI@tfam=\ttfamily \else \let\SI@mfam=#1% @@ -1478,10 +1548,10 @@ {\def\SI@bold{\mdseries}}% \else%--- INLINE MATH ---------- \ifx\f@family\temp@sf - \let\SI@mfam=\mathsf + \let\SI@mfam=\SI@mathsf \let\SI@tfam=\sffamily \else\ifx\f@family\temp@tt - \let\SI@mfam=\mathtt + \let\SI@mfam=\SI@mathtt \let\SI@tfam=\ttfamily \else \let\SI@mfam=#1% @@ -1492,10 +1562,10 @@ \fi \else%----- NORMAL TEXT -------------- \ifx\f@family\temp@sf - \let\SI@mfam=\mathsf + \let\SI@mfam=\SI@mathsf \let\SI@tfam=\sffamily \else\ifx\f@family\temp@tt - \let\SI@mfam=\mathtt + \let\SI@mfam=\SI@mathtt \let\SI@tfam=\ttfamily \else \let\SI@mfam=#1% |