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

\ProvidesPackage{tsemlines}[2011/06/23 v1.0 line support for emTeX's TeXcad]


\def\newpic#1{%
   \def\emline##1##2##3##4##5##6{%
     \put(0,0){\tikz[remember picture,x=\unitlength,y=\unitlength,
       line width=\@wholewidth]{\draw(##1,##2)
         coordinate (em point #1 ##3) -- (##4,##5) coordinate
         (em point #1 ##6);
         \useasboundingbox (0,0) -- (em point #1
         ##3) -- (em point #1 ##6);}%
     }}}

\newpic{}