-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraftinputlines-man.tex
138 lines (114 loc) · 4.31 KB
/
draftinputlines-man.tex
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
\documentclass{scrartcl}
\usepackage[
headfootpackage=scrpage,
hijackboth=true,
dilinputfiles=true,
inputfilesrule=false,
]{draftinputlines}
\usepackage{listings}
\lstloadlanguages{[LaTeX]TeX}
\lstset{%
basicstyle=\ttfamily,
commentstyle=\itshape\ttfamily\small,
showspaces=false,
showstringspaces=false,
breaklines=true,
breakautoindent=true,
captionpos=t,
frame=single,
escapeinside={(*}{*)},
}
\lstMakeShortInline{|}
\usepackage{enumitem}
\setdescription{font=\ttfamily,leftmargin=4em}
\begin{document}
%\def\dilfont{\sffamily}
\section{Introduction}
This package adds the input lines of various parts of your LaTeX
document as marginpars.
It can also add the first and last input lines read to the header and
footer respectively.
The marginpars float, and I can't guarantee they'll be entirely
accurate if lots are bunched together.
Also, the begin and end page numbers might not be totally accurate.
But they're still useful (I hope).
The numbers that float with tables and the like do not float, so they
will overlap other numbers in some circumstances.
This should be rare since floats should have their own space.
\section{Examples}
\input{inputfile}
\section{Options}
Here are the options that are currently defined and a description of
what they do.
\paragraph{\lstinline+headfootpackage+}
This sets what package is used to do the headers and footers.
Set it to whatever is setting the headers and footers in your
document.
The options are:
\begin{description}[labelindent=1cm]
\item[scrpage] Uses KOMA script's |scrpage2|
\item[fancyhdr] Uses |fancyhdr|
% These options don't currently work.
% Genuinely not sure I can be bothered writing them.
% \item[memoir] Uses |memoir|.
% Coming soon.
% \item[plain] Use the plain TeX macros.
% Coming soon.
\end{description}
\paragraph{\lstinline+inputlineshead,inputlinesfoot,filenamehead,filenamefoot+}
These options print the line number and file name at the start of the
page at the top and the end of the page at the bottom.
The options available are the same for both, though they can be set separately.
They are:
\begin{description}[labelindent=1cm]
\item[inside] Print number on the inside (same as |left| for onesided
documents)
\item[outside] Print number on the outside (same as |right| for
onesided documents)
\item[center] Print number on in the center
\item[left] Print number on the left
\item[right] Print number on the right
\item[off] Don't print the numbers
\end{description}
They aren't necessarily 100\% accurate given the asynchronous way that
the page builder works, but they are probably good enough for most purposes.
\paragraph{\lstinline+dilfont+}
All the input line numbers and file names are formatted with |\dilfont|.
The default is |\ttfamily\small|.
It can be redefined as normal:
|\def\dilfont{\small\sffamily}| for example would make the numbers
appear sans serif.
\paragraph{\lstinline+environmentline+}
This option takes a list of environment names.
Those environments listed will then print the line number where they
start.
This is only necessary in |safemode| (see below).
\paragraph{Switches}
The following is a list of Boolean (true/false) options and what they
control.
\begin{description}
\item[dilinputfiles] Prints the name and input line number of files
included with |\input| and |\include|.
\item[dilinputfilesrule] Prints rules above the start and below the
end of an included file, so it's obvious where in the page it starts
and ends.
If |dilinputfiles| is false, this doesn't do anything.
\item[graphicsfilename] Prints the name of files added with
|\includegraphics| in the opposite margin to the page numbers.
Load |graphicx| \emph{before} |draftinputlines| for this to work.
\item[hijackheaders,hijackfooters,hijackboth] These are just a quick
way to set the headers and footers to output input line information.
\item[safemode] The way this package works is to hook into the
paragraph mechanism with the |everyhook| package.
This isn't always a good idea since paragraphs are used for all
sorts of random stuff.
So if the package breaks, try safe mode.
Fewer line numbers, but it should be more robust.
\item[sectionline] Determines whether each section will print the line
it is printed on.
\end{description}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: