Debian Codegraph @

texmf-dist/tex/latex/tsemlines/tsemlines.sty

raw
1 % tsemlines.sty 2011, Tobias Schlemmer
2 % License: Public domain.
3 %
4 % Macros for drawing lines with arbitrary slopes. This package is
5 % intended to assist the usage of old pictures with TeX systems and
6 % DVI drivers that don't support the em specials.
7 %
8 % Emulation of emlines.sty by Georg Horn / Eberhard Mattes.
9 %
10 % No further EmTeX specials will be used. \emline will use \unitlength
11 % and \linethickness from the standard picture environment instaed.
12 %
13 % Usage:
14 % \usepackage{tikz,tsemlines}
15 % ...
16 % \begin{picture}%
17 % \emline{1.1}{2.5}{4}{-3.4}{6.6}{5}%
18 % \end{picture}
19 %
20 % As a special benefit the first coodinate will be availlable via
21 % (em point picturelabel #3) and the last one via
22 % (em point picturelabel #6). picturelabel can be changed with
23 % \newpic{newpicturelabel}. After the package has been loaded it
24 % defaults to the empty string.
25
26 \ProvidesPackage{tsemlines}[2011/06/23 v1.0 line support for emTeX's TeXcad]
27
28
29 \def\newpic#1{%
30 \def\emline##1##2##3##4##5##6{%
31 \put(0,0){\tikz[remember picture,x=\unitlength,y=\unitlength,
32 line width=\@wholewidth]{\draw(##1,##2)
33 coordinate (em point #1 ##3) -- (##4,##5) coordinate
34 (em point #1 ##6);
35 \useasboundingbox (0,0) -- (em point #1
36 ##3) -- (em point #1 ##6);}%
37 }}}
38
39 \newpic{}