summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:53:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:53:51 +0000
commit90b005402c0225c63fc6811dbd7a40a4e0fa26a9 (patch)
tree2d9c4b24a75f79b033c327882ffb55efb78ae3d3 /Master/texmf-dist
parent7dd7d72d006668417dd6869486b3ffe71775cb49 (diff)
cursor
git-svn-id: svn://tug.org/texlive/trunk@806 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/tex/latex/cursor/cursor.sty134
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/cursor/cursor.sty b/Master/texmf-dist/tex/latex/cursor/cursor.sty
new file mode 100644
index 00000000000..880ab0219e4
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/cursor/cursor.sty
@@ -0,0 +1,134 @@
+%%%=====================================================
+%%% @LaTeX-file{
+%%% author = "Werenfried F.M. Spit",
+%%% version = "1.1",
+%%% date = "20/01/1999",
+%%% filename = "WSartikel.cls",
+%%% address = "Berberisweg 488
+%%% = NL-3053 PL Rotterdam
+%%% = Nederland",
+%%% e-mail = "W.Spit@witbo.nl",
+%%% telephone = "+31-10-4.186.136",
+%%% telephone2 = "+31-70-3.700.709",
+%%% telefax2 = "+31-70-3.600.098",
+%%% checksum = "55762 134 325 4092",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "LaTeX2e documentstyle",
+%%% supported = "yes",
+%%% abstract = "cursors in formulas",
+%%% }
+%%%=====================================================
+%%%
+%%% usage:
+%%% \Lc{<formulapart>} puts a left-pointing cursor below <formulapart>;
+%%% the cursorheight and width are adapted to it
+%%% \Rc{<formulapart>} puts a right-pointing cursor below <formulapart>;
+%%% \LRc{<p1>}{<p2>} puts a left and right-pointing cursor below <p1>
+%% and <p2>
+%%%
+%%% if the formulapart is empty a standard width is used instead of an
+%%% adapted width
+%%%
+%%% \cursorheight{<formula>} print <formula> and adapt the heights of the
+%%% cursor(s) in it to the heigth of the complete formula
+%%%
+%%%
+%%% all heigths and widths are calculated for display style printing
+%%% all commands can be used in math mode only except
+%%%
+%%% \cursorformula{<formula>} print formula as displayed formula and
+%%% adapt the heights of the cursor(s)in it to the heigth of the complete formula
+%%%
+%%% adaptable parameters:
+%%%
+%%% \cursorlinew line width cursor (0.5pt)
+%%%
+%%% version history
+%%% 20 1.1 added \displaystyle to calculation of cursor width
+%%% 1999/01/18 1.0 first working version
+%%%
+%%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{cursor.sty}[1999/01/20 v1.1 Specialized document class (WS)]
+\newlength{\ruled}
+\newlength{\ruleh}
+\newlength{\rulew}
+\newlength{\rulewr}
+\newlength{\rulewl}
+
+\newlength{\cursorlinew} \setlength{\cursorlinew}{0.5pt}
+
+
+
+\def\cursorformula#1{$$\cursorheight{#1}$$}
+
+\def\cursorheight#1{\bgroup%
+\let\LRc=\relax%
+\let\Lc=\relax%
+\let\Rc=\relax%
+\settoheight{\ruleh}{$\displaystyle #1$}\settodepth{\ruled}{$\displaystyle #1$}%
+\addtolength{\ruled}{0.5ex}%
+\addtolength{\ruleh}{\ruled}%
+\addtolength{\ruleh}{0.5ex}%
+\let\Lc=\l@cursor%
+\let\Rc=\r@cursor%
+\let\LRc=\lr@cursor%
+#1
+\egroup}
+
+
+
+\def\L@cursor#1{%
+\settoheight{\ruleh}{$\displaystyle #1$}%
+\settodepth{\ruled}{$\displaystyle #1$}%
+\addtolength{\ruled}{0.5ex}%
+\addtolength{\ruleh}{\ruled}%
+\addtolength{\ruleh}{0.5ex}
+\l@cursor{#1}%
+}
+
+
+\def\R@cursor#1{%
+\settoheight{\ruleh}{$\displaystyle #1$}%
+\settodepth{\ruled}{$\displaystyle #1$}%
+\addtolength{\ruled}{0.5ex}%
+\addtolength{\ruleh}{\ruled}%
+\addtolength{\ruleh}{0.5ex}
+\r@cursor{#1}%
+}
+
+
+\def\LR@cursor#1#2{%
+\settoheight{\ruleh}{$\displaystyle #1 #2$}%
+\settodepth{\ruled}{$\displaystyle #1 #2$}%
+\addtolength{\ruled}{0.5ex}%
+\addtolength{\ruleh}{\ruled}%
+\addtolength{\ruleh}{0.5ex}
+\lr@cursor{#1}{#2}%
+}
+
+
+\def\l@cursor#1{\settowidth{\rulewl}{$#1$}%
+\ifdim\rulewl=\z@\rulewl=1em\else\settowidth{\rulewl}{$\displaystyle #1\,$}\fi%
+\,\rlap{\rule[-\ruled]{\cursorlinew}{\ruleh}%
+\rule[-\ruled]{\rulewl}{\cursorlinew}}\,#1}
+
+\def\r@cursor#1{\settowidth{\rulewr}{$#1$}%
+\ifdim\rulewr=\z@\rulewr=1em\else\settowidth{\rulewr}{$\displaystyle\,#1$}\fi%
+#1\,\llap{\rule[-\ruled]{\rulewr}{\cursorlinew}%
+\rule[-\ruled]{\cursorlinew}{\ruleh}}\,}
+
+\def\lr@cursor#1#2{%
+\settowidth{\rulewl}{$#1$}\settowidth{\rulewr}{$#2$}%
+\ifdim\rulewl=\z@\rulewl=1em\else\settowidth{\rulewl}{$\displaystyle #1\,$}\fi%
+\ifdim\rulewr=\z@\rulewr=1em\else\settowidth{\rulewr}{$\displaystyle\,#2$}\fi%
+#1\,\llap{\rule[-\ruled]{\rulewl}{\cursorlinew}}%
+\rule[-\ruled]{\cursorlinew}{\ruleh}%
+\rlap{\rule[-\ruled]{\rulewr}{\cursorlinew}}\,#2}
+
+
+%\global
+\global\let\Lc=\L@cursor
+\global\let\Rc=\R@cursor
+\global\let\LRc=\LR@cursor
+\endinput