-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparano.sty
executable file
·113 lines (104 loc) · 3.32 KB
/
parano.sty
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
%%
%% The original source files were:
%% parano.dtx (with options: `package')
%%
%% File: parano.dtx Copyright (c) 2003, CV Radhakrishnan
%% River Valley Technologies, Trivandrum, India
%% <cvr@river-valley.org>
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% either version 1.0 or, at your option, any later version.
%%
%% $Id: parano.sty,v 1.3 2003/06/14 19:20:42 cvr Exp cvr $
%%
%%
%% Usage of the commands provided:
%%
%% \parano ==> starts para numbering
%% \parano[<number>] ==> starts the next para with number <number>
%% \endparano ==> stops para numbering
%% \prepara ==> redefine to add material that needs to appear
%% before the para number. default is null
%% \postpara ==> redefine to append material to para number.
%% default is null
%% \paranoboxwidth ==> width of paranumber box, default 2em
%%
%%
\NeedsTeXFormat{LaTeX2e}
\def\Fileversion$#1: #2 ${\gdef\fileversion{#2}}
\def\Filedate$#1: #2 #3 ${\gdef\filedate{#2}}
\Fileversion$Revision: 1.3 $
\Filedate$Date: 2003/06/14 19:20:42 $
\ProvidesPackage{parano}
[\filedate\space\fileversion\space Paranumber support (CVR)]
\PackageWarningNoLine{parano}
{****************************************\MessageBreak
Package parano v,\fileversion\space loaded\MessageBreak
****************************************}
\newcounter{parano}
%\@addtoreset{parano}{section}
\def\prepara{}
\def\postpara{}
\newdimen\paranoboxwidth
\paranoboxwidth=2em
\newdimen\parwidth
\renewcommand\theparano{\thesection.\arabic{parano}}
\newif\ifparano\paranofalse
\def\parano{\global\paranotrue\@ifnextchar[{\@@parano}{\@parano}}
\AtBeginDocument{\parwidth\parindent}
\long\def\@parano{%%
%\typeout{PARINDENT = \the\parindent----PARWIDTH = \the\parwidth}
\everypar{\parindent0pt\stepcounter{parano}%
\hbox to \paranoboxwidth{\prepara\theparano\hfill}\postpara}}
\long\def\@@parano[#1]{%
\setcounter{parano}{#1}%
\addtocounter{parano}{-1}%
\everypar{\parindent0pt%
\stepcounter{parano}%
\hbox to \paranoboxwidth{\prepara\theparano\hfill}\postpara}}
\def\endparano{\everypar{\parindent\parwidth}
\global\paranofalse%
\parindent\parwidth%
%\typeout{PARINDENT = \the\parindent::::PARWIDTH = \the\parwidth}
}
\def\@xsect#1{%
\@tempskipa #1\relax
\ifdim \@tempskipa>\z@
\par \nobreak
\vskip \@tempskipa
\@afterheading
\else
\@nobreakfalse
\global\@noskipsectrue
\everypar{%
\if@noskipsec
\global\@noskipsecfalse
{\setbox\z@\lastbox}%
\clubpenalty\@M
\begingroup \@svsechd \endgroup
\unskip
\@tempskipa #1\relax
\hskip -\@tempskipa
\else
\clubpenalty \@clubpenalty
\everypar{}%
\fi}%
\fi
\ifparano\@parano\fi\ignorespaces}
\def\@startsection#1#2#3#4#5#6{\everypar{}%
\if@noskipsec \leavevmode \fi
\par
\@tempskipa #4\relax
\@afterindenttrue
\ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse
\fi
\everypar{}%
\addpenalty\@secpenalty\addvspace{\@tempskipa}
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
%%
%% End of file 'parano.sty'
%%