new intro to latex workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. ·...

42
Intro to LaTeX Workshop Crystal Nguyen University of North Carolina at Chapel Hill 10/13/2017 Nguyen (UNC) LaTeX Workshop 10/13/2017 1 / 31

Upload: others

Post on 16-Oct-2020

3 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Intro to LaTeX Workshop

Crystal Nguyen

University of North Carolina at Chapel Hill

10/13/2017

Nguyen (UNC) LaTeX Workshop 10/13/2017 1 / 31

Page 2: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Overview

1 Getting Started in LaTeX

2 Typesetting Equations

3 Lists

4 Floats

5 Including Code

6 My Project is Finished. Now What?

7 Tips and Tricks

8 Articles

9 Presentations

10 Conclusion

Nguyen (UNC) LaTeX Workshop 10/13/2017 2 / 31

Page 3: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

What is LaTeX?

• A text editor for more advanced documents, especially those includingcomplex tables and equations

• Uses “code” to create a PDF

• Useful for projects, homework, manuscripts, quals, posters, figures

• Examples (These are local to my computer and won’t open if youclick them.)• Conference Slides• 760 homework• Applied qualification exams• Figure

Nguyen (UNC) LaTeX Workshop 10/13/2017 3 / 31

Page 4: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Getting Started

1 Go to the BSA website and dowload slides:bsa.web.unc.edu/computing/latex/

2 Download the workshop .zip here (Solutions here)

3 Go to Overleaf and sign up with any email

4 Sign in, and click the green upload button on the upper left corner

5 Select “upload zip”

6 Select the .zip downloaded from the BSA website

7 Change the name, date, and title in your document accordingly

Nguyen (UNC) LaTeX Workshop 10/13/2017 4 / 31

Page 5: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Getting Started

\section{Homework Examples}

\begin{enumerate}

\item

\end{enumerate}

• % is how to comment the code

• \section∗{Homework Examples}

Nguyen (UNC) LaTeX Workshop 10/13/2017 5 / 31

Page 6: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

• $’s allow you to enter in and out of equation mode.

Exercise 1: In words, describe what m and b are in the equationy = mx+ b.

$m$ is the slope and $b$ is the intercept.

Nguyen (UNC) LaTeX Workshop 10/13/2017 6 / 31

Page 7: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

• $’s allow you to enter in and out of equation mode.

• Double $ centers the equation.

Exercise 2: Write y = mx+ b as a centered equation.

$$y = mx + b$$

Nguyen (UNC) LaTeX Workshop 10/13/2017 7 / 31

Page 8: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

• $’s allow you to enter in and out of equation mode.

• Double $ centers the equation.

• The equation environment will also give you centered equations.

Exercise 3: Write y = mx+ b as a centered equation in the equationenvironment.

\begin{equation} y = mx + b \end{equation}

Nguyen (UNC) LaTeX Workshop 10/13/2017 8 / 31

Page 9: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

Alignment in LaTeX:

• Align columns with & symbols

• Align rows with \\

Notice the nested enumerate environments so that we have problems 3aand 3b.

Nguyen (UNC) LaTeX Workshop 10/13/2017 9 / 31

Page 10: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

Exercise 3a: Rewrite the equation using the equation and alignedenvironments.

\begin{equation}\begin{aligned}

& & y & = mx + b \\& & & = (m \times x) + b \\& \implies & 0 & = \{(m \times x) + b\} - y

\end{aligned}\end{equation}

Nguyen (UNC) LaTeX Workshop 10/13/2017 10 / 31

Page 11: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Equation Environments

Exercise 3b: Split the last line of 3a onto two different lines

0 = {(m× x)

+ b} − y

\begin{equation}\begin{aligned}

0 &= \{(m \times x) \\&\hspace{1cm} + b \} - y \nonumber

\end{aligned}\begin{equation}

Nguyen (UNC) LaTeX Workshop 10/13/2017 11 / 31

Page 12: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Piecewise functions

Exercise 4: Use alignment syntax and the cases environment to make thefollowing piecewise function

y =

