scientific writing with latex - lib4ri · tex philosophy i enter one-dimensional instructions (the...

31
Scientific Writing with LaTeX

Upload: others

Post on 12-Sep-2019

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Scientific Writing with LaTeX

Page 2: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

One Possible Workflow in Scientific Writing

Page 3: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Document Preparation: LaTeX

From www.lamport.org

typesetting was conceived and developed by Donald A. Knuth between 1977 and 1986 in

collaboration with his students and with advice from typesetters and calligraphers.

TeX is a typesetting system for technical texts.

is a collection of TeX macros

written by L. Lamport

Page 4: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

It’s All About Typography

From ETH-Bib’s e-collection, a disseration in Word from 2012

Page 5: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

TeX Philosophy I

Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the eventually two-dimensional page layout. The logical structure of document-, page-, paragraph-, word-, and finally letter- design proceeds via boxes: The same way a classical typesetter would work:

TeX solves many optimization problems of penalty-functions which are formulated for all kinds of typographical rules. The result of the optimization process should finally lead to a «aesthetically pleasing typeset document» (Knuth)

Page 6: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

TeX Philosophy II

TeX acts as a high-level programming language The type-setting instructions are interspersed within the actual text which is to be typeset. The parser of the .tex files identifies the commands by their specific structure

\commandname{arg1}{arg2}{arg3}

Page 7: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

TeX’s Strength

From its initial goal and history LaTeX provides an aesthetic mathematical formula typesetting in the context of technical texts (and it still is a leading player in this ‘market’):

Many extensions were added over the years from other fields of science: Physics (Feynman graphs), chemistry (chemical structures), ...

From G. Grätzer: Math into LaTeX

Page 8: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

TeX Installation

First, install the TeX system (i.e. compiler, libraries, packages,

and typographic infrastructure)

Microsoft : MikTeX, proTeXt Linux : TeXLive Apple : MacTeX iPad : TeXWriter / Texpad

Examples of TeX-systems for different operating systems

Page 9: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Type Up a TeX File

\documentclass{article} Preamble part: Specify the necessary packages \begin{document} \titel{Ein Artikel} \author{H. Harzenmoser} \maketitle \section{Einleitung} Text ... \cite{HarziPigs04} \section{Methoden} Text ... \subsection{Habe gemessen} Text ... \subsubsection{ ... und \emph{gemessen}} Text ... \section{Resultate} Text ... \bibliographystyle{plain} \bibliography{MeineLiteratur} \end{document}

Ein Artikel H. Harzenmoser

1. Einleitung Text . . . 2. Methoden Text . . . Harzenmoser (2004) 2.1. Habe gemessen Text . . . 2.1.1. . . . und gemessen Text . . . 3. Resultate Text . . . Referenzen …. Harzenmoser, E. 2004, Pigs and Porcu Hugentobler, H. 1962, Braunvieh Inter

Input file: Artikel.tex Result

Page 10: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

La/TeX IDEs

For Microsoft systems:

TeXnicCenter

WinShell

WinEdt

and the WYSIWYG-ly

LyX

Page 11: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

LaTeX IDEs

on Linux distributions

Kile

and again the WYSIWYG -like LyX

Page 12: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

LaTeX IDEs

Texmaker

runs under Windows/OS X/Linux

Page 13: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

pdfLaTeX

N.B. Since TeXLive 2010 pdfLaTeX accepts not only .eps figures but most bitmap/vector graphics formats: .pdf, .jpg, .png, .tiff, …

pdfLaTeX the modern alternative to classic LaTeX:

Source: agodemar on Tex.stackexchange.com 18. Jan. 2012

Page 14: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

The LaTeX – Bib(La)Tex Connection

How to typeset references

in LaTeX documents

Page 15: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Bibtex vs. Biblatex

\usepackage{natbib} \bibliographystyle{<uvw>} % .bst file \begin{document} Let's cite! Einstein's journal paper \citep{einstein} and the book of \citet{dirac} are physics related items. \bibliography{<MyLib>} % .bib file \end{document}

\usepackage[]{biblatex} \bibliography{MyLib} % .bib file \begin{document} Let's cite! The Einstein's journal paper \citep{einstein} and the Dirac's book \citet{dirac} are physics related items. \printbibliography \end{document}

Page 16: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

The Inner Workings of the BibTeX Application

BibTex application .aux files list the bibliographic requirements (from the \cite-like references) as extracted from the source file (Artikel.tex). The BibTeX program loads to corresponding BibTeX data (from say MeineLiteratur.bib) and generates the reference section (Artikel.bbl) which belongs to Artikel.tex. A new compilation of the LaTeX-file, Artikel.tex, molds together text and references into a coherent whole .

Artikel.bbl

Artikel.tex

BibTeX

Artikel.aux

MeineLiteratur.bib

Page 17: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

BibTeX Format

BibTeX (Oren Patashnik, 1986) is a data format as well as an application to store and work on bibliographic data which is necessary to produce the bibliographies in LaTeX documents.

BibTeX, the data format

Tags

Publication type

BibTeX key

Page 18: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

JabRef: BibTeX’s Good Soul

Graphically oriented bibliographic information manager of BibTeX files.

GUI for painless generation and maintenance of BibItems.

JabRef is an OpenSource Java VM application. Advantage: Program runs platform-independent.

Artikel.b

BibTeX

Artikel.a

MeineLiteratur.bib

JabRef

Page 19: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

JabRef’s Bibliography Viewer

Page 20: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Import to JabRef

• Direct filling of the JabRef GUI forms • Import ASCII data file with BibTeX-formated bibliographic information • Import of proprietary data formats from: Inspec (engineering-oriented literature) ISI (Web of Knowledge/Science database) Medline (US National Library of Medicine, bibl. database) Ovid (Platform for STM information) Scifinder ( Chemistry-specific database for literature & substances) EndNote ….

Page 21: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Working with References using LaTex & JabRef

Page 22: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Literature/Reference Management: Zotero

Finally, use Zotero as the front-end tool to acquire, manage and deploy the bibliographic Information necessary for scientific writing.

Register for free at http://zotero.org with free 300 MB cloud storage space.

Page 23: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

A Most Versatile Web Picker

Picker uses (Context Objects in Spans) COinS: Zotero tries to sense the content type in web browser. If successful: add information to personal library with a single click. Zotero supports thousands of sites from book stores, to newspapers, to academic journals and repositories.

Book

Correctly identifies Table of Contents as a folder with a set of single entities

This applies to Firefox!

For other browsers (IE, Safari, Opera, …), .js Bookmarklet solutions available

Page 24: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

More than just Reference Collection

Bibliographic information

Page 25: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Group Libraries to collaborate

For collaborative working: Group Libraries

Zotero groups can be private or public, open or closed.

For example, you and a few colleagues might initially work on a research project in private.

After publication, why not share your research notes

and library with the world?

Number of group libraries and number of participants: unlimited

Administration: Through setup process at zotero.org by the group-library owner

Page 26: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Export Zotero entries to BibTeX

Output Options:

Page 27: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Synchronized across the Universe

Zotero automatically synchronizes data across as many devices as you choose. Add to your research library on your work PC, and organize your collections on your home laptop.

In preferences:

All of your notes, files, and bibliographic data remain seamlessly and silently up to date. Returning from field work? Your data will be waiting for you when you get home.

Page 28: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

The Good and the Bad

+ - Excellent web-picker Synchronization across all popular platforms - MS/Mac/Linux. Standalones (Desktop versions) for Linux/MS/Mac. A viewer exist on iPad (ZotPad) Integration in word processors (MS- & Libre-Office) Bibliographic data download can be coupled with PDF grabbing

Firefox optimized (however, there exist Bookmarklets as web-picker for IE, Safari & Chrome) Bulk transfers are done as website-«scrapes» using COinS.

Page 29: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Exercise 1

1. Collect at least 5 references on the web using Firefox and the Zotero plugin. 2. Select a few or all of the new references, export them in BibTex form to the local desktop. Import the Bibtex file to the existing MyBib.bib BibTeX data collection using JabRef.

N.B. All files connected with LaTeX/BibTex are kept in the folder \LaTeX_Artikel on the USB stick.

Page 30: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Exercise 2

1. Add new citations to the LaTeX File Zrad.tex using texmaker.

2. Process (pdftex) the wrapper files WrapperSimple.tex and WrapperStylish.tex to obtain two different forms of the same article.

3. Change the bibliographystyle to say (plain,

nature, abbrvnat, unsrtnat) and reprocess the article.

Page 31: Scientific Writing with LaTeX - Lib4RI · TeX Philosophy I Enter one-dimensional instructions (the .tex input file) in the well weathered (platform-independent) ASCII format for the

Alfred Gautschy, Fachreferat für Physik & Astronomie