From 73d955d9fba24cf9bcbd63546263ad52357ee5bc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 19 Jul 2021 20:21:04 +0000 Subject: letterswitharrows (19jul21) git-svn-id: svn://tug.org/texlive/trunk@59993 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/letterswitharrows/letterswitharrows.dtx | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/source/latex/letterswitharrows') diff --git a/Master/texmf-dist/source/latex/letterswitharrows/letterswitharrows.dtx b/Master/texmf-dist/source/latex/letterswitharrows/letterswitharrows.dtx index 8d54dd6294f..1b2820bd826 100644 --- a/Master/texmf-dist/source/latex/letterswitharrows/letterswitharrows.dtx +++ b/Master/texmf-dist/source/latex/letterswitharrows/letterswitharrows.dtx @@ -54,7 +54,7 @@ % \title{The \pkg{letterswitharrows} package} % \author{Max Teegen\\ \href{mailto:tex@jmteegen.eu}{tex@jmteegen.eu}} -% \date{Released 2020-02-04} +% \date{Released 2021-07-19} % \maketitle @@ -140,6 +140,11 @@ % If \verb|#3| is \verb|-| if the arrow should point rightwards and empty otherwise. % \end{texnote} +% \DescribeOption{linewidth} +% Specifying \verb|linewidth=| as a package option allows you to adjust the line width of the arrows to adjust for the weigth of the maths font you are using. +% The default value is \verb|linewidth=0.3|. + + % \DescribeOption{tweaks} % Specifying the \verb|tweaks| option applies per-letter scaling adjustments to some of the single-letter shorthands. This is enabled by default. % These are specific to Latin Modern Math and subject to be changed on a whim. If you wish a more stable behaviour specify \verb|tweaks=false|. @@ -153,7 +158,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\ProvidesExplPackage {letterswitharrows} {2020-02-04} {} {Draw arrows over math letters.} +\ProvidesExplPackage {letterswitharrows} {2021/07/19} {} {Draw arrows over math letters.} \RequirePackage{xparse,l3keys2e,mathtools} % TODO: I just use mathtools for mathrlap; replace. @@ -166,6 +171,7 @@ } % \end{macrocode} % The drawing code. +% \changes{2021/07/10}{2021/07/19}{Implement adjustable linewidth.} % \begin{macro}{\__@@_arrow_draw_special:nnn,\__@@_arrow_draw_pgf:nnn,\__@@_arrow_left:nn,\__@@_arrow_right:nn} % \begin{macrocode} \cs_new:Nn \__@@_arrow_draw_special:nnn % length, font size, sign @@ -175,7 +181,7 @@ q~ 1~J~1~j~ 1~0~0~\dim_to_decimal:n{#3#2pt/10}~0~0~cm~ - .3~w~ + \fp_use:c{g_@@_line_width}~w~ q~ \dim_to_decimal:n{#3#2pt/10}~0~0~1~0~0~cm~ 1~0~0~1~-1~0~cm~ @@ -184,8 +190,11 @@ 1~0~.25~0~0~-1~c~ S~ Q~ + Q~ + q~ 0~0~m~ -1~0~0~1~0~0~cm~ + \fp_use:c{g_@@_line_width}~w~ \dim_to_decimal:n{#3#1}~0~l~S~ Q } @@ -193,7 +202,7 @@ \tex_special:D {"~ 1~setlinecap~1~setlinejoin~ 1~0~0~\dim_to_decimal:n{#3#2pt/10}~0~0~6~array~astore~concat~ - .3~setlinewidth~ + \fp_use:c{g_@@_line_width}~setlinewidth~ gsave~ \dim_to_decimal:n{#3#2pt/10}~0~0~1~0~0~6~array~astore~concat~ 1~0~0~1~-1~0~6~array~astore~concat~ @@ -216,7 +225,7 @@ \cs_new:Nn \__@@_arrow_draw_pgf:nnn { \begin{pgfpicture} - \pgfsetlinewidth{#2pt/30} + \pgfsetlinewidth{#2pt*\fp_use:c{g_@@_line_width}/10} \pgfsetarrowsstart {Computer~Modern~Rightarrow[width=#2pt*2/10,length=#2pt/10,sharp]} % \pgfsetarrowsstart{\tl_use:N \g_@@_pgf_arrow_style_tl} @@ -244,6 +253,7 @@ % \end{macro} % The core functions. +% \changes{2020/05/08}{2020/05/08}{Reset tabskip. Fixes spacing in aligned environments} % \begin{macro}{\__@@_arrow_overset_style:Nnncnnn,\__@@_arrow_overset:nnnnn} % \begin{macrocode} \cs_new:Npn \__@@_arrow_overset_style:Nnncnnn #1#2#3#4#5#6#7 { @@ -252,6 +262,7 @@ \vbox:n { \tex_lineskiplimit:D = \maxdimen \tex_baselineskip:D = 0pt + \tex_tabskip:D = 0pt \tex_lineskip:D = \dim_eval:n {\l_tmpa_dim * 3/2 + #7} \tex_halign:D { ## \tex_cr:D \skip_horizontal:n {\l_tmpa_dim / 2} @@ -370,6 +381,8 @@ presets .initial:n = {abc, ABC, cAcBcC}, tweaks .bool_set:N = \g_@@_tweak_shortcuts_bool, tweaks .initial:n = {true}, + linewidth .fp_set:N = \g_@@_line_width, + linewidth .initial:n = {.3}, } \ProcessKeysPackageOptions{letterswitharrows} % \end{macrocode} -- cgit v1.2.3