-
Notifications
You must be signed in to change notification settings - Fork 0
/
classdemo.tex
145 lines (102 loc) · 3.61 KB
/
classdemo.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
% for live demo
\documentclass{article}
\title{My first document}
%\author{John Fink \\ email \href{mailto:jfink@mcmaster.ca}{jfink@mcmaster.ca}}
\author{John Fink}
\date{March 13, 2024}
% packages and package setup go here
\usepackage{tikz}
\usepackage{chemfig}
\usepackage[version=4]{mhchem}
\usepackage{siunitx} % required for decimal point alignment
\usepackage{mathtools} % for eliminating automatic numbering of math
%\usepackage{hyperref} % if you want your href email thing to work in the commented out author line.
\sisetup{
round-mode = places, % Rounds numbers
round-precision = 2, % to 2 places
}
\begin{document}
\maketitle
This is a document!
% Footnote example
This is a sentence with a footnote!\footnote{A footnote}
Footnotes are automagically numbered!\footnote{Wow!}\\
Let us do some \textbf{basic} things like \textit{italicize}! Or \underline{underline}!
You can \textbf{\underline{nest tags as well}}!
Pictures? Sure, we can do that!
\includegraphics[height=8cm]{ztd-zen-mode}
% Diagrams with tikz
% examples from https://www.overleaf.com/learn/latex/LaTeX_Graphics_using_TikZ%3A_A_Tutorial_for_Beginners_(Part_1)%E2%80%94Basic_Drawing
\section{Diagrams with tikz}
Diagrams!!\\
Start with \verb|\begin{tikzpicture}..\end{tikzpicture}|! Draw a line! Feel the rush!
\begin{tikzpicture}
\draw (0,0) -- (4,0);
\end{tikzpicture}
Draw a box! The excitement, will it ever stop?
\begin{tikzpicture}
\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
\end{tikzpicture}
No!!! We must \textbf{keep going}!! Here's the same box but ... better?
\begin{tikzpicture}
\draw (0,0) rectangle (4,4);
\end{tikzpicture}
A circle??? Centred?
\begin{center}
\begin{tikzpicture}
\draw (2,2) circle (3cm) node {circle?};
\end{tikzpicture}
\end{center}
% Tables
% from https://latex-tutorial.com/tutorials/tables/
% Rows can be added by adding a line after "3", e.g. like "4 & 3432.1234 & d \\"
% Columns can be added by adding to the Value line like "& \textbf{Value 4}\\" and then specifying the label "& $\delta$ \\, and then adding more values to the rows "& d" etc.
\section{tables}
\begin{table}[h!] % h! eliminates float
\begin{center}
\caption{Your first table.}
\label{tab:table1}
\begin{tabular}{l|c|r} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
\textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\
$\alpha$ & $\beta$ & $\gamma$ \\
\hline
1 & 1110.1 & a\\
2 & 10.1 & b\\
3 & 23.113231 & c\\
\end{tabular}
\end{center}
\end{table}
Now let's \textbf{align those decimals} with our \textit{siunitx} package.
\begin{table}[h!]
\begin{center}
\caption{Your second table.}
\label{tab:table2}
\begin{tabular}{l|S|r} % <-- Note: middle value changed to S for centering
\textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\
$\alpha$ & $\beta$ & $\gamma$ \\
\hline
1 & 1110.1 & a\\
2 & 10.1 & b\\
3 & 23.113231 & c\\
\end{tabular}
\end{center}
\end{table}
% Math
% See https://en.m.wikibooks.org/wiki/LaTeX/Mathematics
\section{math}
Remember, math can be done \textit{inline}! $f(x)=(x+a)(x+b)$\footnote{inline!!!} or set by itself using e.g. \verb|\begin{equation}...\end{equation}|:
\begin{equation*} % The * suppresses the automatic numbering - mathtools provides this.
\frac{1}{\sqrt{x}}
\end{equation*}
More math! I don't know what I'm doing! $k_{n+1} = n^2 + k_n^2 - k_{n-1}$
% Chemistry
% Chemfig and mhchem examples: https://en.m.wikibooks.org/wiki/LaTeX/Chemical_Graphics
\section{chemistry}
Chemistry!
\chemfig{A-B}
\chemfig{A<B}
\chemfig{C(-[:0]H)(-[:90]H)(-[:180]H)(-[:270]H)}
\ce{H2O}
\ce{NO3-}
\ce{(NH4)2S)}
\end{document}