Skip to content

Commit c936c28

Browse files
committed
adds LaTeX support
1 parent 95fe947 commit c936c28

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

code-samples/latex-sample.tex

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
\documentclass{article}
2+
\usepackage{amsmath}
3+
4+
\pgfplotsset{compat=newest} % Allows to place the legend below plot
5+
6+
\begin{document}
7+
8+
\begin{equation*}
9+
f(x) = x^2
10+
\end{equation*}
11+
12+
\begin{align*}
13+
f(x) &= x^2\\
14+
g(x) &= \frac{1}{x}\\
15+
F(x) &= \int^a_b \frac{1}{3}x^3
16+
\end{align*}
17+
18+
\section{Section}
19+
20+
Hello World!
21+
22+
\subsection{Subsection}
23+
24+
Structuring a document is easy!
25+
26+
\subsubsection{Subsubsection}
27+
28+
More text.
29+
30+
\paragraph{Paragraph}
31+
32+
Some more text.
33+
34+
\subparagraph{Subparagraph}
35+
36+
Even more text.
37+
38+
\section{Another section}
39+
40+
\begin{figure}
41+
\includegraphics[width=\linewidth]{boat.jpg}
42+
\caption{A boat.}
43+
\label{fig:boat1}
44+
\end{figure}
45+
46+
Figure \ref{fig:boat1} shows a boat.
47+
48+
\newpage
49+
50+
\bibliography{lesson7a1}
51+
\bibliographystyle{ieeetr}
52+
53+
Random citation \autocite[1]{DUMMY:1} embeddeed in text.
54+
55+
\newpage
56+
57+
\printbibliography
58+
59+
This is some example text\footnote{\label{myfootnote}Hello footnote}.
60+
61+
\begin{table}[h!]
62+
\centering
63+
\caption{Caption for the table.}
64+
\label{tab:table1}
65+
\begin{tabular}{ccc}
66+
\toprule
67+
Some & actual & content\\
68+
\midrule
69+
prettifies & the & content\\
70+
as & well & as\\
71+
using & the & booktabs package\\
72+
\bottomrule
73+
\end{tabular}
74+
\end{table}
75+
76+
\begin{figure}[h!]
77+
\begin{center}
78+
\begin{tikzpicture}
79+
\begin{axis}[
80+
width=\linewidth, % Scale the plot to \linewidth
81+
grid=major, % Display a grid
82+
grid style={dashed,gray!30}, % Set the style
83+
xlabel=X Axis $U$, % Set the labels
84+
ylabel=Y Axis $I$,
85+
x unit=\si{\volt}, % Set the respective units
86+
y unit=\si{\ampere},
87+
legend style={at={(0.5,-0.2)},anchor=north}, % Put the legend below the plot
88+
x tick label style={rotate=90,anchor=east} % Display labels sideways
89+
]
90+
\addplot
91+
% add a plot from table; you select the columns by using the actual name in
92+
% the .csv file (on top)
93+
table[x=column 1,y=column 2,col sep=comma] {table.csv};
94+
\legend{Plot}
95+
\end{axis}
96+
\end{tikzpicture}
97+
\caption{My first autogenerated plot.}
98+
\end{center}
99+
\end{figure}
100+
101+
\end{document}

styles/languages/_index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@import "java";
1717
@import "javascript";
1818
@import "json";
19+
@import "latex";
1920
@import "less";
2021
@import "liquid";
2122
@import "mediawiki";

styles/languages/latex.less

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.latex {
2+
3+
.keyword.control,
4+
.support.function {
5+
.purple();
6+
7+
.punctuation {
8+
color: lighten(@text-purple, 30%);
9+
}
10+
}
11+
12+
.meta.preamble {
13+
.support.class {
14+
.blue();
15+
}
16+
}
17+
18+
.variable.parameter {
19+
.orange();
20+
}
21+
22+
.constant.other {
23+
.teal();
24+
}
25+
26+
.punctuation.definition,
27+
.punctuation.section {
28+
color: @syntax-fg3;
29+
}
30+
31+
.string.quoted {
32+
.reset();
33+
34+
.punctuation {
35+
color: inherit;
36+
}
37+
}
38+
39+
}

0 commit comments

Comments
 (0)