LaTeX: Difference between revisions

From LPTMS Wiki
Jump to navigation Jump to search
mNo edit summary
Line 3: Line 3:
* 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
* one can give the path for the directory containing the figures using
\graphicspath{{../Figures/},{../plots/}}
<source lang="tex">
\graphicspath{{../Figures/},{../plots/}}
</source>


== Bibliography ==
== Bibliography ==
Line 11: Line 12:
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. 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>

Revision as of 15:35, 20 October 2011

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>

Bibliography

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>