LaTeX: Difference between revisions

From LPTMS Wiki
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Easy compilation ==
* there is a [http://latex-mk.sourceforge.net ''latexmk''] package that can be installed on most Linux environments.
Example (performing bibtex and ps2pdf commands):
latexmk -bibtex -pdfps source(.tex)
* Makefile for latex
* stupid by simplest bash script
==Tips for LaTeX==
==Tips for LaTeX==


* do not forget the use of {} to remove unwanted blanks in equations. For instance, there is a difference between <math>\vert{\uparrow\downarrow}\rangle</math> and <math>\vert\uparrow\downarrow\rangle</math>.
* do not forget the use of {} to remove unwanted blanks in equations. For instance, there is a difference between <math>\vert{\uparrow\downarrow}\rangle</math> and <math>\vert\uparrow\downarrow\rangle</math>.
  \vert'''{'''\uparrow\downarrow'''}'''\rangle and not \vert\uparrow\downarrow\rangle
  \vert'''{'''\uparrow\downarrow'''}'''\rangle and not \vert\uparrow\downarrow\rangle
* one can give the path for the directory containing the figures using
<source lang="tex">
\graphicspath{{../Figures/},{../plots/}}
</source>
* a [http://www.ctan.org/pkg/latexdiff ''latexdiff''] command exists with most latex distributions.
latexdiff-so -h
for help and options.
Usage:
latexdiff-so [options] old.tex new.tex > diff.tex
A related command is latexrevise which reads an output of latexdiff and removes its markup.
latexrevise [options] diff.tex > revised.tex
== Some packages ==
==== Ornaments and lettrine ====
* [http://altermundus.com/pages/tkz/ornament/index.html PGF Ornaments]
* [http://www.ctan.org/pkg/fourier Fourier Orn]
* [http://www.ctan.org/pkg/adforn Adf Orn]
* [http://www.ctan.org/pkg/pst-vectorian Ps-Victorian]
* [http://www.ctan.org/pkg/context-lettrine Context-Lettrine]


* one can give the path for the directory containing the figures using
\graphicspath{{../Figures/},{../plots/}}


== Bibliography ==
== Bibliography ==
=== Bibtex tools ===
* [http://wiki.lyx.org/BibTeX/Programs tools for Bibtex]
=== A sorting strategy ===


The best strategy with ''revtex'' is to use a ''references.bib'' file containing all references (see [[managing bibliography]]) and to include them using the ''apsrev4-1'' bibliography style that will format correctly the bibitems:
The best strategy with ''revtex'' is to use a ''references.bib'' file containing all references (see [[managing bibliography]]) and to include them using the ''apsrev4-1'' bibliography style that will format correctly the bibitems:
<source lang="tex">
<source lang="tex">
\bibliographystyle{apsrev4-1}
\bibliographystyle{apsrev4-1}
\bibliography{references}
\bibliography{references}
</source>
</source>
Then, the compilation creates a .bbl file with the correctly ordered references. If you want to merge some bibitems, you can include by hand the .bbl file at the place of the bibliography and reshape your bibitems (and corresponding \cite{}) at will.
Then, the compilation creates a .bbl file with the correctly ordered references. If you want to merge some bibitems, you can include by hand the .bbl file at the place of the bibliography and reshape your bibitems (and corresponding \cite{}) at will.


However, you may find that the output in the bbl file is unreadable. Here are some .bst files, alternative to apsrev4-1.bst, which produces plain vanilla bibitem in the Phys. Rev.  
However, you may find that the output in the bbl file is unreadable. [http://www.guillaume.roux.free.fr/BstFiles Here] are some .bst files, alternative to apsrev4-1.bst, which produces plain vanilla bibitem in the Phys. Rev. style.
 
<source lang="tex">
<source lang="tex">
\bibitem{Dagotto1994}
\bibitem{Dagotto1994}
E.~Dagotto, Rev. Mod. Phys. {\bf 66}, 763 (1994).
E.~Dagotto, Rev. Mod. Phys. {\bf 66}, 763 (1994).
</source>
</source>
* [http://www.guillaume.roux.free.fr/BstFiles/modern.bst modern.bst] : displays authors up to a maximum of 5
* [http://www.guillaume.roux.free.fr/BstFiles/modernref.bst modernref.bst] : same and creates a weblink with href if an ''url'' token is given
* [http://www.guillaume.roux.free.fr/BstFiles/longmodern.bst longmodern.bst] : same as modern.bst without the author limit
* [http://www.guillaume.roux.free.fr/BstFiles/e-modern.bst e-modern.bst] : same as modern.bst and adds the arXiv number provided an ''eprint'' token is present
* [http://www.guillaume.roux.free.fr/BstFiles/e-longmodern.bst e-longmodern.bst] : same as e-modern.bst  without the author constraint

Latest revision as of 09:24, 8 July 2013

Easy compilation

  • there is a latexmk package that can be installed on most Linux environments.

Example (performing bibtex and ps2pdf commands):

latexmk -bibtex -pdfps source(.tex)
  • Makefile for latex
  • stupid by simplest bash script


Tips for LaTeX

  • do not forget the use of {} to remove unwanted blanks in equations. For instance, there is a difference between <math>\vert{\uparrow\downarrow}\rangle</math> and <math>\vert\uparrow\downarrow\rangle</math>.
\vert{\uparrow\downarrow}\rangle and not \vert\uparrow\downarrow\rangle
  • one can give the path for the directory containing the figures using

<source lang="tex"> \graphicspath{{../Figures/},{../plots/}} </source>

  • a latexdiff command exists with most latex distributions.
latexdiff-so -h 

for help and options.

Usage:

latexdiff-so [options] old.tex new.tex > diff.tex

A related command is latexrevise which reads an output of latexdiff and removes its markup.

latexrevise [options] diff.tex > revised.tex

Some packages

Ornaments and lettrine


Bibliography

Bibtex tools

A sorting strategy

The best strategy with revtex is to use a references.bib file containing all references (see managing bibliography) and to include them using the apsrev4-1 bibliography style that will format correctly the bibitems: <source lang="tex"> \bibliographystyle{apsrev4-1} \bibliography{references} </source> Then, the compilation creates a .bbl file with the correctly ordered references. If you want to merge some bibitems, you can include by hand the .bbl file at the place of the bibliography and reshape your bibitems (and corresponding \cite{}) at will.

However, you may find that the output in the bbl file is unreadable. Here are some .bst files, alternative to apsrev4-1.bst, which produces plain vanilla bibitem in the Phys. Rev. style. <source lang="tex"> \bibitem{Dagotto1994} E.~Dagotto, Rev. Mod. Phys. {\bf 66}, 763 (1994). </source>

  • modern.bst : displays authors up to a maximum of 5
  • modernref.bst : same and creates a weblink with href if an url token is given
  • longmodern.bst : same as modern.bst without the author limit
  • e-modern.bst : same as modern.bst and adds the arXiv number provided an eprint token is present
  • e-longmodern.bst : same as e-modern.bst without the author constraint