Pages

vendredi 5 octobre 2012

numbering paragraphs automatically in LaTeX

In order to add paragraph numbers automatically in a LaTeX file, this is what I did.

In my Mac machine:
1) download parano.py from http://sarovar.org/frs/?group_id=35&release_id=40
2) put it in my Mac : /usr/local/texlive/2012/texmf-dist/tex/latex/base
3) sudo texhash

In my Linux machine, then the path /usr/local/texlive/2012/texmf-dist/tex/latex/base is not right, and the latex parano.sty not found !

I then tried in the linux machine:
kpsewhich -var-value TEXMFHOME

it prints the path ~/texmf.

For Linux system, either we can put the new sty files in ~/texmf/, or /usr/share/texmf. Because, when texlive searches for files, it first looks into ~/texmf, and then into /usr/local/share/texmf, and then into /usr/share/texmf. In fact it is better to put into ~/texmf than the /usr/share/texmf. The structure of ~/texmf can be organised the same as /usr/share/texmf. In this case, I created ~/texmf/tex/latex and then copied parano.sty into there.


Then I tried in Linux system:
kpsewhich parano.sty

it gives the full path where the parano.sty is put, ie., ~/texmf/tex/latex/parano.sty

--------------------------------------------------------------------------------------------------------
After the new .sty file is properly put in the systems (either Mac or Linux), now I modified my LaTeX document in order to use the parano.sty.

In the tex document, I add two lines in the beginning of file:

\usepackage{parano}
\renewcommand\theparano{\textbf{[\arabic{parano}]}}

then at the first section of document, I also put:
\section{Introduction}
\parano{}
\noindent{}

Afterwards I compile the LaTeX file, the paragraph numbers are added automatically !


Aucun commentaire:

Enregistrer un commentaire