diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-07 21:23:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-07 21:23:16 +0000 |
commit | bc59c4baca08950329c379257f124880c645c342 (patch) | |
tree | feaef247e6a0c2e9d8eabbd0210690e702f33f08 /Master/texmf-dist/tex/latex/semtex/semtex.sty | |
parent | 99e362fa3dfb6b154bac8a1bdbf5cae68e15544c (diff) |
semtex (7sep20)
git-svn-id: svn://tug.org/texlive/trunk@56288 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/semtex/semtex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/semtex/semtex.sty | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/semtex/semtex.sty b/Master/texmf-dist/tex/latex/semtex/semtex.sty new file mode 100644 index 00000000000..1824d0389cf --- /dev/null +++ b/Master/texmf-dist/tex/latex/semtex/semtex.sty @@ -0,0 +1,83 @@ +\RequirePackage{xparse} +\ProvidesExplPackage{semtex}{2020/09/07}{0.1beta}{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% semtex -- for documents stripped of SemanTeX markup % +% https://ctan.org/pkg/semantex % +% (C) 2020 Sebastian Ørsted % +% sorsted@gmail.com % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Bullets: + +\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 + + +% Parentheses: + +\cs_new:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left } + +\cs_new:Npn\SemantexRight { \aftergroup\egroup\right } + +\tl_new:N\SemantexDelimiterSize + +\DeclareDocumentCommand\SemantexParentheses { mmmm } +{ + \str_case:nnF { #1 } % This is where \big,\Big, etc. go. + { + { normal } { + \group_begin: + \tl_clear:N \SemantexDelimiterSize + \str_if_eq:nnF { #2 } { . } { \mathopen #2 } + #4 + \str_if_eq:nnF { #3 } { . } { \mathclose #3 } + \group_end: + } + { auto } { + \group_begin: + \tl_set_eq:NN \SemantexDelimiterSize \middle + \SemantexLeft #2 + #4 + \SemantexRight #3 + \group_end: + } + { * } { + \group_begin: + \tl_set_eq:NN \SemantexDelimiterSize \middle + \SemantexLeft #2 + #4 + \SemantexRight #3 + \group_end: + } + } + { + \group_begin: + \tl_set_eq:NN\SemantexDelimiterSize #1 + \mathopen #1 #2 + #4 + \mathclose #1 #3 + \group_end: + } +} + +\DeclareDocumentCommand\SemantexNoParentheses { m } +{ + \group_begin: + \tl_clear:N\SemantexDelimiterSize + #1 + \group_end: +}
\ No newline at end of file |