summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/soulpos
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/soulpos
Initial commit
Diffstat (limited to 'macros/latex/contrib/soulpos')
-rw-r--r--macros/latex/contrib/soulpos/README.md12
-rw-r--r--macros/latex/contrib/soulpos/soulpos.pdfbin0 -> 159838 bytes
-rw-r--r--macros/latex/contrib/soulpos/soulpos.sty285
-rw-r--r--macros/latex/contrib/soulpos/soulpos.tex372
4 files changed, 669 insertions, 0 deletions
diff --git a/macros/latex/contrib/soulpos/README.md b/macros/latex/contrib/soulpos/README.md
new file mode 100644
index 0000000000..5a16c48004
--- /dev/null
+++ b/macros/latex/contrib/soulpos/README.md
@@ -0,0 +1,12 @@
+
+Combines soul and the savepos tools provided by pdftex and compatible
+for fancy underlining.
+
+License: MIT
+________
+Javier Bezos --- http://www.texnia.com
+
+
+
+
+
diff --git a/macros/latex/contrib/soulpos/soulpos.pdf b/macros/latex/contrib/soulpos/soulpos.pdf
new file mode 100644
index 0000000000..ce534eb462
--- /dev/null
+++ b/macros/latex/contrib/soulpos/soulpos.pdf
Binary files differ
diff --git a/macros/latex/contrib/soulpos/soulpos.sty b/macros/latex/contrib/soulpos/soulpos.sty
new file mode 100644
index 0000000000..d32deec72b
--- /dev/null
+++ b/macros/latex/contrib/soulpos/soulpos.sty
@@ -0,0 +1,285 @@
+%
+% Copyright (C) 2012-2019 Javier Bezos http://www.texnia.com
+%
+% This file may be distributed and/or modified under the conditions of
+% the MIT License. A version can be found at the end of this file.
+%
+% Repository: https://github.com/jbezos/esindex
+%
+
+\ProvidesPackage{soulpos}[2012/02/25 v1.1 Fancy underlining]
+
+\newcount\ulp@subcnt
+\newcount\ulp@cnt
+
+\newwrite\ulp@out
+\newread\ulp@in
+
+\AtBeginDocument{\ulp@begindoc}
+
+\def\ulp@begindoc{%
+ \@ifundefined{SOUL@}%
+ {\PackageInfo{soulpos}{Loading soulutf8}%
+ \RequirePackage{soulutf8}}{}%
+ \openout\ulp@out=\jobname.upa\relax
+ \openin\ulp@in=\jobname.upb\relax}
+
+\let\ulp@afterend\relax
+
+\AtEndDocument{%
+ \closeout\ulp@out
+ \closein\ulp@in
+ \write\@auxout{\string\ulp@afterend}%
+ \def\ulp@afterend{%
+ \ulp@cnt\z@
+ \message{* soulpos - computing points - it may take a few seconds *}%
+ \immediate\openout\ulp@out=\jobname.upb\relax
+ \begingroup
+ \makeatletter
+ \InputIfFileExists{\jobname.upa}{}{}%
+ \endgroup
+ \immediate\closeout\ulp@out}}
+
+% Underlining options
+% --------------------
+
+\RequirePackage{keyval}
+
+\define@key{soulpos}{overdraw}[true]{\@nameuse{ulp@pos@#1}}
+\def\ulp@pos@false{\def\ulp@pos{\z@}}
+\def\ulp@pos@true{\def\ulp@pos{\@ne}}
+
+\newif\ifulp@includehyphens
+\ulp@includehyphenstrue
+
+\define@key{soulpos}{hyphens}[include]{\@nameuse{ulp@hyp@#1}}
+\def\ulp@hyp@include{\ulp@includehyphenstrue}
+\def\ulp@hyp@exclude{\ulp@includehyphensfalse}
+
+\define@key{soulpos}{xoffset}[0pt]{\def\ulp@skern{#1}\def\ulp@ekern{#1}}
+\define@key{soulpos}{xoffset-start}[0pt]{\def\ulp@skern{#1}}
+\define@key{soulpos}{xoffset-end}[0pt]{\def\ulp@ekern{#1}}
+
+\define@key{soulpos}{gap}[0pt]{\def\ulp@sgap{#1}\def\ulp@egap{#1}}
+\define@key{soulpos}{gap-start}[0pt]{\def\ulp@sgap{#1}}
+\define@key{soulpos}{gap-end}[0pt]{\def\ulp@egap{#1}}
+
+% Computing start/end points
+% ---------------------------
+
+\newcommand\ulpostolerance{0}%
+
+\let\ulp@Gb\relax
+\def\ulp@Pb#1{\expandafter\gdef\csname ulp@@#1\endcsname}
+
+\def\ulp@writeb{%
+ \count@\ulp@xlast
+ \advance\count@-\ulp@xfirst
+ \immediate\write\ulp@out{%
+ \string\ulp@Pb{\ulp@ulsub}%
+ {{\the\count@}\ulp@startprev\ulp@endprev}\@percentchar}}
+
+\def\ulp@Ga#1#2{%
+ \advance\ulp@cnt\@ne
+ \def\ulp@pos{#1}%
+ \immediate\write\ulp@out{\string\ulp@Gb\string{\@percentchar\iffalse}\fi}%
+ #2%
+ \ulp@writeb
+ \immediate\write\ulp@out{\iffalse{\fi\string}\@percentchar}}
+
+\def\ulp@Pa#1#2#3#4{%
+ \@tempswafalse
+ \ifnum#2=\@ne
+ \@tempswatrue
+ \else
+ \count@\ulp@ylast\relax
+ \advance\count@-#4\relax
+ \ifnum\ulpostolerance<\count@
+ \ulp@writeb
+ \@tempswatrue
+ \else\ifnum-\ulpostolerance>\count@
+ \ulp@writeb
+ \@tempswatrue
+ \fi\fi
+ \fi
+ \if@tempswa
+ \def\ulp@xfirst{#3}%
+ \def\ulp@startprev{#1}%
+ \ifnum\ulp@pos=\z@
+ \edef\ulp@ulsub{#2}%
+ \fi
+ \fi
+ \def\ulp@endprev{#1}%
+ \def\ulp@xlast{#3}%
+ \def\ulp@ylast{#4}%
+ \ifnum\ulp@pos=\@ne
+ \edef\ulp@ulsub{#2}%
+ \fi}
+
+% Writing points to .upa
+% ----------------------
+
+\def\ulp@stepput{\ulp@step\ulp@put}
+\def\ulp@step{\global\advance\ulp@subcnt\@ne}
+
+% 0: text, 1: space, 2: discretionary, 3 exhyph
+
+\newdimen\ulwidth
+
+\def\ulp@fetch#1#2#3{%
+ \ulwidth#1sp\relax
+ \def\ulstarttype{#2}%
+ \def\ulendtype{#3}}
+
+\def\ulp@put#1{%
+ \hb@xt@\z@\bgroup
+ \ifcase\ulp@pos\else\hss\fi % over
+ \@ifundefined{ulp@@\the\ulp@subcnt}{}%
+ {\expandafter\expandafter\expandafter
+ \ulp@fetch\csname ulp@@\the\ulp@subcnt\endcsname
+ \ulp@draw
+ \global\expandafter\let\csname ulp@@\the\ulp@subcnt\endcsname\@undefined}%
+ \ifcase\ulp@pos\hss\fi % over
+ \pdfsavepos
+ \protected@write\ulp@out{}%
+ {\string\ulp@Pa\number#1{\the\ulp@subcnt}%
+ {\noexpand\the\pdflastxpos}{\noexpand\the\pdflastypos}%
+ \@percentchar}%
+ \egroup}
+
+% The command for defining underlines
+% ------------------------------------
+
+\def\ulp@preamble{%
+ \ifeof\ulp@in
+ \else
+ \begingroup
+ \makeatletter
+ \catcode`\^^M=9 % avoids extra \par's
+ \read\ulp@in to\@tempa
+ \@tempa
+ \endgroup
+ \fi
+ \global\advance\ulp@cnt\@ne
+ \ulp@subcnt\z@
+ \ifdim\ulp@sgap>0pt % sacar también desde aquí
+ \ifdim\lastskip>5sp
+ \unskip
+ \hskip\ulp@sgap
+ \fi
+ \fi
+ \protected@write\ulp@out{}{%
+ \string\ulp@Ga\ulp@pos
+ \string{\@percentchar\iffalse}\fi}%
+ \SOUL@setkern{-\ulp@skern}%
+ \ulp@stepput\z@
+ \SOUL@setkern\ulp@skern}
+
+\def\ulp@postamble{%
+ \SOUL@setkern\ulp@ekern
+ \ulp@stepput\z@
+ \SOUL@setkern{-\ulp@ekern}%
+ \write\ulp@out{\iffalse{\fi\string}\@percentchar}%
+ \ifdim\ulp@egap>0pt
+ \global\skip@\ulp@egap
+ \aftergroup\SOUL@socheck
+ \fi}%
+
+\def\ulp@everyspace#1{%
+ \ulp@stepput\@ne
+ #1\space
+ \ulp@stepput\@ne}%
+
+\def\ulp@everyhyphen{%
+ \ifulp@includehyphens
+ \ulp@step
+ \else
+ \ulp@stepput\tw@
+ \fi
+ \ulp@step
+ \discretionary
+ {\SOUL@setkern\SOUL@hyphkern
+ \SOUL@sethyphenchar
+ \global\advance\ulp@subcnt\m@ne
+ \ifulp@includehyphens
+ \ulp@put\tw@
+ \fi
+ \ulp@step}%
+ {\ulp@put\tw@}%
+ {}}%
+
+\def\ulp@everyexhyphen#1{%
+ \SOUL@setkern\SOUL@hyphkern
+ \ifulp@includehyphens
+ \hbox{#1}%
+ \ulp@stepput\thr@@
+ \else
+ \ulp@stepput\thr@@
+ \hbox{#1}%
+ \fi
+ \ulp@step
+ \discretionary{}%
+ {\ulp@put\thr@@}%
+ {\SOUL@setkern\SOUL@charkern}}%
+
+\newcommand\ulposdef[1]{%
+ \@ifnextchar[{\ulp@def#1}{\ulp@def#1[]}}
+
+\def\ulp@def#1[#2]#3{
+ \DeclareRobustCommand*#1{%
+ \def\SOUL@preamble{%
+ \def\ulp@skern{0pt}%
+ \def\ulp@ekern{0pt}%
+ \def\ulp@sgap{0pt}%
+ \def\ulp@egap{0pt}%
+ \def\ulp@pos{\z@}%
+ \setkeys{soulpos}{#2}%
+ \def\ulp@draw{#3}%
+ \ulp@preamble}%
+ \let\SOUL@postamble\ulp@postamble
+ \let\SOUL@everyspace\ulp@everyspace
+ \let\SOUL@everyhyphen\ulp@everyhyphen
+ \let\SOUL@everyexhyphen\ulp@everyexhyphen
+ \let\SOUL@everysyllable\@empty
+ \def\SOUL@everytoken{\the\SOUL@token}%
+ \SOUL@}}
+
+\newcommand\ifulstarttype[1]{%
+ \ifnum\ulstarttype=#1\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+
+\newcommand\ifulendtype[1]{%
+ \ifnum\ulendtype=#1\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+
+\endinput
+
+MIT License
+-----------
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
diff --git a/macros/latex/contrib/soulpos/soulpos.tex b/macros/latex/contrib/soulpos/soulpos.tex
new file mode 100644
index 0000000000..7379469c29
--- /dev/null
+++ b/macros/latex/contrib/soulpos/soulpos.tex
@@ -0,0 +1,372 @@
+%
+% Copyright (C) 2012-2019 Javier Bezos http://www.texnia.com
+%
+% This file may be distributed and/or modified under the conditions of
+% the MIT License. A version can be found at the end of this file.
+%
+
+\documentclass[a4paper,twocolumn]{article}
+
+\title{Underlining (and more) with soulpos}
+\author{Javier Bezos}
+\date{2012-02-25}
+
+\usepackage{tikz}
+\usetikzlibrary{decorations.pathmorphing}
+
+% \usepackage{soul}
+\usepackage{soulpos}
+
+\renewcommand{\ulpostolerance}{12}
+
+\advance\textwidth16mm
+\advance\oddsidemargin-8mm
+
+\makeatletter
+\newenvironment{desc}
+ {\vskip2ex
+ \hrule
+ \trivlist\item[]}
+ {\endtrivlist}
+\makeatother
+
+\begin{document}
+
+\maketitle
+
+This package just combines \textsf{soul} with the \texttt{savepos}
+mechanism provided by the pdftex engine, so that you can create
+(almost) arbitrary underlining and similar ``decorations'', including
+rules, leaders and even pictures (\textsf{pgf}, \textsf{pstricks},
+etc.). Unlike \textsf{soul} underlines, which are built by repeating small
+elements, here each chunk of text to be underlined is a single
+element.
+
+The main drawback is obvious -- since it relies on \verb|\pdfsavepos|
+two passes are necessary. Further, to prevent exhausting the hash
+table, the auxiliary file containing the information about each
+underline is read only when needed, which may impact performance
+negatively.\footnote{Actually, two files are created, with extensions
+\texttt{upa} and \texttt{upb}.}
+
+Internally \textsf{soul} knows to some point where a break happens,
+and this information may be used to set diferent styles depending on
+the position.
+
+This version (1.0) does almost no checking (e.g., to warn about the
+need for a new run), which is left for a later release.
+
+The package \textsf{soulutf8} is loaded if it (or \textsf{soul}) has
+not been loaded before (note the UTF-8 encoding is not necessary for
+\textsf{soulutf8} to work).
+
+\section{Usage}
+
+Underlining macros are defined much like in \textsf{soul}.
+
+\begin{desc}
+\verb|\ulposdef{<name>}[<options>]{<commands>}|
+\end{desc}
+
+Defines an underline as \verb|<commands>|, which is placed in a box of
+width zero with either \verb|\llap| or \verb|\rlap|, as explained
+below. Typically, \verb|<commands>| will contain a rule or leaders.
+If the text spans more than one line, then there will be several
+chunks to be undelined (one per line).
+
+You can use the following macros in \verb|<commands>|.
+
+\begin{desc}
+\verb|\ulwidth|
+\end{desc}
+
+The width of the text block to be underlined. A basic underlining is:
+\begin{verbatim}
+\ulposdef{\uline}{\rule[-.8ex]{\ulwidth}{.5pt}}
+\end{verbatim}
+
+\begin{desc}
+\verb|\ifulstarttype{<type>}{<true>}{<false>}|\qquad
+\verb|\ifulendtype{<type>}{<true>}{<false>}|
+\end{desc}
+
+These tests can be used in \verb|<commands>|, to set different underlining
+styles depending on where the current chunk begins or ends. Here
+\verb|<type>| is: 0 if the very start or end of the underlined text, 1 if a
+space, 2 if a discretionary hyphen and 3 if an explicit hyphen. See
+an example below.
+
+\begin{desc}
+\verb|\ulstarttype|\qquad\verb|\ulendtype|
+\end{desc}
+
+Macros storing the values described above, so that you can use
+\LaTeX{} conditionals (or \TeX{} ones). So, to check if the end is an
+hyphen, test \verb|\ulendtype>1|.
+
+\vskip2ex
+\hrule
+\vskip2ex
+
+Valid keys/values in \verb|<options>| are:
+
+\begin{description}
+\item[\texttt{xoffset}]
+This key provides a simple way to fix an unpleasant effect found in
+many programs when colouring the text background -- the colour starts
+and ends just at the edges of the first and last characters. Just set
+the offset to a value larger than 0pt, as for example .1 em. This
+value is added ($\times$2) to \verb|\ulwidth|, but no space is added
+to the text (which can be done with the \verb|gap| key). Of course,
+you can still do finer adjustments in the definition of the underline,
+as shown in the samples below. You can use \verb|xoffset-start| and
+\verb|xoffset-end| to set the corresponding values separately.
+
+\item[\texttt{gap}] It is equivalent to the outer space in
+\verb|\sodef|. This value is \textit{not} added to \verb|\ulwidth|.
+You can use \verb|gap-start| and \verb|gap-end| to set the
+corresponding values separately.
+
+\item[\texttt{hyphens}] Sometimes excluding the hyphen from the
+underlined text could make sense. Default is \verb|hyphens=include|
+but you can set it to \verb|hyphens=exclude|.
+
+\item[\texttt{overdraw}] By default underlines are drawn before the
+text is typeset (with \verb|\rlap|), so that they are placed behind.
+However, it can be drawn after (with \verb|\llap|), on top the text,
+with \verb|overdraw| or, equivalently, \verb|overdraw=true| (default
+is \verb|overdraw=false|).
+\end{description}
+
+\begin{desc}
+\verb|\ulpostolerance|
+\end{desc}
+
+The current algorithm is based on changes of the $y$ coordinate of
+savepos and therefore presumes a regular baseline. Any increasing or
+decreasing of $y$ is considered a new chunk, but you can give a certain
+tolerance with, for example:
+\begin{verbatim}
+\renewcommand{\ulpostolerance}{12}
+\end{verbatim}
+
+\section{Future work}
+
+\begin{itemize}
+\item Warnings.
+\item In short documents, providing an option for using the aux file.
+\item Redefinable macros.
+\item \texttt{offset}, including edges at line breaks.
+\item \texttt{.upb} is generated at the end of the run, so it might be
+used by another program to generate the decorations. As of 1.0.
+however, its syntax is likely to change and therefore unsupported.
+\item Better manual.
+\item Improved performance.
+\item Fixing some issues in multicolumn text (it does not work if there
+are just two lines, one at the left and the other at the right).
+\item Some predefined ``decorations''.
+\end{itemize}
+
+\newcommand\ulpossample[1]{%
+A single #1{word}. Now #1{a few words}. Longer:
+#1{this text spans several lines, so that you can see the behaviour of
+\textsf{soulpos} where there are line breaks}.\vskip2ex\hrule\vskip2ex}
+
+\section{Examples}
+
+% \def\ulpostolerance{-78}
+
+\makeatletter
+\expandafter\def\expandafter\verbatim@font\expandafter{%
+ \verbatim@font\small}
+\makeatother
+
+\begin{verbatim}
+\ulposdef{\ulpgfA}{%
+ \raisebox{-.75ex}{%
+ \begin{tikzpicture}%
+ \clip (0,-1pt) rectangle (\ulwidth,1pt);
+ \draw[
+ color=black!40,
+ line width=.7pt,
+ decorate,
+ decoration=
+ {random steps,
+ segment length=1.5mm,
+ amplitude=.5pt}]
+ (0,0) -- +(\ulwidth+3pt,0);
+ \end{tikzpicture}}}
+\end{verbatim}
+
+\ulposdef\ulpgfA{%
+ \raisebox{-.75ex}{%
+ \begin{tikzpicture}%
+ \clip (0,-1pt) rectangle (\ulwidth,1pt);
+ \draw[
+ color=black!40,
+ line width=.7pt,
+ decorate,
+ decoration=
+ {random steps,segment length=1.5mm,amplitude=.5pt}]
+ (0,0) -- +(\ulwidth+3pt,0);
+ \end{tikzpicture}}}
+
+\ulpossample\ulpgfA
+
+\begin{verbatim}
+\ulposdef{\ulpgfB}{%
+ \raisebox{-.75ex}{%
+ \begin{tikzpicture}%
+ \clip (0,-1pt) rectangle (\ulwidth,1pt);
+ \draw[color=black!40,
+ line width=.7pt,
+ decorate,
+ decoration=
+ {snake,
+ amplitude=.3pt,
+ segment length=1mm,}]
+ (0,0) -- +(\ulwidth+3pt,0);
+ \end{tikzpicture}}}
+\end{verbatim}
+
+\ulposdef\ulpgfB{%
+ \raisebox{-.75ex}{%
+ \begin{tikzpicture}%
+ \clip (0,-1pt) rectangle (\ulwidth,1pt);
+ \draw[color=black!40,
+ line width=.7pt,
+ decorate,
+ decoration=
+ {snake, amplitude=.3pt,segment length=1mm,}]
+ (0,0) -- +(\ulwidth+3pt,0);
+ \end{tikzpicture}}}
+
+\ulpossample\ulpgfB
+
+\begin{verbatim}
+\ulposdef{\ulpgfC}[xoffset=.15em]{%
+ \ifulstarttype{0}%
+ {\def\arr{|}}%
+ {\def\arr{<}}%
+ \ifulendtype{0}%
+ {\edef\arr{\arr-|}}%
+ {\edef\arr{\arr->}}%
+ \raisebox{-.7ex}{%
+ \tikz
+ \draw[\arr,color=black!40,
+ line width=1pt]
+ (0,0) -- +(\ulwidth-1pt,0);}}
+\end{verbatim}
+
+\ulposdef\ulpgfC[xoffset=.15em]{%
+ \ifulstarttype{0}%
+ {\def\arr{|}}%
+ {\def\arr{<}}%
+ \ifulendtype{0}%
+ {\edef\arr{\arr-|}}%
+ {\edef\arr{\arr->}}%
+ \raisebox{-.7ex}{%
+ \tikz
+ \draw[\arr,color=black!40,
+ line width=1pt]
+ (0,0) -- +(\ulwidth-1pt,0);}}
+
+\ulpossample\ulpgfC
+
+\begin{verbatim}
+\ulposdef{\ulbgdD}{%
+ \mbox{%
+ \color{black!30}%
+ \rule[-.8ex]{\ulwidth}{13pt}}}
+\end{verbatim}
+
+\ulposdef\ulbgdD{%
+ \mbox{%
+ \color{black!30}%
+ \rule[-.8ex]{\ulwidth}{13pt}}}
+
+\ulpossample\ulbgdD
+
+\begin{verbatim}
+\ulposdef{\ulbgdE}[xoffset=.1em]{%
+ \mbox{%
+ \color{black!30}%
+ \rule[-.8ex]{\ulwidth}{13pt}}}
+\end{verbatim}
+
+\ulposdef\ulbgdE[xoffset=.1em]{%
+ \mbox{%
+ \color{black!30}%
+ \rule[-.8ex]{\ulwidth}{13pt}}}
+
+\ulpossample\ulbgdE
+
+\begin{verbatim}
+\ulposdef{\uldash}{%
+ \makebox[\ulwidth]{%
+ \color{blue}%
+ \xleaders\hbox to.27em
+ {\hss\rule[-.8ex]{.18em}{.5pt}\hss}%
+ \hfill}}
+\end{verbatim}
+
+\ulposdef\uldash{%
+ \makebox[\ulwidth]{%
+ \color{blue}%
+ \xleaders\hbox to.27em{\hss\rule[-.8ex]{.18em}{.5pt}\hss}\hfill}}
+
+\ulpossample\uldash
+
+\begin{verbatim}
+\ulposdef{\uldot}{%
+ \mbox{%
+ \raisebox{-.85ex}{%
+ \xleaders\hbox to.2em
+ {\hss\footnotesize.\hss}\hskip\ulwidth}}}
+\end{verbatim}
+
+\ulposdef\uldot{%
+ \mbox{%
+ \raisebox{-.85ex}{\xleaders\hbox to.2em{\hss\footnotesize.\hss}\hskip\ulwidth}}}
+
+\ulpossample\uldot
+
+\begin{verbatim}
+\ulposdef{\ulflag}{%
+ \mbox{%
+ \color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}%
+ \color{yellow}\rule[-.85ex]{.5\ulwidth}{1.5pt}%
+ \color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}}}
+\end{verbatim}
+
+\ulposdef\ulflag{%
+ \mbox{%
+ \color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}%
+ \color{yellow}\rule[-.85ex]{.5\ulwidth}{1.5pt}%
+ \color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}}}
+
+\ulpossample\ulflag
+
+\end{document}
+
+MIT License
+-----------
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file