| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% arcs.dtx |
| 4 |
% Copyright 2004 Gianfranco Boggio-Togna |
| 5 |
% |
| 6 |
% This program may be distributed and/or modified under the |
| 7 |
% conditions of the LaTeX Project Public License, either version~1.2 |
| 8 |
% of this license or (at your option) any later version. |
| 9 |
% The latest version of this license is in |
| 10 |
% http://www.latex-project.org/lppl.txt |
| 11 |
% and version 1.2 or later is part of all distributions of LaTeX |
| 12 |
% version 1999/12/01 or later. |
| 13 |
% |
| 14 |
% This program consists of the files arcs.dtx and arcs.ins |
| 15 |
% |
| 16 |
%<*driver> |
| 17 |
\documentclass[11pt]{ltxdoc} |
| 18 |
\setlength{\parindent}{0pt} |
| 19 |
\setlength{\parskip}{1ex} |
| 20 |
\MakeShortVerb{|} |
| 21 |
% To get the documented source of the package, comment out |
| 22 |
% the next line and uncomment the following one. |
| 23 |
\OnlyDescription |
| 24 |
%\AlsoImplementation |
| 25 |
\begin{document} |
| 26 |
\DocInput{arcs.dtx} |
| 27 |
\end{document} |
| 28 |
%</driver> |
| 29 |
% |
| 30 |
% \fi |
| 31 |
% |
| 32 |
% \CheckSum{188} |
| 33 |
% \makeatletter |
| 34 |
% \let\ps@titlepage=\ps@empty |
| 35 |
% \makeatother |
| 36 |
% |
| 37 |
% \title{{\LARGE\tt arcs.sty}\\ |
| 38 |
% Placing an arc over (under) some text\\ |
| 39 |
% {\small Version 1\ \ (2004/05/09)}\\\ \\} |
| 40 |
% \author{Gianfranco Boggio\,--Togna\\ |
| 41 |
% \textsl{gbt\kern .08em @\kern .1em acm.org}} |
| 42 |
% \date{} |
| 43 |
% \maketitle |
| 44 |
% \vspace{6ex} |
| 45 |
% The package provides two commands for placing an arc over or under |
| 46 |
% a short (up to three letters) piece of text. The commands generate an |
| 47 |
% |\hbox| and can be used in math formulas |
| 48 |
% (see \textit{The \TeX{}book}, p.\,151). |
| 49 |
% |
| 50 |
% |\overarc| puts an arc above the text given as argument.\\ |
| 51 |
% |\underarc| puts the arc below the text. |
| 52 |
% |
| 53 |
% The size of the arc is chosen so that it embraces all the text. In |
| 54 |
% some cases, you may wish to use a smaller or larger size. An |
| 55 |
% optional argument can specify a factor which |
| 56 |
% is multiplied by the width of the text: the size of the symbol is then |
| 57 |
% chosen as if the text had that width. Keep in mind, however, that only |
| 58 |
% a limited range of sizes is available in the Computer Modern fonts. |
| 59 |
% \vfill |
| 60 |
% {\footnotesize |
| 61 |
% \noindent \copyright\ Copyright 2004 Gianfranco Boggio\,--Togna.\par |
| 62 |
% This program may be distributed and/or modified under the |
| 63 |
% conditions of the \LaTeX{} Project Public License, either version~1.2 |
| 64 |
% of this license or (at your option) any later version. |
| 65 |
% The latest version of this license is in |
| 66 |
% \texttt{http://www.latex-project.org/lppl.txt} |
| 67 |
% and version 1.2 or later is part of all distributions of \LaTeX{} |
| 68 |
% version 1999/12/01 or later.\par |
| 69 |
% This program consists of the files \texttt{arcs.dtx} and |
| 70 |
% \texttt{arcs.ins} |
| 71 |
% } |
| 72 |
% \newpage |
| 73 |
% \StopEventually{} |
| 74 |
% \section*{The code} |
| 75 |
% \begin{macrocode} |
| 76 |
\NeedsTeXFormat {LaTeX2e}[2003/12/01] |
| 77 |
\ProvidesPackage {arcs}[2004/05/09] |
| 78 |
\RequirePackage {relsize} |
| 79 |
\newcommand{\overarc}[2][1]{\over@under@arc{#1}{#2}\z@} |
| 80 |
\newcommand{\underarc}[2][1]{\over@under@arc{#1}{#2}\@ne} |
| 81 |
\newcommand{\over@under@arc}[3]{% |
| 82 |
\leavevmode |
| 83 |
\hbox {% |
| 84 |
\setbox\z@ = \hbox {#2}% |
| 85 |
\ifdim \ht\z@ = \z@ % arc over/under space |
| 86 |
\ifdim \dp\z@ = \z@ |
| 87 |
\ht\z@ = 1ex\relax |
| 88 |
\fi |
| 89 |
\fi |
| 90 |
\dimen@ = #1\wd\z@ |
| 91 |
\begingroup |
| 92 |
\let \rs@size@warning = \@gobbletwo |
| 93 |
\relsize{-10}% |
| 94 |
\wd\@ne = \z@ |
| 95 |
\@whiledim \wd\@ne < .95\dimen@ \do {% |
| 96 |
\ifx \@currsize \Huge |
| 97 |
\dimen@ = \z@ |
| 98 |
\else |
| 99 |
$% |
| 100 |
\skip@ = \f@baselineskip |
| 101 |
\fontencoding{OML}\fontfamily{cmm}\fontseries{m}% |
| 102 |
\fontshape{it}\fontsize{\ssf@size}{\skip@}\selectfont |
| 103 |
\global \setbox\@ne = \hbox {% |
| 104 |
\hss\symbol{"5\ifnum #3=\z@ F\else E\fi}\hss}% |
| 105 |
\ifdim \wd\@ne < \dimen@ |
| 106 |
\fontsize{\sf@size}{\skip@}\selectfont |
| 107 |
\global \setbox\@ne = \hbox {% |
| 108 |
\hss\symbol{"5\ifnum #3=\z@ F\else E\fi}\hss}% |
| 109 |
\ifdim \wd\@ne < \dimen@ |
| 110 |
\fontsize{\tf@size}{\skip@}\selectfont |
| 111 |
\global \setbox\@ne = \hbox {% |
| 112 |
\hss\symbol{"5\ifnum #3=\z@ F\else E\fi}\hss}% |
| 113 |
\fi |
| 114 |
\fi |
| 115 |
$% |
| 116 |
\fi |
| 117 |
\ifdim \wd\@ne < \dimen@ |
| 118 |
\relsize{+1}% |
| 119 |
\fi |
| 120 |
\global \dimen@i = \fontdimen5\the\font |
| 121 |
}% |
| 122 |
\endgroup |
| 123 |
\ifnum #3 = \z@ |
| 124 |
\dimen@ii = 1.067\ht\z@ |
| 125 |
\global \divide \dimen@i by \tw@ |
| 126 |
\global \advance \dimen@i by -\ht\@ne |
| 127 |
\advance \dimen@ii by .6\dimen@i |
| 128 |
\else |
| 129 |
\dimen@ii = -1.05\ht\@ne |
| 130 |
\advance \dimen@ii by -.75pt |
| 131 |
\ifdim \dp\z@ > \z@ |
| 132 |
\advance \dimen@ii by -\dp\z@ |
| 133 |
\fi |
| 134 |
\fi |
| 135 |
\copy\z@ |
| 136 |
\dimen@ = \wd\z@ |
| 137 |
\advance \dimen@ by \wd\@ne |
| 138 |
\kern -.5\dimen@ |
| 139 |
\raisebox {\dimen@ii}[\z@][\z@]{\copy\@ne}% |
| 140 |
\dimen@ = \wd\z@ |
| 141 |
\advance \dimen@ by -\wd\@ne |
| 142 |
\dimen@ = .5\dimen@ |
| 143 |
\kern \dimen@ |
| 144 |
}% |
| 145 |
} |
| 146 |
% \end{macrocode} |
| 147 |
%% \Finale |
| 148 |
\endinput |