summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/cursor
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/cursor
Initial commit
Diffstat (limited to 'macros/latex/contrib/cursor')
-rw-r--r--macros/latex/contrib/cursor/cursor.pdfbin0 -> 26395 bytes
-rw-r--r--macros/latex/contrib/cursor/cursor.sty134
-rw-r--r--macros/latex/contrib/cursor/cursor.tex69
-rw-r--r--macros/latex/contrib/cursor/read.me9
4 files changed, 212 insertions, 0 deletions
diff --git a/macros/latex/contrib/cursor/cursor.pdf b/macros/latex/contrib/cursor/cursor.pdf
new file mode 100644
index 0000000000..6fdbea5875
--- /dev/null
+++ b/macros/latex/contrib/cursor/cursor.pdf
Binary files differ
diff --git a/macros/latex/contrib/cursor/cursor.sty b/macros/latex/contrib/cursor/cursor.sty
new file mode 100644
index 0000000000..880ab0219e
--- /dev/null
+++ b/macros/latex/contrib/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
diff --git a/macros/latex/contrib/cursor/cursor.tex b/macros/latex/contrib/cursor/cursor.tex
new file mode 100644
index 0000000000..02af786b6b
--- /dev/null
+++ b/macros/latex/contrib/cursor/cursor.tex
@@ -0,0 +1,69 @@
+% just an example of the useage of cursor.sty
+
+\documentclass{article}
+\usepackage{example,cursor}
+\begin{document}
+
+
+
+\begin{example}
+\cursorformula{D^\sigma_{\!x|a}
+\LRc{f(x) =}{\frac{d^\sigma}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}}
+$$D^\sigma_{\!x|a}
+\LRc{f(x) =}{\frac{d^\sigma}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}$$
+$D^\sigma_{\!x|a}
+\LRc{f(x) =}{\frac{d^\sigma}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}$
+\end{example}
+
+\begin{example}
+\cursorformula{D^\sigma_{\!x|a} f(x) =
+\LRc{}{\frac{d^\sigma}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}}
+$${D^\sigma_{\!x|a} f(x) =
+\LRc{}{\frac{d^\sigma}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}}$$
+\end{example}
+
+\begin{example}
+\cursorformula{D^\sigma_{\!x|a}
+\Rc{f(x) = }{} \frac{d^\sigma}{dx^\sigma}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}}
+$${D^\sigma_{\!x|a}
+\Rc{f(x) =}{}\frac{d^\sigma}{dx^\sigma}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}}$$
+\end{example}
+
+
+\begin{example}
+\cursorformula{ D^\sigma_{\!x|a}
+f(x)=\frac{d^\sigma}{\Rc{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}
+}
+$${ D^\sigma_{\!x|a}
+f(x)=\frac{d^\sigma}{\Rc{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}
+}$$
+\end{example}
+
+\begin{example}
+$${ D^\sigma_{\!x|a}
+f(x)=\frac{d^\sigma}{\LRc{}{dx^\sigma}}
+f(x) = \int_a^x f(x) (dx)^{-\sigma}
+} $$
+\end{example}
+
+
+
+\end{document}
+
+
+
+
+
+
+
+
+
diff --git a/macros/latex/contrib/cursor/read.me b/macros/latex/contrib/cursor/read.me
new file mode 100644
index 0000000000..6df06993e5
--- /dev/null
+++ b/macros/latex/contrib/cursor/read.me
@@ -0,0 +1,9 @@
+This archive contains cursor.sty. A style file to create a simple
+L-shaped 'cursor' in a math environment to mimic what one might
+see on a computer screen. Instructions for use are in the style
+file. Examples of usage are in cursor.tex, also included in dvi-
+and ps-format.
+
+Written by Werenfried Spit (W.Spit@witbo.nl) on request of
+Dik Kettenis (Dik.Kettenis@users.info.wau.nl). Please direct
+questions to the author.