summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/semtex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-04 03:01:11 +0000
committerNorbert Preining <norbert@preining.info>2020-10-04 03:01:11 +0000
commit62f3109ec0fcb4a3309966bdcb9e4f307ff35dd2 (patch)
tree60447da370a4394b5fd095c64a5eebde30425c04 /macros/latex/contrib/semtex
parent0e644e6805342838052f46e6af93f81644d0390b (diff)
CTAN sync 202010040301
Diffstat (limited to 'macros/latex/contrib/semtex')
-rw-r--r--macros/latex/contrib/semtex/semtex.pdfbin61300 -> 63446 bytes
-rw-r--r--macros/latex/contrib/semtex/semtex.sty39
-rw-r--r--macros/latex/contrib/semtex/semtex.tex20
3 files changed, 37 insertions, 22 deletions
diff --git a/macros/latex/contrib/semtex/semtex.pdf b/macros/latex/contrib/semtex/semtex.pdf
index 6500750b39..3928388d96 100644
--- a/macros/latex/contrib/semtex/semtex.pdf
+++ b/macros/latex/contrib/semtex/semtex.pdf
Binary files differ
diff --git a/macros/latex/contrib/semtex/semtex.sty b/macros/latex/contrib/semtex/semtex.sty
index 28c9303f69..077cdb1983 100644
--- a/macros/latex/contrib/semtex/semtex.sty
+++ b/macros/latex/contrib/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 }
diff --git a/macros/latex/contrib/semtex/semtex.tex b/macros/latex/contrib/semtex/semtex.tex
index e390c4ba23..67f8d548bf 100644
--- a/macros/latex/contrib/semtex/semtex.tex
+++ b/macros/latex/contrib/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}}