Changeset View
Changeset View
Standalone View
Standalone View
autotests/folding/highlight.tex.fold
1 | % LaTeX test file for kate's syntax highlighting and code folding | 1 | % LaTeX test file for kate's syntax highlighting and code folding | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | \ordinaryLaTeXcommandwithoption[10pt,a4paper]{article} | 3 | \ordinaryLaTeXcommandwithoption[10pt,a4paper]{article} | ||
4 | <beginfold id='3'>% BEGIN region</beginfold id='3'> | 4 | % BEGIN region | ||
5 | %comment, this is all ok % $ | 5 | %comment, this is all ok % $ | ||
6 | \%no comments please | 6 | \%no comments please | ||
7 | \\%comment | 7 | \\%comment | ||
8 | <endfold id='3'>% END of region</endfold id='3'> | 8 | % END of region | ||
9 | 9 | | |||
10 | \newcommand{\nohighlighting} | 10 | \newcommand{\nohighlighting} | ||
11 | 11 | | |||
12 | \section{normal} | 12 | \section{normal} | ||
13 | 13 | | |||
14 | \ref{blue} | 14 | \ref{blue} | ||
15 | \pageref{blue} | 15 | \pageref{blue} | ||
16 | \cite{blue} | 16 | \cite{blue} | ||
17 | 17 | | |||
18 | <beginfold id='1'>\begin</beginfold id='1'>{environmentshavespecialcolors} | 18 | <beginfold id='1'>\begin</beginfold id='1'>{environmentshavespecialcolors} | ||
19 | normal | 19 | normal | ||
20 | \end{environmentshavespecialcolors<endfold id='1'>}</endfold id='1'> | 20 | <endfold id='1'>\end</endfold id='1'>{environmentshavespecialcolors<endfold id='1'>}</endfold id='1'> | ||
21 | 21 | | |||
22 | $equations are green, \commands somewhat darker$ | 22 | $equations are green, \commands somewhat darker$ | ||
23 | normal | 23 | normal | ||
24 | <beginfold id='2'>$$</beginfold id='2'>equations are green, \commands somewhat darker<endfold id='2'>$$</endfold id='2'> | 24 | $<beginfold id='2'>$</beginfold id='2'>equations are green, \commands somewhat darker<endfold id='2'>$$</endfold id='2'> | ||
25 | normal | 25 | normal | ||
26 | \( | 26 | \( | ||
27 | \frac{1}{2} | 27 | \frac{1}{2} | ||
28 | <beginfold id='1'>\begin</beginfold id='1'>{test} | 28 | <beginfold id='1'>\begin</beginfold id='1'>{test} | ||
29 | <endfold id='1'>\end</endfold id='1'>{test} | 29 | <endfold id='1'>\end</endfold id='1'>{test} | ||
30 | \) | 30 | \) | ||
31 | normal | 31 | normal | ||
32 | <beginfold id='2'>\[</beginfold id='2'> | 32 | <beginfold id='2'>\[</beginfold id='2'> | ||
33 | %comment | 33 | %comment | ||
34 | displaymath | 34 | displaymath | ||
35 | <endfold id='2'>\]</endfold id='2'> | 35 | <endfold id='2'>\]</endfold id='2'> | ||
36 | normal | 36 | normal | ||
37 | <beginfold id='1'>\begin</beginfold id='1'>{equation} | 37 | <beginfold id='1'>\begin</beginfold id='1'>{equation} | ||
38 | green\darkergreen | 38 | green\darkergreen | ||
39 | <beginfold id='1'>\begin</beginfold id='1'>{test} | 39 | <beginfold id='1'>\begin</beginfold id='1'>{test} | ||
40 | \test | 40 | \test | ||
41 | <endfold id='1'>\end</endfold id='1'>{test} | 41 | <endfold id='1'>\end</endfold id='1'>{test<endfold id='1'>}</endfold id='1'> | ||
42 | <endfold id='1'>\end</endfold id='1'>{equation<endfold id='1'>}</endfold id='1'> | 42 | <endfold id='1'>\end</endfold id='1'>{equation<endfold id='1'>}</endfold id='1'> | ||
43 | 43 | | |||
44 | <beginfold id='1'>\begin</beginfold id='1'>{equation*} | 44 | <beginfold id='1'>\begin</beginfold id='1'>{equation*} | ||
45 | green\darkergreen | 45 | green\darkergreen | ||
46 | %comment | 46 | %comment | ||
47 | <beginfold id='1'>\begin</beginfold id='1'>{test} | ||||
48 | \test | ||||
49 | <endfold id='1'>\end</endfold id='1'>{test<endfold id='1'>}</endfold id='1'> | ||||
47 | <beginfold id='1'>\begin</beginfold id='1'>{test} | 50 | \%no comment | ||
48 | \test | 51 | <endfold id='1'>\end</endfold id='1'>{equation*<endfold id='1'>}</endfold id='1'> | ||
49 | <endfold id='1'>\end</endfold id='1'>{test} | 52 | | ||
50 | \%no comment | 53 | \{ %this should be comment | ||
51 | <endfold id='1'>\end</endfold id='1'>{equation*<endfold id='1'>}</endfold id='1'> | 54 | | ||
52 | 55 | \verb%this shouldn't be%and this should be normal text | |||
53 | \{ %this should be comment | 56 | \verb!verbatim text! normal text | ||
54 | 57 | | |||
55 | \verb%this shouldn't be%and this should be normal text | 58 | text \texttt{more text} | ||
56 | 59 | | |||
57 | <beginfold id='1'>\begin</beginfold id='1'>{verbatim} | 60 | <beginfold id='1'>\begin</beginfold id='1'>{verbatim} | ||
58 | text inside a verbatim environment is also treated special $ %, | 61 | text inside a verbatim environment is also treated special $ %, | ||
62 | you can even put a \begin{verbatim} inside | ||||
63 | \end{verbatim<endfold id='1'>}</endfold id='1'> | ||||
64 | | ||||
65 | normal | ||||
66 | | ||||
67 | <beginfold id='1'>\begin</beginfold id='1'>{Verbatim} | ||||
68 | &@@#^%&^#$ | ||||
69 | \end{Verbatim<endfold id='1'>}</endfold id='1'> | ||||
59 | you can even put a \begin{verbatim} inside | 70 | | ||
60 | \end{verbatim<endfold id='1'>}</endfold id='1'> | 71 | <beginfold id='1'>\begin</beginfold id='1'>{Verbatim*} | ||
61 | 72 | @*&^#@*(^#(*@& | |||
62 | normal | 73 | \end{Verbatim*<endfold id='1'>}</endfold id='1'> | ||
63 | 74 | | |||
64 | <beginfold id='1'>\begin</beginfold id='1'>{Verbatim} | 75 | normal | ||
65 | &@@#^%&^#$ | 76 | | ||
66 | \end{Verbatim<endfold id='1'>}</endfold id='1'> | 77 | <beginfold id='1'>\begin</beginfold id='1'>{Verbatim} | ||
67 | 78 | \begin{verbatim} | |||
79 | This is a verbatim block. | ||||
80 | \end{verbatim} | ||||
81 | \end{Verbatim<endfold id='1'>}</endfold id='1'> | ||||
82 | | ||||
83 | normal | ||||
84 | | ||||
85 | % test alignat | ||||
86 | <beginfold id='1'>\begin</beginfold id='1'>{alignat}{2} | ||||
87 | A &= B &= C \\ | ||||
88 | A &= B &= C | ||||
89 | <endfold id='1'>\end</endfold id='1'>{alignat<endfold id='1'>}</endfold id='1'> | ||||
90 | normal text | ||||
91 | | ||||
92 | \iffalse | ||||
93 | \fill commented out text | ||||
94 | \fi | ||||
95 | | ||||
96 | % Math mode | ||||
97 | | ||||
98 | Depending on the value of $x$ the equation \( f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \) may diverge or converge. | ||||
99 | | ||||
100 | <beginfold id='2'>\[</beginfold id='2'> f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} <endfold id='2'>\]</endfold id='2'> | ||||
101 | | ||||
102 | <beginfold id='2'>\[</beginfold id='2'> | ||||
103 | S = \{ z \in \mathbb{C}\, |\, |z| < 1 \} \quad \textrm{and} \quad S_2=\partial{S} | ||||
104 | <endfold id='2'>\]</endfold id='2'> | ||||
105 | | ||||
106 | <beginfold id='2'>\[</beginfold id='2'> | ||||
107 | \frac{ | ||||
108 | <beginfold id='1'>\begin</beginfold id='1'>{array}[b]{r} | ||||
109 | \left( x_1 x_2 \right)\\ | ||||
110 | \times \left( x'_1 x'_2 \right) | ||||
111 | <endfold id='1'>\end</endfold id='1'>{array} | ||||
112 | }{ | ||||
113 | \left( y_1y_2y_3y_4 \right) | ||||
114 | } | ||||
115 | <endfold id='2'>\]</endfold id='2'> | ||||
116 | | ||||
117 | <beginfold id='1'>\begin</beginfold id='1'>{eqnarray*} | ||||
118 | <beginfold id='1'>\begin</beginfold id='1'>{eqnarray*} | ||||
119 | f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\ | ||||
120 | \textstyle f(x) = \textstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\ | ||||
121 | \scriptstyle f(x) = \scriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\ | ||||
122 | \scriptscriptstyle f(x) = \scriptscriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} | ||||
123 | <endfold id='1'>\end</endfold id='1'>{eqnarray*<endfold id='1'>}</endfold id='1'> | ||||
124 | <endfold id='1'>\end</endfold id='1'>{eqnarray*<endfold id='1'>}</endfold id='1'> | ||||
125 | | ||||
126 | <beginfold id='1'>\begin</beginfold id='1'>{xalignat}{3} | ||||
127 | i_{11} & =i_{23}\nonumber | ||||
128 | <endfold id='1'>\end</endfold id='1'>{xalignat<endfold id='1'>}</endfold id='1'> | ||||
129 | | ||||
130 | c | ||||
131 | <beginfold id='1'>\begin</beginfold id='1'>{equation} | ||||
132 | c | ||||
133 | <beginfold id='1'>\begin</beginfold id='1'>{aligned} | ||||
134 | a & b\\ | ||||
135 | c & d | ||||
136 | <endfold id='1'>\end</endfold id='1'>{aligned<endfold id='1'>}</endfold id='1'> | ||||
137 | c | ||||
138 | <endfold id='1'>\end</endfold id='1'>{equation<endfold id='1'>}</endfold id='1'> | ||||
139 | c | ||||
140 | | ||||
141 | $<beginfold id='2'>$</beginfold id='2'>E=mc^2<endfold id='2'>$$</endfold id='2'> | ||||
142 | | ||||
143 | <beginfold id='1'>\begin</beginfold id='1'>{equation} | ||||
144 | E=m | ||||
145 | <endfold id='1'>\end</endfold id='1'>{equation<endfold id='1'>}</endfold id='1'> | ||||
146 | | ||||
147 | <beginfold id='1'>\begin</beginfold id='1'>{equation | ||||
148 | x=3\textrm{plop} | ||||
149 | <endfold id='1'>\end</endfold id='1'>{equation<endfold id='1'>}</endfold id='1'> | ||||
150 | | ||||
151 | <beginfold id='2'>\[</beginfold id='2'> <beginfold id='1'>\begin</beginfold id='1'>{array}{llll} | ||||
152 | x^3 = (-x)^3 & \text{if $x > 0$}\\ | ||||
153 | x^3 = (-x)^3 & \text{if {$x > 0$}}\\ | ||||
154 | x^3 = (-x)^3 & \text{if {\color{green} $x > 0$}}\\ | ||||
155 | <endfold id='1'>\end</endfold id='1'>{array} <endfold id='2'>\]</endfold id='2'> | ||||
156 | | ||||
157 | \section*{Notes for My Paper} | ||||
158 | | ||||
159 | <beginfold id='1'>\begin</beginfold id='1'>{center} | ||||
160 | <beginfold id='1'>\begin</beginfold id='1'>{tabular}{ |c|c|c| } | ||||
161 | \hline | ||||
162 | cell1 & cell2 & cell3 \\ | ||||
163 | cell4 & cell5 & cell6 \\ | ||||
164 | cell7 & cell8 & cell9 \\ | ||||
165 | \hline | ||||
166 | \end{tabular<endfold id='1'>}</endfold id='1'> | ||||
167 | | ||||
168 | <beginfold id='1'>\begin</beginfold id='1'>{tabular*}{0.75\textwidth}{@{\extracolsep{\fill} } | c | c | c | r | } | ||||
169 | \hline | ||||
170 | label 1 & label 2 & label 3 & label 4 \\ | ||||
171 | \hline | ||||
172 | item 1 & item 2 & item 3 & item 4 \\ | ||||
173 | \hline | ||||
174 | \end{tabular*<endfold id='1'>}</endfold id='1'> | ||||
175 | | ||||
176 | <beginfold id='1'>\begin</beginfold id='1'>{tabular*}{0.75\textwidth}{ | c | c | c | r | } | ||||
177 | \hline | ||||
178 | label 1 & label 2 & label 3 & label 4 \\ | ||||
179 | \hline | ||||
180 | item 1 & item 2 & item 3 & item 4 \\ | ||||
181 | \hline | ||||
182 | \end{tabular*<endfold id='1'>}</endfold id='1'> | ||||
183 | <endfold id='1'>\end</endfold id='1'>{center<endfold id='1'>}</endfold id='1'> | ||||
184 | | ||||
185 | | ||||
186 | <beginfold id='1'>\begin</beginfold id='1'>{tabularx}{1\textwidth}{ |>{\setlength\hsize{1\hsize}\centering}X|>{\setlength\hsize{1\hsize}\raggedleft}X@{} >{\setlength\hsize{1\hsize}\raggedright}X|>{\setlength\hsize{1\hsize}\centering}X| } | ||||
187 | \hline | ||||
188 | Label 1 & \multicolumn{2}{>{\centering\setlength\hsize{2\hsize} }X|}{Label 2} & Label 3\tabularnewline | ||||
189 | \hline | ||||
190 | 123 & 123 & 456 & 123 \tabularnewline | ||||
191 | \hline | ||||
192 | 123 & 123 & 456 & 123 \tabularnewline | ||||
193 | \hline | ||||
194 | \end{tabularx<endfold id='1'>}</endfold id='1'> | ||||
195 | | ||||
196 | <beginfold id='1'>\begin</beginfold id='1'>{lstlisting} | ||||
197 | Write('Case insensitive '); | ||||
198 | Write('Pascal keywords.'); | ||||
199 | \end{lstlisting<endfold id='1'>}</endfold id='1'> | ||||
200 | | ||||
201 | <beginfold id='1'>\begin</beginfold id='1'>{lstlisting}%[frame=single] | ||||
202 | Write('Case insensitive '); | ||||
203 | Write('Pascal keywords.'); | ||||
204 | \end{lstlisting<endfold id='1'>}</endfold id='1'> | ||||
205 | | ||||
206 | <beginfold id='1'>\begin</beginfold id='1'>{lstlisting}[frame=single] | ||||
207 | Write('Case insensitive '); | ||||
208 | Write('Pascal keywords.'); | ||||
209 | \end{lstlisting<endfold id='1'>}</endfold id='1'> | ||||
210 | | ||||
211 | <beginfold id='1'>\begin</beginfold id='1'>{lstlisting}[frame=single] % blah blah | ||||
212 | Write('Case insensitive '); | ||||
213 | Write('Pascal keywords.'); | ||||
214 | \end{lstlisting<endfold id='1'>}</endfold id='1'> | ||||
215 | | ||||
216 | <beginfold id='1'>\begin</beginfold id='1'>{lstlisting} | ||||
217 | [frame=single] % blah blah | ||||
218 | Write('Case insensitive '); | ||||
219 | Write('Pascal keywords.'); | ||||
220 | \end{lstlisting<endfold id='1'>}</endfold id='1'> | ||||
221 | | ||||
222 | <beginfold id='1'>\begin</beginfold id='1'>{minted}{python} | ||||
223 | def foo<beginfold id='19'>(</beginfold id='19'>x<endfold id='19'>)</endfold id='19'>: | ||||
224 | return x | ||||
225 | <endfold id='1'>\end</endfold id='1'>{minted<endfold id='1'>}</endfold id='1'> | ||||
226 | | ||||
227 | <beginfold id='1'>\begin</beginfold id='1'>{minted} | ||||
228 | % blah blah | ||||
229 | {python} | ||||
230 | def foo<beginfold id='19'>(</beginfold id='19'>x<endfold id='19'>)</endfold id='19'>: | ||||
231 | return x | ||||
232 | <endfold id='1'>\end</endfold id='1'>{minted<endfold id='1'>}</endfold id='1'> | ||||
233 | | ||||
234 | <beginfold id='1'>\begin</beginfold id='1'>{minted}[frame=lines]{python} | ||||
235 | def foo<beginfold id='19'>(</beginfold id='19'>x<endfold id='19'>)</endfold id='19'>: | ||||
236 | return x | ||||
237 | <endfold id='1'>\end</endfold id='1'>{minted<endfold id='1'>}</endfold id='1'> | ||||
238 | | ||||
239 | <beginfold id='1'>\begin</beginfold id='1'>{minted} | ||||
240 | % plop | ||||
241 | [frame=lines, | ||||
242 | fontsize=\footnotesize | ||||
243 | ] | ||||
244 | % ok | ||||
68 | <beginfold id='1'>\begin</beginfold id='1'>{Verbatim*} | 245 | {python} | ||
69 | @*&^#@*(^#(*@& | 246 | def foo<beginfold id='19'>(</beginfold id='19'>x<endfold id='19'>)</endfold id='19'>: | ||
70 | \end{Verbatim*<endfold id='1'>}</endfold id='1'> | 247 | return x | ||
71 | 248 | <endfold id='1'>\end</endfold id='1'>{minted<endfold id='1'>}</endfold id='1'> | |||
72 | normal | 249 | | ||
73 | 250 | <beginfold id='1'>\begin</beginfold id='1'>{comment} | |||
74 | % test alignat | 251 | This is a comment block. | ||
75 | <beginfold id='1'>\begin</beginfold id='1'>{alignat}{2} | 252 | \end{comment<endfold id='1'>}</endfold id='1'> | ||
76 | A &= B &= C \\ | 253 | | ||
77 | A &= B &= C | 254 | \documentclass{article} | ||
78 | <endfold id='1'>\end</endfold id='1'>{alignat<endfold id='1'>}</endfold id='1'> | 255 | \usepackage{fancyvrb} | ||
79 | normal text | 256 | | ||
80 | 257 | \documentclass[12pt]{article} | |||
81 | \iffalse | 258 | <beginfold id='1'>\begin</beginfold id='1'>{document} | ||
82 | \fill commented out text | 259 | | ||
83 | \fi | 260 | Text that has a footnote\footnote{This $i_s$ the <beginfold id='2'>\[</beginfold id='2'>i_s<endfold id='2'>\]</endfold id='2'> $<beginfold id='2'>$</beginfold id='2'>x_i<endfold id='2'>$$</endfold id='2'> \(x_i\)footnote}\addtocounter{footnote}{-1}\addtocounter{footnote}{-1} looks like this. Later text referring to same footnote\footnotemark uses the other command. | ||
84 | 261 | | |||
85 | 262 | <endfold id='1'>\end</endfold id='1'>{document<endfold id='1'>}</endfold id='1'> |