scientific writing and bibliographic research writing and bibliographic research 40 extending latex...

47
Scientific writing and bibliographic research Day 3 Philipp Zumstein, Stefan Weil (Mannheim University Library) philipp.zumstein, stefan.weil @bib.uni-mannheim.de

Upload: vunguyet

Post on 14-May-2018

239 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and

bibliographic research

Day 3

Philipp Zumstein, Stefan Weil

(Mannheim University Library)

philipp.zumstein, stefan.weil

@bib.uni-mannheim.de

Page 2: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 2

Yesterday

Reference management systems

Sources

Search strategies

Citing

Reading

Page 3: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 3

Overview

Introduction

Page 4: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 4

Tips for writing

Page 5: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 5

Note taking

Write short summaries of sources

Claims

Reasons

Evidence

Applications and limitations

Your impressions

Keep a lab diary (Example)

Experiments

Code versions

Describe your evidence

Data sets

Observations

Experimental results

Draft early!

Page 6: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 6

The first draft

Strategy A: Quick and dirty (generally recommended)

Sketch the argument

Fill in the gaps without regard for style or grammar

Re-use notes taken earlier

When on a run, do not care about spelling or citation styles

If stuck, take note where and switch to the next section

When blocked, switch to clean-up work (spelling, citations, …)

Strategy B: Slow and clean (works also)

Finish section by section

Take care of all details

Problems:

Hard to revise later

Slow progress towards a complete report

Page 7: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 7

Writing with distractions vs. in the zone

Distractions: social media, mobile apps, friends, …

flow (psychology), the zone

complete absorption in what one does, very focused, concentrated

Athlete of extreme (adrenaline) sport

無爲 (wu wei in Taoism)

hack mode

Source: https://www.flickr.com/photos/birgerking/6875893248

by Hunter Lang used under CC-BY (without changes)

Page 8: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 8

The first draft: A plan

Sketch the introduction

Goal: motivate reading

Brief context

Problem summary

Your main point

Organize the body

Background, definitions and preliminaries

Order reasons and evidence

Create sections accordingly

Locate acknowledgements and responses

Find a conclusion

Summary of the main argument

Further research

- Response to problem

- State the idea of a solution OR

State where the report is heading

- Condition of incomplete knowledge

- Consequences of not understanding

Page 9: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 9

Revising

“I rewrote the ending of Farewell to Arms, the last page of it, 39

times before I was satisfied.” (Hemingway 1956)

Write first draft

Revising

Revising

Revising

Revising

Final manuscript

quality

Page 10: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 10

Revising

Consider the report as a whole

Take the viewpoint of your reader:

Can I follow the argument?

Are all definitions given?

Is the purpose of each section clear?

Are the sections properly connected?

Rethink the structure of your thesis

Do I need to refer forward or backward often?

Have someone else read it

Everyone should understand your introduction and conclusion

Everyone should be able to follow the argument

Your mother might spot the last spelling mistakes

Page 11: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 11

Final words

Think about presenting your

data properly

Tables or graphs?

In-text or as appendix?

“Optimize” graphs and tables

last

But schedule some time for the

task

One can spend a long time on a

simple table

Picture: Pixabay

Page 12: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 12

Questions

Page 13: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 13

Further reading

Booth, Colomb, Williams: The Craft of Research, Part IV

Alley: The Craft of Scientific Writing

Page 14: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 14

Need help: Our Services at the Library

Subject librarians

Recommendation for Acquisition

Finding literature or data

Subject specific questions

Support by Email and Face-to-Face

Writing consultancy

English and German

in the LearningCenter

for students of all disciplines

Reference management team

Courses for Zotero, Citavi, Mendeley

Support by Email and Face-to-Face

More courses (Portal2)

Help with using library services: Chat, InfoCenter

Page 15: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

LaTeX

Page 16: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 16

Introduction: Typesetting

How to align text in a block nicely?

line break

separation into syllables (=Worttrennung)

What is the optimal line length for readability?

Can I mix two fonts in the same documents?

Is the spaces between two lines depending on the font size?

How to include mathematical formulas?

What are „Hurenkinder“ and „Schusterjungen“ and how to avoid

them?

Page 17: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 17

Preliminaries

TeX is a typesetting program

LaTeX

is not a WYSIWYG word processor

is a markup language and document preparation system

is a requirement for thesis papers by several groups

is a requirement for most journals and conferences

BibTeX

Adds management of bibliographic resources to LaTeX

Is also a metadata format

Allows easy referencing across hundreds of sources

PDFLaTeX

Directly creates PDF files

(LaTeX came with its own graphic format, DVI)

Is a binary parsing and compiling .tex files

Page 18: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 18

Understanding LaTeX syntax

\ % & $ # _ ^ { } and ~ are special characters

Used in your LaTeX document, they have a special meaning