{x, 0 < x < 1

mx+ b, x ≥ 1

$$ y = \begin{cases}x, & 0 < x < 1mx + b, & x \geq 1

\end{cases} $$

Nguyen (UNC) LaTeX Workshop 10/13/2017 12 / 31

Page 13: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Matrices and vectors

What if we have matrices and vectors? Exercise 5: Replicate the following.

E[Y |X] = β

1 0 0

0. . . 0

0 0 1

+ ε

$$ E[\bs{Y}|\bs{X}] = \bs\beta \begin{bmatrix}1 & 0 & 0 \\0 & \ddots & 0 \\0 & 0 & 1

\end{bmatrix}+ \bs{\epsilon} $$

Nguyen (UNC) LaTeX Workshop 10/13/2017 13 / 31

Page 14: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

More Math Practice

Exercise 6: Replicate the following.

s =

(∑ni=1(yi − y)2

n− 1

)1/2

$$ s = \l( \frac{ \sum {i=1}^n (y i - \overbar{y})^2 }{n - 1} \r)^{1/2} $$

Nguyen (UNC) LaTeX Workshop 10/13/2017 14 / 31

Page 15: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Lists

• Use itemize instead of enumerate to make a bulleted list

• Sometimes we want to skip numbers or letters in enumerate

• Note the commands \addtocounter{enumi}{3} and\addtocounter{enumii}{2} in our next section

• The number of i’s in “enumi” the first set of brackets determine whatlevel of the enumerate to add a counter to

• The number in the second set of brackets determines how many toadd to the counter (Does not set the counter to that value)

Nguyen (UNC) LaTeX Workshop 10/13/2017 15 / 31

Page 16: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Floats

• Tables, figures, and equation environments are what are called floats

• LaTeX will try to put these wherever it thinks is best

• It is generally best to add these to your document last and then playaround with how to position it properly

Nguyen (UNC) LaTeX Workshop 10/13/2017 16 / 31

Page 17: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Figures

Typically, you would do the following, but because we uploaded the entire.zip, we can skip steps 1-2 for now.

1 Select PROJECT > Files... > Computer

2 Drag and drop or select the image file from your downloaded folder.

3 Use the following code to include the image in your document.Exercise 4c:\begin{figure}[h!]\centering\includegraphics[scale = 0.3]{Histogram.png}\label{fig:malezinc} \caption{A histogram of serum

zinc levels in men.}\end{figure}

Nguyen (UNC) LaTeX Workshop 10/13/2017 17 / 31

Page 18: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Figures

• The [h!] forces the location as best as possible, based on the size ofthe image. Some options are t for top, b for bottom, h for here(inline).

• You can play with the [scale = ] option to resize. Instead, youcould use [height = <value>, width = <value>,

keepaspectratio]

• You can also include a command in the figure environment,\label{<name>}. Then in your article text, you can use Figure

\ref{<name>} to correctly call the figure number, e.g., “Figure 1”

Nguyen (UNC) LaTeX Workshop 10/13/2017 18 / 31

Page 19: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tables

\begin{table}[h!]

\caption{Parameter estimates for Model 1.}

\centering

\begin{tabular}{ccc}

\hline

Effect & Variable & Estimate \\

\hline

Intercept & $\beta_0$ & 0.45 \\

Gender & $\beta_1$ & 4.74 \\

Age & $\beta_2$ & 7.32 \\

\hline

\end{tabular}

\label{tab:Model1}

\end{table}

Now, try changing one of the c’s after tabular to an l or r. Then tryadding a | between them. Note the changes in your table.

Nguyen (UNC) LaTeX Workshop 10/13/2017 19 / 31

Page 20: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tables

\begin{table}[h!]

\caption{Parameter estimates for Model 1.}

\centering

\begin{tabular}{ccc}

\hline

Effect & Variable & Estimate \\

\hline

Intercept & $\beta_0$ & 0.45 \\

Gender & $\beta_1$ & 4.74 \\

Age & $\beta_2$ & 7.32 \\

\hline

\end{tabular}

\label{tab:Model1}

\end{table}

Now, try changing one of the c’s after tabular to an l or r. Then tryadding a | between them. Note the changes in your table.

Nguyen (UNC) LaTeX Workshop 10/13/2017 19 / 31

Page 21: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Including Code

• We sometimes wish to include our code as an appendix or in aproblem

• We can use the lstlisting environment for R or the minted

environment for SAS

• Whatever is typed in this environment is produced exactly as is in thedocument in a different font

Nguyen (UNC) LaTeX Workshop 10/13/2017 20 / 31

Page 22: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Including Code

• R in text\begin{lstlisting}[language = R, caption = R Code]

x <- rnorm(100)

\end{lstlisting}

• R file\lstinputlisting{<filename>.R}

• SAS in text\begin{lstlisting}[language = SAS, caption = SAS Code]

PROC FREQ ...

\end{lstlisting}

Nguyen (UNC) LaTeX Workshop 10/13/2017 21 / 31

Page 23: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

My Project is Finished. Now What?

• To download a copy of the pdf, simply click PDF

• To download a copy of the pdf, tex file, and all accompanying files,select PROJECT > DOWNLOAD AS ZIP

• Works similarly to Google Docs

You can also create templates and quickly make copies on Overleaf

Nguyen (UNC) LaTeX Workshop 10/13/2017 22 / 31

Page 24: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• Use \text{} to include text in equation environments.

• \textbf{text} will produce boldface font

• \emph{text} will produce italicized font

• \hat{} and \tilde{} work similarly to \overbar{}

• Use the tilde apostrophe to make “quotes” face the correct way.

Nguyen (UNC) LaTeX Workshop 10/13/2017 23 / 31

Page 25: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• Use \text{} to include text in equation environments.

• \textbf{text} will produce boldface font

• \emph{text} will produce italicized font

• \hat{} and \tilde{} work similarly to \overbar{}

• Use the tilde apostrophe to make “quotes” face the correct way.

Nguyen (UNC) LaTeX Workshop 10/13/2017 23 / 31

Page 26: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• Use \text{} to include text in equation environments.

• \textbf{text} will produce boldface font

• \emph{text} will produce italicized font

• \hat{} and \tilde{} work similarly to \overbar{}

• Use the tilde apostrophe to make “quotes” face the correct way.

Nguyen (UNC) LaTeX Workshop 10/13/2017 23 / 31

Page 27: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• Use \text{} to include text in equation environments.

• \textbf{text} will produce boldface font

• \emph{text} will produce italicized font

• \hat{} and \tilde{} work similarly to \overbar{}

• Use the tilde apostrophe to make “quotes” face the correct way.

Nguyen (UNC) LaTeX Workshop 10/13/2017 23 / 31

Page 28: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• Use \text{} to include text in equation environments.

• \textbf{text} will produce boldface font

• \emph{text} will produce italicized font

• \hat{} and \tilde{} work similarly to \overbar{}

• Use the tilde apostrophe to make “quotes” face the correct way.

Nguyen (UNC) LaTeX Workshop 10/13/2017 23 / 31

Page 29: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• We can make different colored text with \{red}{text}

• If you are including a float in your homework for a part of a question(say problem 10c, for example), LaTeX may not place the float whereyou like it with respect to the problem numbering. If you add textbefore your table or figure environment, this should make it moreaesthetically pleasing.

• Rmarkdown package in R allows you to write up your LaTeX file in Rso you can more directly import tables and figures as you edit them.

• You can also create presentations in LaTeX (called beamer). Atemplate is available on the BSA website

• Cheatsheet and symbols .pdfs are useful resources.

Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31

Page 30: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• We can make different colored text with \{red}{text}• If you are including a float in your homework for a part of a question

(say problem 10c, for example), LaTeX may not place the float whereyou like it with respect to the problem numbering. If you add textbefore your table or figure environment, this should make it moreaesthetically pleasing.

• Rmarkdown package in R allows you to write up your LaTeX file in Rso you can more directly import tables and figures as you edit them.

• You can also create presentations in LaTeX (called beamer). Atemplate is available on the BSA website

• Cheatsheet and symbols .pdfs are useful resources.

Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31

Page 31: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• We can make different colored text with \{red}{text}• If you are including a float in your homework for a part of a question

(say problem 10c, for example), LaTeX may not place the float whereyou like it with respect to the problem numbering. If you add textbefore your table or figure environment, this should make it moreaesthetically pleasing.

• Rmarkdown package in R allows you to write up your LaTeX file in Rso you can more directly import tables and figures as you edit them.

• You can also create presentations in LaTeX (called beamer). Atemplate is available on the BSA website

• Cheatsheet and symbols .pdfs are useful resources.

Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31

Page 32: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• We can make different colored text with \{red}{text}• If you are including a float in your homework for a part of a question

(say problem 10c, for example), LaTeX may not place the float whereyou like it with respect to the problem numbering. If you add textbefore your table or figure environment, this should make it moreaesthetically pleasing.

• Rmarkdown package in R allows you to write up your LaTeX file in Rso you can more directly import tables and figures as you edit them.

• You can also create presentations in LaTeX (called beamer). Atemplate is available on the BSA website

• Cheatsheet and symbols .pdfs are useful resources.

Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31

Page 33: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks

• We can make different colored text with \{red}{text}• If you are including a float in your homework for a part of a question

(say problem 10c, for example), LaTeX may not place the float whereyou like it with respect to the problem numbering. If you add textbefore your table or figure environment, this should make it moreaesthetically pleasing.

• Rmarkdown package in R allows you to write up your LaTeX file in Rso you can more directly import tables and figures as you edit them.

• You can also create presentations in LaTeX (called beamer). Atemplate is available on the BSA website

• Cheatsheet and symbols .pdfs are useful resources.

Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31

Page 34: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks: Efficiently creating tables

• Excel2Latex add on allows you to create tables in Excel and producethe LaTeX code needed.

• This online table generator will do something similar without anydownloading.

• xtable package in R will take dataframes in R and output the LaTeXcode.

Nguyen (UNC) LaTeX Workshop 10/13/2017 25 / 31

Page 35: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks: Efficiently creating tables

• Excel2Latex add on allows you to create tables in Excel and producethe LaTeX code needed.

• This online table generator will do something similar without anydownloading.

• xtable package in R will take dataframes in R and output the LaTeXcode.

Nguyen (UNC) LaTeX Workshop 10/13/2017 25 / 31

Page 36: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Tips and Tricks: Efficiently creating tables

• Excel2Latex add on allows you to create tables in Excel and producethe LaTeX code needed.

• This online table generator will do something similar without anydownloading.

• xtable package in R will take dataframes in R and output the LaTeXcode.

Nguyen (UNC) LaTeX Workshop 10/13/2017 25 / 31

Page 37: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Article/Journal Writing

• Cheatsheet has lots of formatting help• fontsize• margins• in text changes to fontsize• quotation environment• hspace and vspace

• You can label equations the same way we label figures and tables

• External files: .cls, .sty, .bib

Nguyen (UNC) LaTeX Workshop 10/13/2017 26 / 31

Page 38: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

References....the worst

• .bib files

• Google scholar is your friend

• biblatex package in your preamble (not .bib)\usepackage[style=apa,backend=biber]{biblatex}

\addbibresource{<filname>.bib}

\begin{document}

.

.

.

\printbibliography

\end{document}

• \cite{} in text for the bib-key

• multibib package for multiple .bib files in different sections

Nguyen (UNC) LaTeX Workshop 10/13/2017 27 / 31

Page 39: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Presentations

• Beamer document class

• Sections, enumerate, itemize, almost everything is the same

• To make a new frame:\begin{frame}\frametitle{Frametitle goes here}

...\end{frame}

• \begin{frame}[< +− >]... to give the PowerPoint effect

• \vfill is your friend, please use it

• Different themes are available here, or use our template on the BSAwebsite!

Nguyen (UNC) LaTeX Workshop 10/13/2017 28 / 31

Page 40: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Presentations: Blocks

Sometimes you want a block of text.

\begin{block}{Theorem}If something happens, then this other thing happens.

\end{block}

Theorem

If something happens, then this other thing happens.

Nguyen (UNC) LaTeX Workshop 10/13/2017 29 / 31

Page 41: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Conclusion

• LaTeX has a lot of capabilities and flexibility in total customizationvia coding language

• The ceiling is the roof

• Online documentation, StackExchange, Cheatsheet, LaTeX symbolsdocument, Friends

• BSA website templates for MS paper, beamer, homework

• Use the LaTeX package tikz to draw figures in LaTeX. Exampleshere.

Nguyen (UNC) LaTeX Workshop 10/13/2017 30 / 31

Page 42: New Intro to LaTeX Workshopbsa.web.unc.edu/files/2017/10/latex-workshop.pdf · 2017. 10. 13. · Nguyen (UNC) LaTeX Workshop 10/13/2017 24 / 31. Tips and Tricks We can make di erent

Conclusion

[email protected]

Nguyen (UNC) LaTeX Workshop 10/13/2017 31 / 31