texlive[65853] Master/texmf-dist: overarrows (16feb23)
commits+karl at tug.org
commits+karl at tug.org
Thu Feb 16 22:35:14 CET 2023
Revision: 65853
http://tug.org/svn/texlive?view=revision&revision=65853
Author: karl
Date: 2023-02-16 22:35:13 +0100 (Thu, 16 Feb 2023)
Log Message:
-----------
overarrows (16feb23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/overarrows/overarrows-doc.sty
trunk/Master/texmf-dist/doc/latex/overarrows/overarrows.pdf
trunk/Master/texmf-dist/source/latex/overarrows/overarrows.dtx
trunk/Master/texmf-dist/tex/latex/overarrows/overarrows.sty
Modified: trunk/Master/texmf-dist/doc/latex/overarrows/overarrows-doc.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/overarrows/overarrows-doc.sty 2023-02-16 21:35:01 UTC (rev 65852)
+++ trunk/Master/texmf-dist/doc/latex/overarrows/overarrows-doc.sty 2023-02-16 21:35:13 UTC (rev 65853)
@@ -136,7 +136,7 @@
overrightharpoondown, overleftharpoonup, overleftharpoondown, overbar,%
underrightarrow, underleftarrow, underleftrightarrow, underrightharpoonup,%
underrightharpoondown, underleftharpoonup, underleftharpoondown, underbar,%
- SetOverArrowsMethod,%
+ SetOverArrowsMethod, SetOverArrowsSubscriptCommand,%
},
index = [2][texcs2],%
indexstyle = [2]\indexmacro,%
@@ -169,6 +169,7 @@
ovar at stackover@, ovar at stackunder@, ovar at stackover@fill,
ovar at stackover@lens, ovar at set@common, ovar at starversion,
ovar at testmathstyles, ovar at row@teststyle,%
+ ifovar at option@subother@,ifovar at option@subactive@,ovar at subcmd,ovar at testkerning,%
},
index = [4][texcs4],%
indexstyle = [4]\indexmacrointernal,%
Modified: trunk/Master/texmf-dist/doc/latex/overarrows/overarrows.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/overarrows/overarrows.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/overarrows/overarrows.dtx 2023-02-16 21:35:01 UTC (rev 65852)
+++ trunk/Master/texmf-dist/source/latex/overarrows/overarrows.dtx 2023-02-16 21:35:13 UTC (rev 65853)
@@ -16,7 +16,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{overarrows}
%<*package>
-[2023/01/19 v1.0.1 Custom extensible arrows over math expressions]
+[2023/02/15 v1.1 Custom extensible arrows over math expressions]
%</package>
%
%<*driver>
@@ -243,7 +243,7 @@
%
% \subsection{Stack and arrow macros}
%
-% It worth looking at the definition of \pkg{amsmath} \cs{overrightarrow}
+% It's worth looking at the definition of \pkg{amsmath} \cs{overrightarrow}
% command:
% \iffalse
%<*example>
@@ -1116,6 +1116,20 @@
% a subscript follows.
% \end{docOption}
%
+% \begin{docOption}{subother}
+% Sets to 12 (\emph{other} catcode category) the catcode of the ``|_|" symbol
+% used for subscript detection, when this is enabled by the key \refKey{detect
+% subscripts} (see the section~\ref{sec:non-standard-subscripts},
+% page~\pageref{sec:non-standard-subscripts}).
+% \end{docOption}
+%
+% \begin{docOption}{subactive}
+% Sets to 13 (\emph{active} catcode category) the catcode of the ``|_|" symbol
+% used for subscript detection, when this is enabled by the key \refKey{detect
+% subscripts} (see the section~\ref{sec:non-standard-subscripts},
+% page~\pageref{sec:non-standard-subscripts}).
+% \end{docOption}
+%
% \begin{docOption}{debug}
% Writes the meaning of defined commands in \LaTeX{} log.
% \end{docOption}
@@ -1671,6 +1685,10 @@
% When the option \refOpt{subscripts} is set, the initial value of
% \refKey*{detect subscripts} is |true|.
%
+% Note that the detection may fail when the standard subscript command is
+% changed or altered (see the section~\ref{sec:non-standard-subscripts},
+% page~\pageref{sec:non-standard-subscripts}).
+%
% \iffalse
%<*example>
% \fi
@@ -2010,6 +2028,13 @@
%
% \subsubsection{Advanced commands}
%
+% \begin{docCommand}{SetOverArrowsSubscriptCommand}{\marg{command}}
+% Sets to \meta{command} the command used for subscript detection, when this
+% is enabled by the key \refKey{detect subscripts} (see the
+% section~\ref{sec:non-standard-subscripts},
+% page~\pageref{sec:non-standard-subscripts}).
+% \end{docCommand}
+%
% \begin{docCommands}{%
% {
% doc name=SetOverArrowsMethod,
@@ -2095,8 +2120,10 @@
%
% \section{Complements}
%
-% \subsection{Math font issue}
+% \subsection{Know issues}
%
+% \subsubsection{Math font change}
+%
% If the math font differs from the default \emph{Computer Modern}, arrow drawn
% with the |symb| method may have a central part of the arrow with inappropriate
% position or line width. This is
@@ -2104,6 +2131,60 @@
% \symb{\relbareda} from the \pkg{esvect} package. This can be fixed with the
% \refOpt{noesvect} option.
%
+% \subsubsection{Detection of non standard subscripts}
+% \label{sec:non-standard-subscripts}
+%
+% The subscript detection enabled by the key \refKey{detect subscripts} is based
+% on the \LaTeX{} macro \cs{@ifnextchar}. The detection may fail if the standard
+% subscript command is modified of altered. This is the case, as example:
+% \begin{itemize}
+% \item with the \pkg{spbmark} package
+% (\url{https://www.ctan.org/pkg/spbmark}), by Qu Yi, which allows a complete
+% customisation of subscripts, through the \cs{sub} command;
+% \item with the \pkg{altsubsup} package
+% (\url{https://www.ctan.org/pkg/altsubsup}), by Julien Labb\'e, which
+% provides an alternative subscript format, and changes, for this purpose, the
+% catcode of the underscore symbol ``|_|" from 8 (\emph{subscript} catcode
+% category) to 12 (\emph{other} catcode category).
+% \end{itemize}
+%
+% To handle theses cases, the command used for subscript detection can be
+% redefined with \refCom{SetOverArrowsSubscriptCommand}. Compatibility with the
+% \pkg{spbmark} package is then obtained by:
+% \iffalse
+%<*example>
+% \fi
+\begin{dispListing}
+\SetOverArrowsSubscriptCommand{\sub}
+\end{dispListing}
+% \iffalse
+%</example>
+% \fi
+% \noindent In the same way, with the \pkg{altsubsup} package, add:
+% \iffalse
+%<*example>
+% \fi
+\begin{dispListing}
+\SetOverArrowsSubscriptCommand{_}
+\end{dispListing}
+% \iffalse
+%</example>
+% \fi
+% \noindent after the \cs{begin}|{document}| (namely, after the catcode
+% redefinition done by \pkg{altsubsup}).
+%
+% \medskip
+%
+% Alternatively, two package options handle the cases where the catcode of the
+% underscore ``|_|" symbol is changed: \refOpt{subother} (for catcode 12, or
+% \emph{other}) and \refOpt{subactive} (for catcode 13, or \emph{active}).
+% Hence, setting the \refOpt{subother} option is sufficient for compatibility
+% with the \pkg{altsubsup} package (no need of
+% \refCom{SetOverArrowsSubscriptCommand}). Note, that with options
+% \refOpt{subother} and \refOpt{subactive}, the command \refCom{TestOverArrow*}
+% may give bad results for kerning test, as defined before the
+% catcode redefinition.
+%
% \subsection{Package dependencies}
%
% The following packages are used by \pkg{overarrows}:
@@ -2145,6 +2226,7 @@
% \subsection{Changelog}
%
% \begin{description}
+% \item[v1.1] Support for non-standard subscripts
% \item[v1.0.1] Bug fix for under* options.
% \item[v1.0] Initial version.
% \end{description}
@@ -2160,7 +2242,7 @@
% \setlength{\parindent}{0em}
% \setlength{\parskip}{\smallskipamount}
%
-%\subsection*{Management of options}
+% \subsection*{Management of options}
%
% \subsubsection*{Declaration of conditionals}
%
@@ -2170,6 +2252,8 @@
\newif\ifovar at option@tikz@
\newif\ifovar at option@pstarrows@
\newif\ifovar at detectsubscripts@
+\newif\ifovar at option@subother@
+\newif\ifovar at option@subactive@
\newif\ifovar at option@debug@
% \end{macrocode}
%
@@ -2211,6 +2295,8 @@
\DeclareOption{tikz}{\ovar at option@tikz at true}
\DeclareOption{pstarrows}{\ovar at option@pstarrows at true}
\DeclareOption{subscripts}{\ovar at detectsubscripts@true}
+\DeclareOption{subother}{\ovar at option@subother at true}
+\DeclareOption{subactive}{\ovar at option@subactive at true}
\DeclareOption{debug}{\ovar at option@debug at true}
% \end{macrocode}
%
@@ -2218,7 +2304,6 @@
%
% \changes{v1.0.1}{2023/01/19}{Bug fix for under* options}
%
-%
% \begin{macrocode}
\DeclareOption{overrightarrow}{\ovar at option@overrightarrow at true}
\DeclareOption{underrightarrow}{\ovar at option@underrightarrow at true}
@@ -2327,6 +2412,39 @@
\fi
% \end{macrocode}
%
+% \subsection*{Configuration of subscripts detection}
+%
+% \changes{v1.1}{2023/02/15}{Support for non-standard subscripts}
+%
+% \begin{macro}{\SetOverArrowsSubscriptCommand}
+% Sets the subscript command.
+% \begin{macrocode}
+\newcommand{\SetOverArrowsSubscriptCommand}[1]{\global\let\ovar at subcmd=#1}
+% \end{macrocode}
+% \end{macro}
+%
+% Initial configuration.
+% \begin{macrocode}
+\SetOverArrowsSubscriptCommand{_}
+% \end{macrocode}
+% Option \refOpt{subother} for \emph{other} (catcode 12) subscript commands.
+% \begin{macrocode}
+\ifovar at option@subother@
+ \begingroup
+ \catcode `_=12
+ \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \endgroup
+\fi
+% \end{macrocode}
+% Option \refOpt{subactive} for \emph{active} (catcode 13) subscript commands.
+% \begin{macrocode}
+\ifovar at option@subactive@
+ \begingroup
+ \catcode `_=13
+ \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \endgroup
+\fi
+% \end{macrocode}
% \subsection*{Management of keys}
%
% \subsubsection*{Family declaration and setters}
@@ -2365,6 +2483,11 @@
%
% \begin{macrocode}
\SetOverArrowsMethod*{common}[\undef{\ovar at macro@stack}\undef{\ovar at macro@arrow}]{%
+% \end{macrocode}
+%
+% \refKey{detect subscripts}.
+%
+% \begin{macrocode}
detect subscripts/.is if=ovar at detectsubscripts@,
% \end{macrocode}
%
@@ -2926,7 +3049,11 @@
}
\ifovar at detectsubscripts@%
\csgdef{ovar@#2 at auto}##1{%
- \@ifnextchar _{%
+% \end{macrocode}
+% \vspace{-2\smallskipamount}%^^A remove space between code blocs
+% \changes{v1.1}{2023/02/15}{Support for non-standard subscripts}
+% \begin{macrocode}
+ \@ifnextchar \ovar at subcmd {%
\csuse{ovar@#2 at starred}{##1}%
}{%
\csuse{ovar@#2 at normal}{##1}%
@@ -3271,6 +3398,28 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.1}{2023/02/15}{Support for non-standard subscripts}
+%
+% \begin{macro}{\ovar at testkerning}
+% \begin{macrocode}
+\begingroup
+\ifovar at option@subother@ \catcode `_=12 \fi
+\ifovar at option@subactive@ \catcode `_=13 \fi
+\gdef\ovar at testkerning#1{%
+ \begin{displaymath}
+ #1{t}_{#1{u}_{#1{v}}}
+ \qquad
+ #1{\imath}_0
+ \qquad
+ #1{v}
+ = #1{v}_x + #1{v}_y + #1{v}_z
+ = v_x #1{\imath} + v_y #1{\jmath} + v_z #1{k}
+ \end{displaymath}
+}
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\TestOverArrow}
% \begin{macrocode}
\NewDocumentCommand{\TestOverArrow}{ s o m }{
@@ -3290,25 +3439,9 @@
\ovar at testmathstyles[#2]{#3}%
\bigskip\par
\textbf{\texttt{\textbackslash#3} kerning}
- \begin{displaymath}
- \csuse{#3}{t}_{\csuse{#3}{u}_{\csuse{#3}{v}}}
- \qquad
- \csuse{#3}{\imath}_0
- \qquad
- \csuse{#3}{v}
- = \csuse{#3}{v}_x + \csuse{#3}{v}_y + \csuse{#3}{v}_z
- = v_x \csuse{#3}{\imath} + v_y \csuse{#3}{\jmath} + v_z \csuse{#3}{k}
- \end{displaymath}
+ \ovar at testkerning{\csuse{#3}}
\textbf{\texttt{\textbackslash#3*} kerning}
- \begin{displaymath}
- \csuse{#3}*{t}_{\csuse{#3}*{u}_{\csuse{#3}*{v}}}
- \qquad
- \csuse{#3}*{\imath}_0
- \qquad
- \csuse{#3}*{v}
- = \csuse{#3}*{v}_x + \csuse{#3}*{v}_y + \csuse{#3}*{v}_z
- = v_x \csuse{#3}*{\imath} + v_y \csuse{#3}*{\jmath} + v_z \csuse{#3}*{k}
- \end{displaymath}
+ \ovar at testkerning{\csuse{#3}*}
\end{minipage}%
}\bigskip\par
}{%
@@ -3501,7 +3634,7 @@
overrightharpoondown, overleftharpoonup, overleftharpoondown, overbar,%
underrightarrow, underleftarrow, underleftrightarrow, underrightharpoonup,%
underrightharpoondown, underleftharpoonup, underleftharpoondown, underbar,%
- SetOverArrowsMethod,%
+ SetOverArrowsMethod, SetOverArrowsSubscriptCommand,%
},
index = [2][texcs2],%
indexstyle = [2]\indexmacro,%
@@ -3537,6 +3670,7 @@
ovar at stackover@, ovar at stackunder@, ovar at stackover@fill,
ovar at stackover@lens, ovar at set@common, ovar at starversion,
ovar at testmathstyles, ovar at row@teststyle,%
+ ifovar at option@subother@,ifovar at option@subactive@,ovar at subcmd,ovar at testkerning,%
},
index = [4][texcs4],%
indexstyle = [4]\indexmacrointernal,%
@@ -3657,45 +3791,6 @@
%
%</docstyle>
%
-%<*comment>
-%
-% \section*{Notes}
-%
-% \subsection*{Bash commands reminder}
-%^^A the command |awk '!line[$0]++'| remove duplicate lines
-%
-% \subsubsection*{List of package options}
-%
-\begin{lstlisting}[language={bash}]
-rg -o -N 'DeclareOption\{\w+' overarrows.dtx | rg -o '\w+$'
-\end{lstlisting} %^^A dummy '|' for emacs
-%
-% \subsubsection*{List of commands}
-%
-\begin{lstlisting}[language={bash}]
-rg -o -N '^[[:blank:]]*\\(let|def|newcommand\*?|(New|Renew|Declare|Provides)\w*Command)[{\\]+[\w@]+' overarrows.sty | rg -o '[\w@]+$' | grep -v ovar@ | awk '!line[$0]++'
-\end{lstlisting} %^^A dummy '|' for emacs
-%
-% \subsubsection*{List of internal macros and lengths}
-%
-\begin{lstlisting}[language={bash}]
- rg '\\(if)?ovar@[\w@]+' -o -N overarrows.dtx | rg -v '(@true|@false)' | awk '!line[$0]++'
-\end{lstlisting} %^^A dummy '|' for emacs
-%
-% \subsubsection*{List of lengths}
-%
-\begin{lstlisting}[language={bash}]
-rg -o -N '^[[:blank:]]*\\(def|new)length[{\\]+[\w@]+' overarrows.sty | rg -o '[\w@]+$' | grep -v ovar@| awk '!line[$0]++'
-\end{lstlisting}
-%
-% \subsubsection*{List of keys}
-%
-\begin{lstlisting}[language={bash}]
-rg -o -N ".*/\." overarrows.sty | sed 's/\/\.$//' | sed -r 's/^([[:blank:]]|\\[[:alpha:]@]+\{)*//' | awk '!line[$0]++'
-\end{lstlisting}
-%
-%</comment>
-%
% \fi ^^A end of \iffalse
%
% \Finale
Modified: trunk/Master/texmf-dist/tex/latex/overarrows/overarrows.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/overarrows/overarrows.sty 2023-02-16 21:35:01 UTC (rev 65852)
+++ trunk/Master/texmf-dist/tex/latex/overarrows/overarrows.sty 2023-02-16 21:35:13 UTC (rev 65853)
@@ -17,12 +17,14 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{overarrows}
-[2023/01/19 v1.0.1 Custom extensible arrows over math expressions]
+[2023/02/15 v1.1 Custom extensible arrows over math expressions]
\newif\ifovar at option@oldarrows@
\newif\ifovar at option@esvect@ \ovar at option@esvect at true \PassOptionsToPackage{f}{esvect}
\newif\ifovar at option@tikz@
\newif\ifovar at option@pstarrows@
\newif\ifovar at detectsubscripts@
+\newif\ifovar at option@subother@
+\newif\ifovar at option@subactive@
\newif\ifovar at option@debug@
\newif\ifovar at option@overrightarrow@
\newif\ifovar at option@underrightarrow@
@@ -54,6 +56,8 @@
\DeclareOption{tikz}{\ovar at option@tikz at true}
\DeclareOption{pstarrows}{\ovar at option@pstarrows at true}
\DeclareOption{subscripts}{\ovar at detectsubscripts@true}
+\DeclareOption{subother}{\ovar at option@subother at true}
+\DeclareOption{subactive}{\ovar at option@subactive at true}
\DeclareOption{debug}{\ovar at option@debug at true}
\DeclareOption{overrightarrow}{\ovar at option@overrightarrow at true}
\DeclareOption{underrightarrow}{\ovar at option@underrightarrow at true}
@@ -130,6 +134,20 @@
\ifovar at option@pstarrows@
\RequirePackage[pstarrows]{pict2e}
\fi
+\newcommand{\SetOverArrowsSubscriptCommand}[1]{\global\let\ovar at subcmd=#1}
+\SetOverArrowsSubscriptCommand{_}
+\ifovar at option@subother@
+ \begingroup
+ \catcode `_=12
+ \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \endgroup
+\fi
+\ifovar at option@subactive@
+ \begingroup
+ \catcode `_=13
+ \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \endgroup
+\fi
\RequirePackage{pgfkeys}
\pgfkeys{overarrows/.is family}
\newcommand{\ovar at set}[1]{\pgfqkeys{/overarrows}{#1}}
@@ -479,7 +497,7 @@
}
\ifovar at detectsubscripts@%
\csgdef{ovar@#2 at auto}##1{%
- \@ifnextchar _{%
+ \@ifnextchar \ovar at subcmd {%
\csuse{ovar@#2 at starred}{##1}%
}{%
\csuse{ovar@#2 at normal}{##1}%
@@ -695,6 +713,21 @@
\end{tabular*}
\endgroup
}
+\begingroup
+\ifovar at option@subother@ \catcode `_=12 \fi
+\ifovar at option@subactive@ \catcode `_=13 \fi
+\gdef\ovar at testkerning#1{%
+ \begin{displaymath}
+ #1{t}_{#1{u}_{#1{v}}}
+ \qquad
+ #1{\imath}_0
+ \qquad
+ #1{v}
+ = #1{v}_x + #1{v}_y + #1{v}_z
+ = v_x #1{\imath} + v_y #1{\jmath} + v_z #1{k}
+ \end{displaymath}
+}
+\endgroup
\NewDocumentCommand{\TestOverArrow}{ s o m }{
\ifcsdef{#3}{}{%
\PackageWarning{overarrows}{Unknown name '#3' passed to
@@ -712,25 +745,9 @@
\ovar at testmathstyles[#2]{#3}%
\bigskip\par
\textbf{\texttt{\textbackslash#3} kerning}
- \begin{displaymath}
- \csuse{#3}{t}_{\csuse{#3}{u}_{\csuse{#3}{v}}}
- \qquad
- \csuse{#3}{\imath}_0
- \qquad
- \csuse{#3}{v}
- = \csuse{#3}{v}_x + \csuse{#3}{v}_y + \csuse{#3}{v}_z
- = v_x \csuse{#3}{\imath} + v_y \csuse{#3}{\jmath} + v_z \csuse{#3}{k}
- \end{displaymath}
+ \ovar at testkerning{\csuse{#3}}
\textbf{\texttt{\textbackslash#3*} kerning}
- \begin{displaymath}
- \csuse{#3}*{t}_{\csuse{#3}*{u}_{\csuse{#3}*{v}}}
- \qquad
- \csuse{#3}*{\imath}_0
- \qquad
- \csuse{#3}*{v}
- = \csuse{#3}*{v}_x + \csuse{#3}*{v}_y + \csuse{#3}*{v}_z
- = v_x \csuse{#3}*{\imath} + v_y \csuse{#3}*{\jmath} + v_z \csuse{#3}*{k}
- \end{displaymath}
+ \ovar at testkerning{\csuse{#3}*}
\end{minipage}%
}\bigskip\par
}{%
More information about the tex-live-commits
mailing list.