texlive[72818] Master: scaletextbullet (10nov24)
commits+karl at tug.org
commits+karl at tug.org
Mon Nov 11 17:55:06 CET 2024
Revision: 72818
https://tug.org/svn/texlive?view=revision&revision=72818
Author: karl
Date: 2024-11-11 17:55:06 +0100 (Mon, 11 Nov 2024)
Log Message:
-----------
scaletextbullet (10nov24)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/scaletextbullet/
trunk/Master/texmf-dist/doc/latex/scaletextbullet/README.txt
trunk/Master/texmf-dist/doc/latex/scaletextbullet/beery.cls
trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf
trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.tex
trunk/Master/texmf-dist/tex/latex/scaletextbullet/
trunk/Master/texmf-dist/tex/latex/scaletextbullet/scaletextbullet.sty
trunk/Master/tlpkg/tlpsrc/scaletextbullet.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/scaletextbullet/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scaletextbullet/README.txt (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/scaletextbullet/README.txt 2024-11-11 16:55:06 UTC (rev 72818)
@@ -0,0 +1,6 @@
+Package: scaletextbullet -- Resize the \textbullet without changing its
+vertical center
+Copyright: 2024 (c) Oliver Beery <beeryoliver at gmail.com>
+CTAN: <ADD CTAN LINK HERE>
+Repository: https://github.com/beeryoliver/scaletextbullet
+License: The LaTeX Project Public License 1.3c
Property changes on: trunk/Master/texmf-dist/doc/latex/scaletextbullet/README.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/scaletextbullet/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scaletextbullet/beery.cls (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/scaletextbullet/beery.cls 2024-11-11 16:55:06 UTC (rev 72818)
@@ -0,0 +1,290 @@
+% Note: This class is designed ONLY for 'scaletextbullet.tex'. Compiled with LuaTeX.
+
+% LaTeX2e version 2023-11-01 added \IfExplAtLeastTF.
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
+\ProvidesExplClass
+ {beery}
+ {2024-11-10}
+ {}
+ {}
+
+\LoadClass { article }
+
+\box_new:N \l__beery_tmp_box
+
+\RequirePackage { fontscale }
+\fontscalesetup { musical }
+\RequirePackage { siunitx }
+\sisetup { list-final-separator = { ,~ and~ } , mode = match }
+\RequirePackage { mathtools }
+\RequirePackage [ shortcuts , allowbreakbefore ] { extdash }
+\RequirePackage { csquotes }
+\RequirePackage { lmodern }
+\RequirePackage { fontspec }
+\newfontfamily \newfontfamilystixtwo { STIX Two Text }
+\newfontfamily \newfontfamilysourceseriffour { Source Serif 4 }
+
+\RequirePackage { multicol }
+\RequirePackage { scaletextbullet }
+
+% CUSTOM MACROS
+
+\tl_const:Nn \c_beery_alphabet_tl { abcdefghijklmnopqrstuvwxyz }
+\NewExpandableDocumentCommand \alphabet { } { \c_beery_alphabet_tl }
+\NewDocumentCommand \Key { m o o }
+ {
+ \mode_leave_vertical:
+ \group_begin:
+ \ttfamily
+ \IfNoValueTF {#3}
+ {
+ \IfNoValueTF {#2}
+ {#1}
+ { #1 $\,=\,$ \allowbreak #2 }
+ }
+ { #1 $\,=\,$ #2 \hspace* { \fill } \hbox:n { initial $\,=\,$ #3 } }
+ \group_end:
+ }
+\NewDocumentCommand \Value { m } { \texttt {#1} }
+\NewDocumentCommand \cmd { m } { \texttt { \token_to_str:N #1 } \@ }
+\NewDocumentCommand \cs { m } { \texttt { \token_to_str:c {#1} } \@ }
+\NewDocumentCommand \marg { m }
+ {
+ \allowbreak
+ \texttt { \c_left_brace_str }
+ $\langle$
+ { \normalfont \itshape #1 }
+ $\rangle$
+ \texttt { \c_right_brace_str }
+ }
+\NewDocumentCommand \oarg { m }
+ {
+ \allowbreak
+ \texttt { [ }
+ $\langle$
+ { \normalfont \itshape #1 }
+ $\rangle$
+ \texttt { ] }
+ }
+\NewDocumentCommand \sarg { } { $\langle$ \texttt {*} $\rangle$ }
+\NewDocumentCommand \meta { m }
+ {
+ $\langle$
+ { \normalfont \itshape #1 }
+ $\rangle$
+ }
+\NewDocumentCommand \cls { m } { \textsf {#1} }
+\NewDocumentCommand \env { m } { \texttt {#1} }
+\NewDocumentCommand \pkg { m } { \textsf {#1} }
+\NewDocumentCommand \latin { m } { \textit {#1} }
+
+% PAGE STYLE
+
+\hbox_set:Nn \l__beery_tmp_box { \c_beery_alphabet_tl }
+\dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l__beery_tmp_box }
+\dim_log:N \c_beery_alphabet_dim
+
+\dim_const:Nn \c_beery_big_dim { \l_fontscale_normalsize_baselineskip_skip }
+\dim_const:Nn \c_beery_medium_dim { \c_beery_big_dim / 2 }
+\dim_const:Nn \c_beery_small_dim { \c_beery_big_dim / 4 }
+\skip_const:Nn \c_beery_big_skip
+ {
+ \c_beery_big_dim
+ plus \dim_eval:n { \c_beery_big_dim / 2 }
+ minus \dim_eval:n { \c_beery_big_dim / 3 }
+ }
+\skip_const:Nn \c_beery_medium_skip { \c_beery_big_skip / 2 }
+\skip_const:Nn \c_beery_small_skip { \c_beery_big_skip / 4 }
+\skip_set_eq:NN \bigskipamount \c_beery_big_skip
+\skip_set_eq:NN \medskipamount \c_beery_medium_skip
+\skip_set_eq:NN \smallskipamount \c_beery_small_skip
+
+\raggedbottom
+\int_set:Nn \vbadness { 100 }
+
+\skip_set:Nn \topskip { \l_fontscale_normalsize_size_dim }
+\skip_set_eq:NN \splittopskip \topskip
+\RequirePackage { geometry }
+\geometry
+ {
+ a4paper
+ , textwidth =
+ \dim_eval:n { \fp_to_dim:n { \c_e_fp * \c_beery_alphabet_dim } }
+ , textheight =
+ \dim_eval:n
+ { \fp_to_dim:n { 1.6180 * \c_e_fp * \c_beery_alphabet_dim } }
+ , heightrounded
+ , centering
+ , headheight = \l_fontscale_footnotesize_baselineskip_skip
+ , headsep = \c_beery_big_dim
+ , footskip =
+ \dim_eval:n
+ { \c_beery_big_dim + \l_fontscale_footnotesize_baselineskip_skip }
+ }
+
+\RequirePackage { fancyhdr }
+\pagestyle { fancy }
+\fancyhf { }
+\cs_set:Npn \headrulewidth { 0pt }
+\fancyfoot [ C ]
+ { \footnotesize \thepage \c_space_tl of~ \pageref { LastPage } }
+
+% PARAGRAPH STYLE
+
+\nonfrenchspacing
+\linespread { 1 }
+\skip_set_eq:NN \parskip \c_beery_medium_skip
+\dim_zero:N \parindent
+\RequirePackage [ raggedrightboxes ] { ragged2e }
+\skip_set:Nn \RaggedRightRightskip { 0pt plus 0.5 \linewidth }
+\dim_zero:N \RaggedRightParindent
+\dim_set_eq:NN \JustifyingParindent \RaggedRightParindent
+\RaggedRight
+\int_set:Nn \pretolerance { -1 }
+\int_set:Nn \tolerance { 200 }
+\dim_zero:N \emergencystretch
+\int_set:Nn \widowpenalty { 10000 }
+\int_set_eq:NN \clubpenalty \widowpenalty
+\int_set_eq:NN \displaywidowpenalty \widowpenalty
+\int_set:Nn \hyphenpenalty { 99 }
+\int_set_eq:NN \exhyphenpenalty \hyphenpenalty
+
+% HEADINGS, TABLE OF CONTENTS
+
+\RequirePackage { titlesec , titletoc }
+\setcounter { secnumdepth } { 2 }
+\setcounter { tocdepth } { 2 }
+
+\titlespacing* \section % section
+ { 0pt } % indent
+ {
+ - \parskip
+ + \c_beery_big_dim
+ plus \fp_eval:n { 1 / 2 * 4 } \c_beery_big_dim
+ minus \fp_eval:n { 1 / 3 / 4 } \c_beery_big_dim
+ } % before
+ { - \parskip + \c_beery_medium_skip } % after
+\titlespacing* \subsection
+ { 0pt }
+ {
+ - \parskip
+ + \fp_eval:n { 4 / 3 } \c_beery_medium_dim
+ plus \fp_eval:n { 1 / 2 * 4 } \c_beery_medium_dim
+ minus \fp_eval:n { 1 / 3 / 4 } \c_beery_medium_dim
+ }
+ { - \parskip + \c_beery_medium_skip }
+
+\titleformat \section % section
+ [ block ] % shape
+ { \raggedright \large \bfseries } % format
+ { \thesection } % label
+ { 1em } % the horizontal separation between label and title body
+ { } % before code
+ { } % after code
+\titleformat \subsection
+ [ block ]
+ { \raggedright \normalsize \bfseries }
+ { \thesubsection }
+ { 1em }
+ { }
+ { }
+
+% LISTS, LIST HEADINGS
+
+\RequirePackage { enumitem }
+\setlist
+ {
+ % horizontal spacing
+ leftmargin = *
+ , labelsep = 0.5em
+ % vertical spacing
+ , topsep = 0pt
+ , partopsep = 0pt
+ , parsep = \c_beery_small_skip
+ , itemsep = 0pt
+ }
+\setlist [ itemize , 1 ] { label = \textbullet }
+\setlist [ itemize , 2 ] { label = \ScaleTextBullets { 2 } }
+\setlist [ itemize , 3 ] { label = \ScaleTextBullets { 3 } }
+\setlist [ enumerate , 1 ] { label = \arabic* . }
+\setlist [ enumerate , 2 ] { label = \theenumi \arabic* . }
+\setlist [ enumerate , 3 ] { label = \theenumii \arabic* . }
+
+% list headings
+% https://tex.stackexchange.com/questions/2644/how-to-prevent-a-page-break-before-an-itemize-list
+\NewDocumentCommand \KeepNextPar { s }
+ {
+ \par
+ \IfBooleanTF #1
+ {
+ \int_compare:nNnT { \prevgraf } = { 1 }
+ { \nobreak \@afterheading }
+ }
+ { \nobreak \@afterheading }
+ }
+\NewDocumentCommand \listheading { m }
+ {
+ \par
+ #1
+ \par
+ \int_compare:nNnT { \prevgraf } = { 1 }
+ { \nobreak \@afterheading }
+ \vspace { \skip_eval:n { \c_beery_small_skip - \parskip } }
+ }
+
+% TABLES
+
+\renewcommand \bottomfraction { 1 }
+\renewcommand \topfraction { 1 }
+\skip_set:Nn \textfloatsep
+ {
+ \c_beery_big_dim plus \c_beery_big_dim minus
+ \dim_eval:n { \c_beery_big_dim / 3 }
+ }
+
+\RequirePackage { tabularray }
+\UseTblrLibrary { booktabs , siunitx }
+
+% FOOTNOTES
+
+\RequirePackage [ bottom ] { footmisc }
+\renewcommand \footnoterule { }
+% \setlength { \skip \footins } { \c_beery_big_skip }
+\dim_set:Nn \footnotesep { \f at linespread \footnotesep }
+\coffin_new:N \l__beery_footnote_coffin
+% 1.2 = baselineskip-size-ratio
+\dim_const:Nn \c_beery_footnote_baselineheight_dim
+ {
+ \fp_to_dim:n
+ { ( 1.2 * \f at linespread - 1 ) * \l_fontscale_footnotesize_size_dim }
+ }
+\RenewDocumentCommand \@makefntext { +m }
+ {
+ \vcoffin_set:Nnn \l__beery_footnote_coffin { \textwidth }
+ {
+ \list { \@thefnmark . }
+ {
+ \dim_set:Nn \leftmargin
+ {
+ \fp_to_dim:n
+ {
+ ( 1 - \l_fontscale_footnotesize_scale_fp ) / 2 * \textwidth
+ }
+ }
+ \dim_set_eq:NN \rightmargin \leftmargin
+ \dim_set:Nn \labelsep { 0.5em }
+ \skip_zero:N \topsep
+ \skip_zero:N \partopsep
+ }
+ \item #1 \endlist
+ }
+ \coffin_typeset:Nnnnn \l__beery_footnote_coffin { l } { b }
+ { 0pt } { - \c_beery_footnote_baselineheight_dim }
+ }
+
+% REFERENCES
+
+\AddToHook { shipout / lastpage } { \label { LastPage } }
+\RequirePackage { xurl }
+\RequirePackage { hyperref }
+\hypersetup { bookmarksnumbered , hidelinks , linktoc = page }
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/scaletextbullet/beery.cls
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf 2024-11-11 16:53:23 UTC (rev 72817)
+++ trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf 2024-11-11 16:55:06 UTC (rev 72818)
Property changes on: trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.tex 2024-11-11 16:55:06 UTC (rev 72818)
@@ -0,0 +1,224 @@
+\documentclass{beery}
+
+\NewDocumentCommand\textbulletfactor{}{\cs{textbullet} factor}
+
+
+\begin{document}
+
+
+\section*
+ {%
+ \SetFontStep*{1}%
+ The \pkg{scaletextbullet} package%
+ }
+
+Resize the \cs{textbullet} without changing its vertical center
+
+Oliver Beery
+
+Version 1.0.0\quad{}10 November 2024
+
+
+\section{Introduction}
+\label{sec:intro}
+
+The \pkg{scaletextbullet} package enables the user to resize the \cs{textbullet} without moving its vertical center, unlike direct usage of the \LaTeXe{} and \pkg{expl3} commands \cs{scalebox} and \cs{box_scale:}.
+This process is not fully automated\---the user must use \cs{SetTextBulletFactor} to set the \textbulletfactor{} to the correct value to display the resized \cs{textbullet} at the correct height.
+The \textbulletfactor{} is the ratio of the width of the \cs{textbullet}, excluding its empty space, to its width, including its empty space.
+One way of estimating the \textbulletfactor{} is by using \cs{scaletextbulletdebug}.
+
+This package provides a solution that works in text mode.
+For a solution that works only in math mode, see the linked \TeX{} Stack Exchange thread.%
+\footnote{\url{https://tex.stackexchange.com/questions/119319/how-to-correctly-shrink-the-bullets-of-itemize}}
+
+
+\section{Commands}
+\label{sec:commands}
+
+This package defines some commands whose argument takes a \meta{floating point expression} or \meta{integer expression}.
+This syntax has the same representation as the arguments to \cs{fpeval} and \cs{inteval}, documented in \pkg{usrguide}.%
+\footnote{\url{https://ctan.org/pkg/usrguide}}
+
+\cs{SetTextBulletFactor} \marg{floating point expression}
+\KeepNextPar*
+
+Sets the \textbulletfactor{} to the result of computing the \meta{floating point expression}.
+The \textbulletfactor{} is the ratio of the width of the \cs{textbullet}, excluding its empty space, to its width, including its empty space.
+This change is local to the current group.
+The initial \textbulletfactor{} is \num{0.4}\---this matches the dimensions of the \cs{textbullet} of the Latin Modern font at size \qty{10}{pt}.
+
+\cs{ScaleTextBullet} \marg{floating point expression}
+\KeepNextPar*
+
+Prints a \cs{textbullet} with its size scaled by the result of computing the \meta{floating point expression}.
+The new \cs{textbullet} will be printed with the same vertical center only if the \textbulletfactor{} is set to the correct value.
+
+\cs{ScaleTextBullets} \oarg{floating point expression} \marg{integer expression}
+\KeepNextPar*
+
+Prints a number of \cs{textbullet}s equal to the value of \meta{integer expression} with about the same total area as the original \cs{textbullet}.%
+\footnote
+ {%
+ In calculating the total area, I have approximated each \cs{textbullet} as a perfect circle, but, of course, the actual shape depends on the font used.%
+ }
+If the optional argument is used, the size of each \cs{textbullet} is instead scaled by the result of computing the \meta{floating point expression}.
+The new \cs{textbullet} will be printed with the same vertical center only if the \textbulletfactor{} is set to the correct value.
+
+\cs{scaletextbulletdebug}
+\KeepNextPar*
+
+This command is provided only to help the user estimate the \textbulletfactor{}.
+Prints \num{15} consecutive \cs{textbullet}s with decreasing sizes.
+The \cs{textbullet}s are followed by the original \cs{textbullet} inside a framed box.
+The framed box has width equal to the \textbulletfactor{} \texttimes{} the total width of the \cs{textbullet} (this includes its empty space).
+
+The \textbulletfactor{} is set to the correct value when the 15 consecutive \cs{textbullet}s have the same vertical center and the \cs{textbullet} fits nicely inside the framed box.
+
+
+\section{Application}
+\label{sec:application}
+
+I wrote this package primarily to create nicer\-/looking itemized lists.
+The default list labels in \LaTeX{} (and other programs) fail to communicate the list level within the list hierarchy:
+
+\begin{multicols}{2}
+ \begin{itemize}[label=\textbullet]
+ \item List level 1
+ \begin{itemize}[label=\textbf{--}]
+ \item List level 2
+ \item List level 2
+ \begin{itemize}[label=\textasteriskcentered]
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \item List level 1
+ \begin{itemize}[label=\textbf{--}]
+ \item List level 2
+ \begin{itemize}[label=\textasteriskcentered]
+ \item List level 3
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+\end{multicols}
+
+This contrasts with traditional enumerated list structures where the list level is obvious from the numbering of the list label:
+
+\begin{multicols}{2}
+ \begin{enumerate}
+ \item List level 1
+ \begin{enumerate}
+ \item List level 2
+ \item List level 2
+ \begin{enumerate}
+ \item List level 3
+ \end{enumerate}
+ \end{enumerate}
+ \item List level 1
+ \begin{enumerate}
+ \item List level 2
+ \begin{enumerate}
+ \item List level 3
+ \item List level 3
+ \end{enumerate}
+ \end{enumerate}
+ \end{enumerate}
+\end{multicols}
+
+This package allows the user to create nice\-/looking itemized lists using \cs{ScaleTextBullets}:
+
+\begin{multicols}{2}
+ \begin{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+\end{multicols}
+
+Maybe the visual effect is more clear with different fonts.
+This example uses STIX Two Text and Source Serif 4, respectively.
+
+\begingroup
+ \SetTextBulletFactor{0.54}
+ \newfontfamilystixtwo
+ \begin{multicols}{2}
+ \begin{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+ \end{multicols}
+\endgroup
+
+\begingroup
+ \SetTextBulletFactor{0.75}
+ \newfontfamilysourceseriffour
+ \begin{multicols}{2}
+ \begin{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \item List level 1
+ \begin{itemize}
+ \item List level 2
+ \begin{itemize}
+ \item List level 3
+ \item List level 3
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+ \end{multicols}
+\endgroup
+
+
+\section{Implementation notes}
+\label{sec:implementation}
+
+The procedure of resizing the \cs{textbullet} without changing its vertical center, including the definition of the \textbulletfactor{}, makes an important assumption:
+That the \cs{textbullet} is a perfect circle.
+Of course, this is not completely accurate and the actual shape depends on the font used.
+This means that the \textbulletfactor{} may not be exactly the ratio of the width of the \cs{textbullet}, excluding its empty space, to its width, including its empty space.
+
+In writing this package, I have referenced a comment on the \TeX{} Stack Exchange by the user egreg.%
+\footnote{\url{https://tex.stackexchange.com/questions/620507/how-to-resize-textbullet-without-the-bullet-moving-down/638599\#638599}}
+This package uses the same procedure for resizing the \cs{textbullet} without changing its vertical center.
+
+
+\section{Programming}
+\label{sec:programming}
+
+This package is written in \pkg{expl3}, but does not provide any public functions or variables.
+
+
+\end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/scaletextbullet/scaletextbullet.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/scaletextbullet/scaletextbullet.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/scaletextbullet/scaletextbullet.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/scaletextbullet/scaletextbullet.sty 2024-11-11 16:55:06 UTC (rev 72818)
@@ -0,0 +1,212 @@
+% Package : scaletextbullet -- Resize the \textbullet without changing its
+% vertical center
+% Copyright : 2024 (c) Oliver Beery <beeryoliver at gmail.com>
+% CTAN : <ADD CTAN LINK HERE>
+% Repository: https://github.com/beeryoliver/scaletextbullet
+% License : The LaTeX Project Public License 1.3c
+
+% LaTeX2e version 2023-11-01 added \IfExplAtLeastTF.
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
+\ProvidesExplPackage
+ {scaletextbullet}
+ {2024-11-10}
+ {1.0.0}
+ {Resize the \noexpand\textbullet without changing its vertical center.}
+
+% l3kernel version 2023-10-10 added many 'e'-variants.
+\IfExplAtLeastTF { 2023-10-10 } { }
+ {
+ \msg_new:nnn { scaletextbullet } { expl3-out-of-date }
+ {
+ The~ scaletextbullet~ package~ could~ not~ load.~
+ This~ package~ requires~
+ L3~ programming~ layer~ version~ 2023-10-10~ or~ later.
+ }
+ \msg_critical:nn { scaletextbullet } { expl3-out-of-date }
+ }
+
+\tl_new:N \l__scaletextbullet_factor_tl
+\tl_set:Nn \l__scaletextbullet_factor_tl { 0.4 }
+
+% Used to speed up \ScaleTextBullets{2}, \ScaleTextBullets{3}, and
+% \ScaleTextBullets{4}.
+\fp_const:Nn \c__scaletextbullet_ii_fp { 2 ^ -0.5 }
+\fp_const:Nn \c__scaletextbullet_iii_fp { 3 ^ -0.5 }
+\fp_const:Nn \c__scaletextbullet_iv_fp { 0.5 }
+
+% Scratch variables
+\int_new:N \l__scaletextbullet_tmp_int
+\fp_new:N \l__scaletextbullet_tmp_fp
+\box_new:N \l__scaletextbullet_tmp_box
+
+% Lowers the \textbullet to the baseline, scales it by a factor of #2, and
+% then raises it back to the vertical center.
+% I have referenced code by the great egreg:
+% https://tex.stackexchange.com/questions/620507/how-to-resize-textbullet-without-the-bullet-moving-down
+\dim_new:N \l__scaletextbullet_bottom_dim % bottom of \textbullet
+\dim_new:N \l__scaletextbullet_center_dim % center of \textbullet
+\cs_new_protected:Npn \__scaletextbullet_box_scale:Nn #1#2
+ {
+ \hbox_set:Nn #1 { \textbullet }
+ \dim_set:Nn \l__scaletextbullet_bottom_dim
+ { \box_ht:N #1 - \l__scaletextbullet_factor_tl \box_wd:N #1 }
+ \dim_set:Nn \l__scaletextbullet_center_dim
+ { ( \box_ht:N #1 + \l__scaletextbullet_bottom_dim ) / 2 }
+ \hbox_set:Nn #1
+ {
+ \box_move_down:nn { \l__scaletextbullet_bottom_dim } { \box_use:N #1 }
+ }
+ \box_scale:Nnn #1 {#2} {#2}
+ \hbox_set:Nn #1
+ {
+ \box_move_up:nn { \l__scaletextbullet_center_dim - 0.5 \box_ht:N #1 }
+ { \box_use:N #1 }
+ }
+ }
+
+\msg_new:nnn { scaletextbullet } { factor-out-of-bounds }
+ { Invalid~ \iow_char:N \\textbullet~ factor~ '#1'~ \msg_line_context:. }
+\msg_new:nnn { scaletextbullet } { scale-out-of-bounds }
+ { Invalid~ scale~ factor~ '#1'~ \msg_line_context:. }
+\msg_new:nnn { scaletextbullet } { count-out-of-bounds }
+ {
+ Invalid~ number~ of~ \iow_char:N \\textbullet s~ '#1'~ \msg_line_context:.
+ }
+
+% DOCUMENT COMMANDS
+
+\NewDocumentCommand \SetTextBulletFactor { m }
+ { \__scaletextbullet_set_factor:n {#1} }
+\cs_new_protected:Npn \__scaletextbullet_set_factor:n #1
+ {
+ \fp_set:Nn \l__scaletextbullet_tmp_fp {#1}
+ \fp_compare:nTF { \c_zero_fp < \l__scaletextbullet_tmp_fp <= \c_one_fp }
+ {
+ \tl_set:Ne \l__scaletextbullet_factor_tl
+ { \fp_use:N \l__scaletextbullet_tmp_fp }
+ }
+ {
+ \msg_error:nne { scaletextbullet } { factor-out-of-bounds }
+ { \fp_use:N \l__scaletextbullet_tmp_fp }
+ }
+ }
+
+\NewDocumentCommand \ScaleTextBullet { m }
+ { \mode_leave_vertical: \__scaletextbullet_scaletextbullet:n {#1} }
+\cs_new_protected:Npn \__scaletextbullet_scaletextbullet:n #1
+ {
+ \fp_set:Nn \l__scaletextbullet_tmp_fp {#1}
+ \fp_compare:nNnTF \l__scaletextbullet_tmp_fp > \c_zero_fp
+ {
+ \__scaletextbullet_box_scale:Nn \l__scaletextbullet_tmp_box
+ { \l__scaletextbullet_tmp_fp }
+ \box_use_drop:N \l__scaletextbullet_tmp_box
+ }
+ {
+ \fp_compare:nNnF \l__scaletextbullet_tmp_fp = \c_zero_fp
+ {
+ \msg_error:nne { scaletextbullet } { scale-out-of-bounds }
+ { \fp_use:N \l__scaletextbullet_tmp_fp }
+ }
+ }
+ }
+
+\NewDocumentCommand \ScaleTextBullets { o m }
+ {
+ \mode_leave_vertical:
+ \IfNoValueTF {#1}
+ { \__scaletextbullet_scaletextbullets:n {#2} }
+ { \__scaletextbullet_scaletextbullets:nn {#1} {#2} }
+ }
+\cs_new_protected:Npn \__scaletextbullet_scaletextbullets:nn #1#2
+ {
+ \fp_set:Nn \l__scaletextbullet_tmp_fp {#1}
+ \int_set:Nn \l__scaletextbullet_tmp_int {#2}
+ \int_compare:nNnTF \l__scaletextbullet_tmp_int > 0
+ {
+ \fp_compare:nNnTF \l__scaletextbullet_tmp_fp > \c_zero_fp
+ {
+ \__scaletextbullet_box_scale:Nn \l__scaletextbullet_tmp_box
+ { \l__scaletextbullet_tmp_fp }
+ \prg_replicate:nn { \l__scaletextbullet_tmp_int }
+ { \box_use:N \l__scaletextbullet_tmp_box }
+ }
+ {
+ \fp_compare:nNnF \l__scaletextbullet_tmp_fp = \c_zero_fp
+ {
+ \msg_error:nne { scaletextbullet } { scale-out-of-bounds }
+ { \fp_use:N \l__scaletextbullet_tmp_fp }
+ }
+ }
+ }
+ {
+ \int_compare:nNnF \l__scaletextbullet_tmp_int = 0
+ {
+ \msg_error:nnV { scaletextbullet } { count-out-of-bounds }
+ \l__scaletextbullet_tmp_int
+ }
+ }
+ }
+\cs_new_protected:Npn \__scaletextbullet_scaletextbullets:n #1
+ {
+ \int_set:Nn \l__scaletextbullet_tmp_int {#1}
+ \int_compare:nNnTF \l__scaletextbullet_tmp_int > 0
+ {
+ \int_case:nnF { \l__scaletextbullet_tmp_int }
+ {
+ { 1 }
+ { \fp_set_eq:NN \l__scaletextbullet_tmp_fp \c_one_fp }
+ { 2 }
+ {
+ \fp_set_eq:NN \l__scaletextbullet_tmp_fp
+ \c__scaletextbullet_ii_fp
+ }
+ { 3 }
+ {
+ \fp_set_eq:NN \l__scaletextbullet_tmp_fp
+ \c__scaletextbullet_iii_fp
+ }
+ { 4 }
+ {
+ \fp_set_eq:NN \l__scaletextbullet_tmp_fp
+ \c__scaletextbullet_iv_fp
+ }
+ }
+ {
+ \fp_set:Nn \l__scaletextbullet_tmp_fp
+ { \l__scaletextbullet_tmp_int ^ -0.5 }
+ }
+ \__scaletextbullet_box_scale:Nn \l__scaletextbullet_tmp_box
+ { \l__scaletextbullet_tmp_fp }
+ \prg_replicate:nn { \l__scaletextbullet_tmp_int }
+ { \box_use:N \l__scaletextbullet_tmp_box }
+ }
+ {
+ \int_compare:nNnF \l__scaletextbullet_tmp_int = 0
+ {
+ \msg_error:nnV { scaletextbullet } { count-out-of-bounds }
+ \l__scaletextbullet_tmp_int
+ }
+ }
+ }
+
+\NewDocumentCommand \scaletextbulletdebug { }
+ { \mode_leave_vertical: \__scaletextbullet_debug: }
+% I have referenced code by the great egreg:
+% https://tex.stackexchange.com/questions/620507/how-to-resize-textbullet-without-the-bullet-moving-down
+\cs_new_protected:Npn \__scaletextbullet_debug:
+ {
+ \int_step_inline:nn { 15 }
+ {
+ \fp_set:Nn \l__scaletextbullet_tmp_fp { ##1 ^ -0.5 }
+ \__scaletextbullet_box_scale:Nn \l__scaletextbullet_tmp_box
+ { \l__scaletextbullet_tmp_fp }
+ \box_use_drop:N \l__scaletextbullet_tmp_box
+ }
+ \,
+ \group_begin:
+ \dim_set:Nn \fboxrule { 0.1pt }
+ \dim_zero:N \fboxsep
+ \framebox [ \l__scaletextbullet_factor_tl \width ] { \textbullet }
+ \group_end:
+ }
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/scaletextbullet/scaletextbullet.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-11-11 16:53:23 UTC (rev 72817)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-11-11 16:55:06 UTC (rev 72818)
@@ -760,7 +760,7 @@
sanskrit sanskrit-t1 sansmath sansmathaccent sansmathfonts
sapthesis sasnrdisplay sauerj
sauter sauterfonts saveenv savefnmark savesym savetrees
- scale scalebar scalerel scanpages
+ scale scalebar scalerel scaletextbullet scanpages
schedule schemabloc schemata schola-otf scholax schooldocs
schulmathematik sclang-prettifier
schule schulschriften schwalbe-chess
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2024-11-11 16:53:23 UTC (rev 72817)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2024-11-11 16:55:06 UTC (rev 72818)
@@ -2524,6 +2524,7 @@
'sa-tikz', 'tikzlib.*tex|' . $standardtex,
'sansmath', '^..[^s].*\.sty', # not miscdoc.sty
'sapthesis', 'sapienzalogo.pdf|' . $standardtex,
+ 'scaletextbullet', '\.sty$', # not .cls
'scholax', '.*-subs\.tex|' . $standardtex,
'scrhack', '.hak$|' . $standardtex,
'scrlttr2copy','\.lco',
Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2024-11-11 16:53:23 UTC (rev 72817)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2024-11-11 16:55:06 UTC (rev 72818)
@@ -1233,6 +1233,7 @@
depend scale
depend scalebar
depend scalerel
+depend scaletextbullet
depend scanpages
depend schedule
depend schooldocs
Added: trunk/Master/tlpkg/tlpsrc/scaletextbullet.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list.