Skip to content

Instantly share code, notes, and snippets.

@jonaprieto
Created April 2, 2023 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonaprieto/6f282e7279e24dd5fd9641b64b28b3e0 to your computer and use it in GitHub Desktop.
Save jonaprieto/6f282e7279e24dd5fd9641b64b28b3e0 to your computer and use it in GitHub Desktop.
Numbering paragraph
% -------------------------------------------------------------------
% Paragraph numbering
% -------------------------------------------------------------------
\usepackage{parano}% http://www.sci.usq.edu.au/staff/braithwa/parano.sty
%\usepackage{hyperref}
%Fixes to parano.sty. One must uses the command \parano.
\makeatletter
\newcommand{\paranospace}{\hfill}% Introduced for more flexible customisation
\renewcommand{\@parano}{%
\everypar{\setbox0\lastbox% Fixes first paragraph indent problem
\refstepcounter{parano}%
\hbox to \paranoboxwidth{\prepara{\footnotesize\color{darkgray}(\theparano)}\paranospace}\postpara}}
\def\@@parano[#1]{\setcounter{parano}{#1}\addtocounter{parano}{-1}%
\@parano}% To avoid code duplication
\makeatother
%Customizations for this example
\renewcommand{\prepara}{\hss}
\renewcommand{\postpara}{\hspace{\parindent}\ignorespaces}
\renewcommand{\paranospace}{\quad\hfill}
\setlength{\paranoboxwidth}{0pt}
\let\par\relax
\endlinechar=-32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment