blob: 085323e146d571c2fefd6a958110d475ce6dc419 (
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
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
|
%%
%% This is file `tikzmarklibrarylistings.code.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tikzmark.dtx (with options: `listings')
%% ----------------------------------------------------------------
%% tikzmark --- remembering absolute positioning with TikZ.
%% E-mail: loopspace@mathforge.org
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
\@ifpackageloaded{listings}{%
\newif\iflst@linemark
\lst@AddToHook{EveryLine}{%
\begingroup
\advance\c@lstnumber by 1\relax
\pgfmark{line-\lst@name-\the\c@lstnumber-start}%
\endgroup
}
\lst@AddToHook{EOL}{\pgfmark{line-\lst@name-\the\c@lstnumber-end}%
\global\lst@linemarktrue
}
\lst@AddToHook{OutputBox}{%
\iflst@linemark
\pgfmark{line-\lst@name-\the\c@lstnumber-first}%
\global\lst@linemarkfalse
\fi
}
\def\tkzmk@lst@fnum#1\relax#2\@STOP{%
\def\@test{#2}%
\ifx\@test\@empty
\def\tkzmk@lst@start{0}%
\else
\@tempcnta=#1\relax
\advance\@tempcnta by -1\relax
\def\tkzmk@lst@start{\the\@tempcnta}%
\fi
}
\lst@AddToHook{Init}{%
\expandafter\tkzmk@lst@fnum\lst@firstnumber\relax\@STOP
\pgfmark{line-\lst@name-\tkzmk@lst@start-start}%
}
}{%
\PackageError{tikzmark listings}{The listings package has not been loaded.}{}
}
%%
%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace@mathforge.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Andrew Stacey.
%%
%% This work consists of the file tikzmark.dtx
%% and the derived files tikzmark.ins,
%% tikzmark.pdf,
%% tikzlibrarytikzmark.code.tex, and
%% tikzmarklibrarylistings.code.tex
%%
%%
%% End of file `tikzmarklibrarylistings.code.tex'.
|