If you simply want the character to be printed, then use backslash in front of

the special character, e.g. \%. And \backslash for the backslash.

\ is used to start command names

% is used to start a comment

Words are separated by one or more spaces

Paragraphs are separated by one or more blank lines

The output is not affected by adding extra spaces or extra blank lines to the

input file.

Descriptions instead of format instructions

\emph for emphasize

rather than “Bold 12pt”

Page 19: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 19

Document class

At the beginning of every LaTeX document:

\documentclass[options]{class}

Classes

article

book

report

letter

Options

11pt, a4paper, twocolumn, draft, …

LaTeX uses style sheets or document classes

Class definitions determine the look and feel of a document

Class definitions can be overridden...but you really should not do it

Page 20: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Basic document

\documentclass{article}

“use document style for articles”

\begin{document}

“here the document begins ”

Hello World

Text which will be shown

\end{document}

“here the document ends”

Page 21: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 21

Document with title page

\documentclass{article}

\begin{document}

\title{My Title}

\author{My Name}

\maketitle

Here is my content.

\end{document}

Page 22: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 22

Document structure

\chapter{Chapter Heading}

\section{Section Heading}

\subsection{Subsection Heading}

depending on the documentclass

numbered automatically

automatical generation/update of the table of contents: \tableofcontents

Page 23: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 23

Document with structure

\documentclass{article}

\begin{document}

\section{Introduction}

Here is my content.

\subsection{Motivation}

\section{Conclusion}

In this work, we had a look at…

\end{document}

Page 24: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 24

Document with table of contents

\documentclass{article}

\begin{document}

\tableofcontents

\section{Introduction}

Here is my content.

\subsection{Motivation}

\section{Conclusion}

In this work, we had a look at…

\end{document}

Page 25: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 25

Document with formula

\documentclass{article}

\begin{document}

Let $\alpha_1, \alpha_2, \alpha_3 > 0$ be the angles of a triangle, then

\begin{equation}

\sum_{i=1}^3 \alpha_i =\pi

\label{eq:triangle-sum}

\end{equation}

The Equation \ref{eq:triangle-sum} was

proven a long time ago.

\end{document}

inline mathematical

mode (between

normal text)

Equation environment

for a single line with a

mathematical formula

Page 26: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 26

Equations

\

Page 27: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 27

Try it yourself

Create a new document with documentclass book and the

following structure:

1 Introduction

1.1 Theoretical Background

1.1.1 Statistical Theory

Note: the automatic numbering should

starts from 1 and not 0!

Hint: How are the units (like section)

named in a book?

Add the table of contents in the beginning.

Page 28: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 28

Try it yourself

(*) Write the following in the same style:

Hint: You may use the toolbars in

TeXnicCenter to find the

mathematical symbols.

Page 29: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 30

Floats

material that belong together vs. page breaks

avoid partially filled pages free flowing elements (floats)

Free-flowing portion of the layout

Pictures

Charts

Tables

Text boxes

Commands

\begin{figure} … \end{figure}

\begin{table} … \end{table}

\caption{<TEXT>} inside the float environment

\label{<TEXT>} must be after a caption, and inside the float

Page 30: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Document with picture

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{figure}[ht]

\centering

\includegraphics[width=0.8\textwidth]{pic.jpg}

\caption{My picture}

\label{fig:pic}

\end{figure}

\end{document}

scope of centering is

inside its group, i.e.

here inside the figure

environment

preferred position of

the float (h=here,

t=top, b=bottom, …)

Page 31: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 32

Document with list of pictures

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\listoffigures

\begin{figure}[ht]

\centering

\includegraphics[width=0.8\textwidth]{pic.jpg}

\caption{My picture}

\label{fig:pic}

\end{figure}

\end{document}

Page 32: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 33

Tables

Tabulars

Starts with \begin{tabular}

and ends with \end{tabular}

Rows are seperated by \\

and & splits into the columns

Should be inside a table float

Can be imported e.g. from Excel

\begin{tabular}{|r|l|}

\hline

1 & one\\

2 & two\\

3 & three\\

\hline

\end{tabular}

Specify the number

of columns and their

alignment (r=right,

l=left, c=center)

Page 33: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 34

Document with a table

\documentclass{article}

\begin{document}

\begin{table}[ht]

\centering

\begin{tabular}{|r|l|}

\hline

1 & one\\

2 & two\\

3 & three\\

\hline

\end{tabular}

\caption{Count from 1 to 3}

\label{tab-numb}

\end{table}

\end{document}

Page 34: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 35

Bibliography

BibTeX-Export from Zotero will generate bib-file (put it in the same

directory as the tex-file)

Connect them by adding \bibliography{filename_of_the_bib_file} in

the tex-file

Create citations with \cite{BibTeX_key}, also possible:

\cite[p.~215]{citation01}

