Skip to content

Commit 904185c

Browse files
authored
Update good-practice.md
1 parent be139fd commit 904185c

1 file changed

Lines changed: 30 additions & 29 deletions

File tree

docs/teacher/guides/good-practice.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -72,41 +72,42 @@ Live preview instantly renders a student's input. This is very useful for long/c
7272

7373
## Latex help
7474

75-
1. Use `\begin{array}` to generate a compact table i.e.
76-
77-
```
78-
\begin{array}{|c|c|}
79-
\hline
80-
\theta_{2,0} & \theta_{1,L}\\
81-
\hline
82-
-6700 & 130.5641\\
83-
\hline
84-
-6600 & 161.6086\\
85-
\hline
86-
\end{array}
87-
```
88-
89-
![Image showing a example of a table](images/table.png)
90-
75+
1. Use `\begin{array}` to generate a compact table i.e.
76+
77+
```latex
78+
\begin{array}{|c|c|}
79+
\hline
80+
\theta_{2,0} & \theta_{1,L}\\
81+
\hline
82+
-6700 & 130.5641\\
83+
\hline
84+
-6600 & 161.6086\\
85+
\hline
86+
\end{array}
87+
```
88+
89+
![Image showing a example of a table](images/table.png)
90+
9191
2. Use `\begin{aligned}` to keep your working formatted nicely
92-
```
93-
\begin{aligned}
94-
M_{d e f} &=\dfrac{1}{2}(M+M^T)\\
95-
& =\dfrac{1}{2} \begin{pmatrix} 4 & 14\\ -6 & -11 \end{pmatrix}+\begin{pmatrix} 4 & -6\\ 14 & -11 \end{pmatrix}\\
96-
& =\begin{pmatrix} 4 & 4\\ 4 & -11 \end{pmatrix}
97-
\end{aligned}
98-
```
9992
100-
![Image showing a example of a algined working](images/aligned.png)
93+
```latex
94+
\begin{aligned}
95+
M_{d e f} &=\dfrac{1}{2}(M+M^T)\\
96+
& =\dfrac{1}{2} \begin{pmatrix} 4 & 14\\ -6 & -11 \end{pmatrix}+\begin{pmatrix} 4 & -6\\ 14 & -11 \end{pmatrix}\\
97+
& =\begin{pmatrix} 4 & 4\\ 4 & -11 \end{pmatrix}
98+
\end{aligned}
99+
```
100+
101+
![Image showing a example of a algined working](images/aligned.png)
101102
102103
3. Use `\left` and `\right` for equations with multiple brackets
103104
104-
```
105-
f(x)=\left (\frac{(\cos (x) -x) + i(\sin (x) - x)}{wi} \right)
106-
```
105+
```latex
106+
f(x)=\left (\frac{(\cos (x) -x) + i(\sin (x) - x)}{wi} \right)
107+
```
107108
108-
![Image showing a example of a brackets](images/bracket.png)
109+
![Image showing a example of a brackets](images/bracket.png)
109110
110-
This also works for `[ ]` and `\{ \}`
111+
This also works for `[ ]` and `\{ \}`
111112
112113
4. Use `\sin`, `\cos`, etc. as a shortcut for `\text{sin }`, `\text{cos }`, etc.

0 commit comments

Comments
 (0)