From 00a39cac37f80a75dbdf467250d8bf75cecb4db6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Oct 2020 21:48:56 +0000 Subject: semtex (3oct20) git-svn-id: svn://tug.org/texlive/trunk@56530 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/semtex/semtex.pdf | Bin 61300 -> 63446 bytes Master/texmf-dist/doc/latex/semtex/semtex.tex | 20 ++++++++----- Master/texmf-dist/tex/latex/semtex/semtex.sty | 39 ++++++++++++++++---------- 3 files changed, 37 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/semtex/semtex.pdf b/Master/texmf-dist/doc/latex/semtex/semtex.pdf index 6500750b395..3928388d96f 100644 Binary files a/Master/texmf-dist/doc/latex/semtex/semtex.pdf and b/Master/texmf-dist/doc/latex/semtex/semtex.pdf differ diff --git a/Master/texmf-dist/doc/latex/semtex/semtex.tex b/Master/texmf-dist/doc/latex/semtex/semtex.tex index e390c4ba237..67f8d548bf0 100644 --- a/Master/texmf-dist/doc/latex/semtex/semtex.tex +++ b/Master/texmf-dist/doc/latex/semtex/semtex.tex @@ -38,7 +38,7 @@ \usepackage[nameinlink]{cleveref} -\title{\texttt{semtex}: For stripped Seman\!\TeX\ documents (v0.44)} +\title{\texttt{semtex}: For stripped Seman\!\TeX\ documents (v0.45)} \date{\today} \author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} @@ -58,7 +58,7 @@ basicstyle=\ttfamily\small, commentstyle=\itshape\ttfamily\small, alsoletter={\\}, - escapechar=@, + %escapechar=@, breaklines=true, breakindent={0pt}, captionpos=t, @@ -123,7 +123,8 @@ the macros it provides by macros from other packages. The package provides the commands \mylst!\SemantexBullet! and \mylst!\SemantexDoubleBullet!. These commands print bullets which are smaller (and prettier, in my opinion) -than the standard \lstinline!\bullet! command from~\LaTeX: +than the standard \lstinline!\bullet! command from~\LaTeX. +They are (of course) based on code by egreg, see \url{tex.stackexchange.com/a/564506/19809}. \begin{LTXexample} $ H^{\SemantexBullet} $, $ H^{\SemantexDoubleBullet} $ @@ -132,12 +133,17 @@ $ H^{\SemantexDoubleBullet} $ You can recreate them yourself as follows, rendering the package \pack{semtex} unnecessary for this purpose: \begin{lstlisting} -\newcommand\SemantexBullet{% - \raisebox{-0.25ex}{\scalebox{1.2}{$\cdot$}}% +\usepackage{graphicx} + +\makeatletter +\DeclareRobustCommand\SemantexBullet{% + \mathord{\mathpalette\SemantexBullet@{0.5}}% } -\newcommand\SemantexDoubleBullet{% - \SemantexBullet\SemantexBullet +\newcommand\SemantexBullet@[2]{% + \vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}% } +\DeclareRobustCommand\SemantexDoubleBullet{\SemantexBullet \SemantexBullet} +\makeatother \end{lstlisting} \chapter*{Replacements for \texorpdfstring{\textbackslash\texttt{left} and~\textbackslash\texttt{right}}{\left and \right}} diff --git a/Master/texmf-dist/tex/latex/semtex/semtex.sty b/Master/texmf-dist/tex/latex/semtex/semtex.sty index 28c9303f69a..077cdb1983f 100644 --- a/Master/texmf-dist/tex/latex/semtex/semtex.sty +++ b/Master/texmf-dist/tex/latex/semtex/semtex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse} -\ProvidesExplPackage{semtex}{2020/09/27}{0.44}{} +\ProvidesExplPackage{semtex}{2020/10/03}{0.45}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -12,23 +12,32 @@ % Bullets: -\box_if_exist:NF \g__semantex_bullet_box +\cs_new_protected:Npn\semantex_set_mathsurround_to_zero: { - \box_new:N \g__semantex_bullet_box - \hbox_set:Nn \g__semantex_bullet_box { $\cdot$ } - \box_scale:Nnn \g__semantex_bullet_box {1.2} {1.2} - \tl_set:Nn\g_semantex_bullet - { - \box_move_up:nn{-0.25ex}{\box_use:N \g__semantex_bullet_box} - } - - \tl_set:Nn\g_semantex_double_bullet{\g_semantex_bullet \g_semantex_bullet} - - \tl_set_eq:NN\SemantexBullet \g_semantex_bullet - - \tl_set_eq:NN \SemantexDoubleBullet \g_semantex_double_bullet + % This is equivalent to "\m@th" + \dim_set:Nn \mathsurround { 0pt } } +\cs_new_protected:Npn\semantex_bullet: +{ + \mathord{\mathpalette\__semantex_bullet_auxiliary:Nn{0.5}} +} + +\box_new:N \l__semantex_bullet_box + +\cs_new_protected:Npn\__semantex_bullet_auxiliary:Nn#1#2 +{ + \hbox_set:Nn \l__semantex_bullet_box { $\semantex_set_mathsurround_to_zero: #1 \bullet$ } + \box_scale:Nnn \l__semantex_bullet_box { #2 } { #2 } + \vcenter{ \hbox:n { \box_use_drop:N \l__semantex_bullet_box } } +} + +\cs_new_protected:Nn\semantex_double_bullet: {\semantex_bullet: \semantex_bullet:} + +\cs_set_eq:NN\SemantexBullet \semantex_bullet: + +\cs_set_eq:NN \SemantexDoubleBullet \semantex_double_bullet: + % Parentheses: \cs_set:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left } -- cgit v1.2.3