texlive[69510] Master/texmf-dist: medmath (20jan24)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 20 22:08:28 CET 2024
Revision: 69510
https://tug.org/svn/texlive?view=revision&revision=69510
Author: karl
Date: 2024-01-20 22:08:28 +0100 (Sat, 20 Jan 2024)
Log Message:
-----------
medmath (20jan24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/medmath/medmath.pdf
trunk/Master/texmf-dist/doc/latex/medmath/medmath.tex
trunk/Master/texmf-dist/tex/latex/medmath/medmath.sty
Modified: trunk/Master/texmf-dist/doc/latex/medmath/medmath.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/medmath/medmath.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/medmath/medmath.tex 2024-01-20 21:08:16 UTC (rev 69509)
+++ trunk/Master/texmf-dist/doc/latex/medmath/medmath.tex 2024-01-20 21:08:28 UTC (rev 69510)
@@ -2,7 +2,7 @@
\documentclass[oneside,11pt]{article}
\usepackage[a4paper,margin=2cm]{geometry}
-\newcommand*{\myversion}{2024D}
+\newcommand*{\myversion}{2024E}
\newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
@@ -25,6 +25,10 @@
\usepackage{medmath}
\booltrue{mdm at bare}
+\NewDocumentCommand\mypkg{m}{\textcolor{blue3}{\mbox{#1}}}
+\NewDocumentCommand\myopt{m}{\textcolor{yellow3}{\mbox{#1}}}
+\NewDocumentCommand\mycmd{m}{\textcolor{green3}{\ttfamily\fakeverb{#1}}}
+
\begin{document}
\title{\textsf{\color{green3}The \texttt{medmath} package}}
@@ -32,10 +36,12 @@
\date{\mydate}
\maketitle
-\section{The \texttt{mediummath} option in \texttt{nccmath} package}
+\section{Introduction}
-There are several problems with \texttt{mediummath} option in \texttt{nccmath} package.
+\subsection{The \texttt{mediummath} option in \texttt{nccmath} package}
+There are several problems with \myopt{mediummath} option in \mypkg{nccmath} package.
+
\begin{enumerate}
\item The big operators in superscripts and subscripts are too large.
\begin{demohigh}
@@ -53,13 +59,13 @@
\end{demohigh}
\end{enumerate}
-\section{The \texttt{medmath} package}
+\subsection{The \texttt{medmath} package}
\makeatletter
\mdm at activate@all
\makeatother
-The \texttt{medmath} package started as a fork of \texttt{mediummath} code in \texttt{nccmath}
+The \mypkg{medmath} package started as a fork of \myopt{mediummath} code in \mypkg{nccmath}
package, aiming to provide more stable and flexible medium-size math commands.
\begin{enumerate}
@@ -79,4 +85,30 @@
\end{demohigh}
\end{enumerate}
+\section{Usage}
+
+Since \mypkg{medmath} package is a fork of \myopt{mediummath} option in \mypkg{nccmath}
+package, the usage is basically the same. Here is a minimal example:
+
+\begin{codehigh}
+\documentclass{article}
+\usepackage{medmath}
+\begin{document}
+Inline $\int_0^1x^2dx=\frac13$.
+Displayed \[ \int_0^1x^2dx=\frac13. \]
\end{document}
+\end{codehigh}
+\vspace{0.5em}\hrule
+Inline $\int_0^1x^2dx=\frac13$.
+Displayed \[ \int_0^1x^2dx=\frac13. \]
+\hrule\vspace{0.5em}
+
+You will see that both integral symbols and both fractions are in medium size.
+You could see the differences if you remove \mycmd{\usepackage{medmath}} line.
+
+Since version 2024E, \mypkg{medmath} package is able to adjust \mycmd{\medintcorr} for some math fonts,
+hence integral operators with subscripts will look better. As a start, only three fonts
+(Computer Modern, Mathdesign Utopia, and Mathdesign Charter) are detected.
+
+
+\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/medmath/medmath.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/medmath/medmath.sty 2024-01-20 21:08:16 UTC (rev 69509)
+++ trunk/Master/texmf-dist/tex/latex/medmath/medmath.sty 2024-01-20 21:08:28 UTC (rev 69510)
@@ -7,7 +7,7 @@
% aiming to provide more stable and flexible medium-size math commands.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{medmath}[2024-01-15 v2024D Better medium-size math commands]
+\ProvidesPackage{medmath}[2024-01-20 v2024E Better medium-size math commands]
\RequirePackage{array}
\RequirePackage{etoolbox}
@@ -14,13 +14,11 @@
\newbool{mdm at bare} \boolfalse{mdm at bare} % don't define any public commands
\newbool{mdm at base} \boolfalse{mdm at base} % define only basic public commands
-\newbool{mdm at amsfonts} \booltrue{mdm at amsfonts} % use ams symbol fonts
\DeclareKeys{
bare .if = mdm at bare,
base .if = mdm at base,
all .ifnot = mdm at base,
- mdm at amsfonts .if = mdm at amsfonts
}
\ProcessKeyOptions
@@ -187,11 +185,6 @@
\newlength{\@mdm at em}
\setlength{\@mdm at em}{1em}
-\ifmdm at amsfonts
- \def\mdm at op@kern{0.5\@mdm at em}%
-\else
- \def\mdm at op@kern{0.3\@mdm at em}%
-\fi
\newcommand{\mdm at style@unit}[1]{%
\mathchoice{\setlength{\@mdm at em}{1em}#1}{\setlength{\@mdm at em}{1em}#1}
{\setlength{\@mdm at em}{0.5em}#1}{\setlength{\@mdm at em}{0.3em}#1}%
@@ -416,7 +409,33 @@
%%> \section{Activate definitions at the beginning of the document}
%%% --------------------------------------------------------
-\NewDocumentCommand\mdm at activate@base{}{
+%% Current largesymbols font of math version normal is stored in \mv at normal:
+%% ... \getanddefine at fonts \symlargesymbols \OMX/cmex/m/n ...
+
+\def\mdm at get@font at cmd#1\getanddefine at fonts\symlargesymbols#2#3\@mdm at scan@stop{%
+ \expandafter\mdm at get@font at name\string#2\@mdm at scan@stop
+}
+
+\def\mdm at get@font at name#1#2/#3/#4/#5\@mdm at scan@stop{%
+ \def\@mdm at font@name{#3}%
+}
+
+\def\@mdm at intcorr@factor at cmex{0.5} % default largesymbols font
+\def\@mdm at intcorr@factor at mdput{0.3} % [utopia]{mathdesign}
+\def\@mdm at intcorr@factor at mdbch{0.3} % [charter]{mathdesign}, {arevmath}
+
+\NewDocumentCommand\mdm at adjust@intcorr{}{%
+ \expandafter\mdm at get@font at cmd\mv at normal\@mdm at scan@stop
+ \ifcsdef{@mdm at intcorr@factor@\@mdm at font@name}{%
+ \edef\@mdm at intcorr@factor{\csuse{@mdm at intcorr@factor@\@mdm at font@name}}%
+ }{%
+ \def\@mdm at intcorr@factor{0.5}% default value
+ }%
+ \ExpandArgs{No}\def\mdm at op@kern{\@mdm at intcorr@factor\@mdm at em}%
+}
+
+\NewDocumentCommand\mdm at activate@base{}{%
+ \mdm at adjust@intcorr
\let \medmath = \mdm at base@medmath
\let \medop = \mdm at base@medop
\let \medintcorr = \mdm at base@medintcorr
More information about the tex-live-commits
mailing list.