-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.tex
127 lines (110 loc) · 2.66 KB
/
demo.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
\documentclass{article}
\usepackage{amsmath}
\usepackage[gobble=12]{highlightlatex}
\usepackage{geometry}
\usepackage{parskip}
\usepackage[dutch]{babel}
\usepackage{multicol}
\usepackage{hyperref}
\geometry{
paperwidth=182mm,
paperheight=85mm,
margin=1cm
}
\pagestyle{empty}
% Override if you want. Else you can delete it.
%\colorlet{curlyBrackets}{red!50!blue}
%\colorlet{squareBrackets}{blue!50!white}
%\colorlet{codeBackground}{gray!10!white}
%\colorlet{comment}{green!40!black}
\updatehighlight{
name = default,
% 90% blue, remaining is black
color = {blue!90!black},
add = {
\knowncommand
},
% You can't have blank lines when providing these key-values
% (blank line means new paragraph, and that terminates this command)
% So use percent signs (%) to comment out the newline character.
%
name = structure,
add = {
% Default:
%\begin, \end
},
%^ This extra comma doesn't hurt. In fact, it helps when you're
% reordering code; you don't want missing comma's.
}
\updatehighlight{
% Some characters might not work as keyword. Don't go too
% crazy.
name = greenDollar,
style = {\itshape\color{green!70!black}},
add = {
% The dollar sign is provided an extra time just to
% calm down TeXstudio's code highlighting.
$, $
},
%
name = accentA,
color = green!60!black,
add = {
\inAccA, Hi!
},
%
name = accentB,
color = red!60!black,
add = {
\inAccB
},
%
name = accentC,
color = orange!100!black,
add = {
\inAccC
}
}
\begin{document}
\begin{multicols}{2}
And look at this beautiful code
\begin{highlightblock}
% Here is some code
\setcounter{secnumdepth}{1}
\begin{document}
\section{My section (and Hi!)}
\unknowncommand\knowncommand
\inAccA\inAccB\inAccC
\section ~\smash{\ensuremath{\sqrt{2}\;\leftarrow}} cool!~
Insert literal tildes like ~\textasciitilde~. Hi!
\end{document}
\end{highlightblock}
with some text after it.
\vfill\leavevmode\columnbreak
% The name allows us to modify what we had set for it.
\updatehighlight{
name = accentB,
% Removes all commands and keywords from it
clear,
name = accentA,
add = {
\inAccB
}
}
Let's also show square brackets:
\begin{highlightblock}
% File: document.tex
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
Insert math like $\sqrt{2}$.
\inAccA\inAccB\inAccC
\end{document}
\end{highlightblock}
The first line was of the form \hll|\documentclass[]{}|. Very interesting.
Note the \hll|$| are only green because we defined it as a keyword.
\end{multicols}
\begin{center}
Go to \url{https://github.com/vkuhlmann/highlight-latex}
\end{center}
\end{document}