Tutorial: reviews in Latex

Before the tutorial

Setting up Latex before the tutorial

  • Make sure to have install on your laptop a recent version of Latex.
  • download from here a test version of a review intro.tar
  • extract the files in the archive (if using a command line prompt, use tar -xvf intro.tar).
  • cd intro
  • compile it with the following commands:
    • pdflatex intro
    • bibtex intro
    • pdflatex intro
    • pdflatex intro
  • or alternative, if you have make installed, type the following command:
    • make

  • if neither of the set of commands work, check if you have available the following LaTeX packages required for PDG reviews in LaTeX (check error messages in the log file):
    • xifthen
    • color
    • float
    • amsmath
    • graphicx
    • xspace
    • titling
    • fancyhdr
    • titlesec
    • geometry
    • import
    • lineno
    • showlabels
    • bibunit

  • if you have these packages installed, and updated, and still it does not compile, write an email to support@pdg.lbl.gov

At the tutorial

  • We will use a dedicated database for the review: TutorialPdgWorkspace.
  • Once you open this webpage, you should see database: tutorial on the top left of the page, right under the PDGworkspace logo
  • More details about the workflow fore reviews and tip on naming conventions can be found here: https://pdgdoc.lbl.gov/Pdg/ReviewTool

Check out and compile LaTex Tutorial review

  • Open PDGworkspace TutorialPdgWorkspace.
  • Select Reviews from the top row, and then select my reviews from the drop-down menu under Review Filters
  • In your list of reviews, you should see one titled "LaTeX Tutorial". Click on the title, and it will take you to the overview tab for this review.
  • Under the sources file tab, you can see the instructions on how to check out your review. If you can, please run the svn command in a command line prompt. Otherwise, download the tar file from the pdgworskpace interface and extract the archive.
  • cd latex_tutorial (or click on the extracted directory)
  • you need to compile the latex code. Type the following lines in a command line prompt:
    • pdflatex latex_tutorial
    • bibtex latex_tutorial
    • pdflatex latex_tutorial
    • pdflatex latex_tutorial
  • or
    • make
  • Now you should have a pdf file available titled pdf_latex.pdf. Open and inspect it.

Edit the test LaTex Tutorial review

  • Now let's edit the main body of the review.
  • Open with your favorite text editor the file latex_tutorial-main.tex
  • After the command with the revision date (\revised{August 2018}), you can add some text.

Add a section

  • Use the standard latex syntax:
    \section{Title of the section}\label{basename:sec:_meaningful name_}

Add a figure

  • To add a figure, make sure to add a figure into the subdirectory figures (there is already a file in the subdirectory for your convenience)
  • the command to add a figure in your review is the following:
    \pdgfigure{ the name of the file, found in the figures directory }{ your caption }{ label }{option to determine the position }{other options}
  • For example:
    • \pdgfigure{intro96.pdf}{A typical ideogram}{latex-tutorial:fig:ideogram}{}{}
    • \pdgfigure{intro96.pdf}{A typical ideogram}{latex-tutorial:fig:ideogram}{}{width=0.4\textwidth}
    • \pdgfigure{intro96.pdf}{A typical ideogram}{latex-tutorial:fig:ideogram}{h!}{width=0.4\textwidth}
  • If you want to add a reference to the figure in the text, you can use the following command:
  • For example: see Fig. \ref{latex-tutorial:fig:ideogram}
  • good practice for the label is to use: basename:fig:_some meaningful name_

Add a table

  • To add a table, we use the following environment :
    \pdgtable{ dimension of the table }{ your caption }{ label }{options}
  • for example, to add a table with three columns, with the text centered:
       {|c|c|c|} {This is an example table}{latex-tutorial:tab:mytable}{}
        My Table & 1.5 & $ 1.3\%$\\
  • If you want to add a reference to the table in the text, you can use the following command:
    see Table \ref{latex-tutorial:tab:mytable}

Add a reference

  • References are handled using BibTeX. To add a reference to your review:
    • Look up the reference in INSPIRE and download its BibTeX entry (see bottom of the "Information" tab for the article, under "Export").
    • Add the BibTeX entry to your review's .bib file. Note the article tag assigned by INSPIRE - you can see it in the first line of the BibTeX entry, after "@article{".
    • Cite the reference with "\cite", using the article tag assigned by INSPIRE.
  • For example, add the following reference: https://inspirehep.net/record/1691634 in latex_tutorial.bib, and then add a reference in latex_tutorial-main.tex, using the command:

Start migrating one of your own review from teXsis to Latex -- Advanced, optional part

Download one of your reviews in teXsis

  • open the tutorial pdg workspace using this link: TutorialPdgWorkspace
  • under Review Filters, choose "my reviews" from the drop-down menu
  • click on the name of your reviews that you want to migrate from texSis to Latex
  • under the source file tab, you can find the command to check out the teXsis version of your review
  • make sure that you have these files saved somewhere safe, you will need them later

Download the empty Latex version for the same review

  • ask Kirill in person, or send an email to support AT pdg.lbl.gov, to change your review in the tutorial database from teXsis to Latex
  • open again the tutorial pdg workspace using this link: TutorialPdgWorkspace
  • Under Review Filters, choose "my reviews" from the drop-down menu
  • Click again on the same review, and check that now the database point to the Latex version. To do that, once you click on the name of one of your review, you can check under the Technical Details tab if the format field correspond to LaTeX. If not, ask for help.
  • go back in the Overview tab
  • click on draft link under Generate latest version (PDF), the current version of the review will appear. It should contain only the title and the authors.
  • download the Latex version of your review, following the instructions under the source file tab. Make sure to check out this code in a different folder wrt of the code in teXsis

Start updating the review in Latex

  • open the Tutorial pdgworkspace TutorialPdgWorkspace, navigate to the review you're about to modify, and then update its status under the Overview tab.
    • click on update
    • click on start editing draft
  • Now you can start copying the text from your review in teXsis to the main body of the review in Latex.
    • Suggestions:
      • copy a small amount of text at the time, and then test if it compiles
      • if there are equations, you'd have to change to syntax. Equation in latex are added using the equation environment. A working example is:
                   N_{exp} = \sigma_{exp} \times \int L(t) dt.
  • Once you've migrate the all review (or part of it for testing), you can check the updated source code into svn. Make sure you run the following command from the directory where the Latex version of the review was downloaded.
    • svn status : it will list the files that you modified
    • svn commit -m "Brief summary of your changes" : it will copy the changes in the svn repository
  • Now you can go into the tutorial pdg workspace TutorialPdgWorkspace, select your review, and then under the Overview tab click on draft link under Generate latest version (PDF): you should see the updated version of the review. * If you're happy of your change and they are final, update the status of the review under the Overview tab.
    • click on update
    • click on pass to editor

-- No permission to view TWiki.UserReports

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivetar intro.tar r2 r1 manage 170.0 K 2018-10-25 - 14:55 ElisabettaPianori  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2018-10-25 - ElisabettaPianori
This site is powered by the TWiki collaboration platform Powered by PerlCopyright Information: This page and all following are copyrighted by the Regents of the University of California