\cite{citation01,citation02,citation03}

Zotero generate BibTeX key as a combination of the lastname of

the firstauthor, first word of the title and the four-digit year (check

the bib-file if in doubt)

Use \bibliographystyle{} with plain, alpha, apalike, IEEEtran, … to

show the bibliography in this style

!! BibTeX ≠ BibLaTeX !!

Page 35: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 36

Document with bibliography

\documentclass{article}

\bibliographystyle{alpha}

\begin{document}

In \cite{Bohring2005}, it is explained that...

\bibliography{references}

\end{document}

Page 36: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 37

Build Document = LaTeX, BibTeX, LaTeX, LaTeX

Reference: Pospiech, Matthias (2011): Bibliographien mit LaTeX mit Zitaten und Nummern Stil.

http://www.matthiaspospiech.de/files/latex/vortrag/VortragBibtexBiblatexBiber.pdf , Folie 15

Page 37: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 38

Workflow considerations

Add references

Update references

Write text

Add quotations

Add citations

Final output

BibTeX export

Build routine

1 BibTeX file containing

ALL references!

Put ALL the files

in the SAME folder

Work with a project

(e.g. one LaTeX file)

Page 38: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 39

Handling Errors and Warnings

Errors after 5 times building are

serious and need to be handled:

Googling the Error Message

http://tex.stackexchange.com/

Look at warnings and decide

whether to ignore and deal with

them

Overfull/underfull boxes are

common and mostly negligible

Source of this picture:

https://twitter.com/BecomingDataSci/status/83596159492024320

0

Page 39: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 40

Extending LaTeX

Packages with \usepackage[options]{packageName}

for example:

\usepackage{graphicx}

\usepackage[utf8]{inputenc}

ngerman, color, listings, algorithmic, hyperref, …

Define new commands with \newcommand{\key}{name}

Goals: abbreviations and consistency

E.g. blue, bold text for todo’s (need color package): \newcommand{\todo}[1]{%

\textbf{\textcolor{blue}{[#1]}}

}

Possibilities to adapt the document classes

Page 40: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 41

The big picture of the tools

\documentclass{article}

\begin{document}}

\bibliographystyle{alpha}

\bibliography{references}

\end{document}

BibTeX-file

• databases, catalogues

• information

LaTeX-file

pictures

programming code

data

Page 41: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 42

Literature

Oetiker et. al.:The Not So Short Introduction to LATEX2ε

http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf

Wikibook : LaTeX

http://en.wikibooks.org/wiki/LaTeX

Kopka: LaTeX, Band 1: Einführung

ISBN: 978-3-8273-7038-9

Pearson Studium

Schlager: Wissenschaftlich mit LATEX arbeiten

ISBN 978-3-8273-7078-5

Pearson Studium

Page 42: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Questions

Page 43: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 44

Try it yourself

Start a new project which uses BibTeX and use article again as

documentclass

Create the following table in LaTeX

Integrate your bibliography

and cite at least three references.

(*) Extend your created document

with a picture

Page 44: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 45

Try it yourself (**)

(**) Include the hyperref package in your document and see what

changes, cf. https://en.wikibooks.org/wiki/LaTeX/Hyperlinks

(**) Read about error messages and warnings in LaTeX here:

https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings

Page 45: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 46

Document with an algorithm in Pseudocode (***)

\documentclass{article}

\usepackage{algorithmic}

\begin{document}

\begin{algorithmic}

\IF {$i\geq 10$}

\STATE $k\gets 0$

\ELSE

\STATE $k\gets 10$

\ENDIF

\end{algorithmic}

\end{document}

Page 46: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 47

Document with an algorithm in Java (***)

\documentclass{article}

\usepackage{listings}

\begin{document}

\begin{lstlisting}[language=Java,frame=single]

public class HelloWorld

{

public static void main (String[] args)

{

// Ausgabe Hello World!

System.out.println("Hello World!");

}

}

\end{lstlisting}

\end{document}

Page 47: Scientific writing and bibliographic research writing and bibliographic research 40 Extending LaTeX ... Wikibook : LaTeX  Kopka: LaTeX, Band 1: Einführung

Scientific writing and bibliographic research 48

Try it yourself (***)

(***) Include the code for Quicksort in your document.

(***) What can you do with the natbib package? See

https://en.wikibooks.org/wiki/LaTeX/Bibliography_Management

(***) Several chairs offer a LaTeX template:

http://pi3.informatik.uni-mannheim.de/studienarbeiten.html.de

http://dws.informatik.uni-mannheim.de/en/thesis/masterthesis/

http://ls.wim.uni-mannheim.de/de/pi4/teaching/thesis/#c12709

http://swt.informatik.uni-mannheim.de/de/studies/master-and-bachelor-

theses/guidelines/

Download one of them and try it out.