-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintervalarrows.dtx
155 lines (153 loc) · 4.6 KB
/
intervalarrows.dtx
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
% \def\EmailAddress{[email protected]}
% \iffalse meta-comment
%
% Program intervalarrows
% Copyright (C) 2007 Jan Hlavacek
%
% The code of this program is a simple modification of code posted
% by Jake at http://tex.stackexchange.com/questions/11871/
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% The Program's files are intervalarrows.dtx, intervalarrows.ins and intervalarrows.sty.
%
% Run latex with the input file intervalarrows.ins to generate the
% intervalarrows.sty
% package file. Run latex with the input file intervalarrows.dtx to generate the
% package documentation.
%
% \fi
%
% \CheckSum{38}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \iffalse
%<*driver>
\ProvidesFile{intervalarrows.dtx}
%</driver>
%<package,ls>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{intervalarrows}
%<*package>
[2015/07/14 v0.1 Defines two tikz arrow tips for drawing intervals]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage{tikz}
\usepackage{intervalarrows}[2015/07/14]
\usepackage{hyperref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{intervalarrows.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{intervalarrows.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
% \changes{0.1}{2015/07/14}{Initial version}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \title{\bf The \textsf{intervalarrows} Package\thanks{This document
% describes the version number \fileversion, last
% revised \filedate.}}
%
% \author{Jan Hlavacek\\
% \small Email: \texttt{\EmailAddress}}
% \date{14 July 2015}
% \maketitle
%
% \begin{abstract}
% This package defines two new arrow tips, open for an ``open'' circle and
% closed for a ``closed'' circle. Unlike the original versions, '\*' and 'o',
% these are centered at the end of the line.
%
% The code is taken from the post \url{http://tex.stackexchange.com/questions/11871} by Jake.
% \end{abstract}
% \thispagestyle{empty}
% \tableofcontents
% \section{Example}
%
% \begin{verbatim}
% \begin{center}
% \begin{tikzpicture}
% \draw[very thin,<->] (-3,0) -- (4,0);
% \foreach \x in {-2,...,3}{
% \draw[xshift=\x cm,very thin] (0,2pt) -- (0,-2pt)node[below]{$\x$};}
% \draw[very thick,open-closed] (-1,0) -- (2,0);
% \end{tikzpicture}
% \end{center}
% \end{verbatim}
% produces
% \begin{center}
% \begin{tikzpicture}
% \draw[very thin,<->] (-3,0) -- (4,0);
% \foreach \x in {-2,...,3}{
% \draw[xshift=\x cm,very thin] (0,2pt) -- (0,-2pt)node[below]{$\x$};}
% \draw[very thick,open-closed] (-1,0) -- (2,0);
% \end{tikzpicture}
% \end{center}
%
% \StopEventually{}
%
% \section{Implementation}
% \begin{macrocode}
\pgfarrowsdeclare{closed}{closed}
{
\pgfarrowsleftextend{+-.5\pgflinewidth}
\pgfutil@tempdima=0.4pt%
\advance\pgfutil@tempdima by.2\pgflinewidth%
\pgfarrowsrightextend{4.5\pgfutil@tempdima}
}
{
\pgfutil@tempdima=0.4pt%
\advance\pgfutil@tempdima by.2\pgflinewidth%
\pgfsetdash{}{+0pt}
\pgfpathcircle{\pgfqpoint{4.5\pgfutil@tempdima}{0bp}}{4.5\pgfutil@tempdima}
\pgfusepathqfillstroke
}
\pgfarrowsdeclare{open}{open}
{
\pgfarrowsleftextend{+-.5\pgflinewidth}
\pgfutil@tempdima=0.4pt%
\advance\pgfutil@tempdima by.2\pgflinewidth%
\pgfarrowsrightextend{4.5\pgfutil@tempdima}
}
{
\pgfutil@tempdima=0.4pt%
\advance\pgfutil@tempdima by.2\pgflinewidth%
\pgfsetdash{}{+0pt}
\pgfpathcircle{\pgfqpoint{4.5\pgfutil@tempdima}{0bp}}{4.5\pgfutil@tempdima}
\pgfusepathqstroke
}
% \end{macrocode}
%
% \Finale
\endinput