-
Notifications
You must be signed in to change notification settings - Fork 165
/
fixlinenumbers.tex
executable file
·25 lines (25 loc) · 1.27 KB
/
fixlinenumbers.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
%% For the linenumbets to work-------------------------------------%
\usepackage[pagewise, left, mathlines]{lineno}
\usepackage[running, left, mathlines]{lineno} % for continuous numbering
% Change the font
%\renewcommand\linenumberfont{\normalfont\tiny\sffamily \color{gray!60} }
% This is from
%http://phaseportrait.blogspot.co.uk/2007/08/lineno-and-amsmath-compatibility.html
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}
%-----------------------------------------------------------------------%