Skip to content

Commit 4f9e1e1

Browse files
committed
add LaTeX code sample
1 parent d2b4d43 commit 4f9e1e1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/product/components/code-blocks.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,54 @@
350350
</div>
351351
</div>
352352

353+
{% header "h3", "LaTeX" %}
354+
<div class="stacks-preview">
355+
{% highlight html %}
356+
<pre class="s-code-block language-csharp">
357+
358+
</pre>
359+
{% endhighlight %}
360+
<div class="stacks-preview--example">
361+
{% highlight latex %}
362+
% !TeX encoding = utf8
363+
\documentclass{article}
364+
365+
\usepackage[T1]{fontenc}
366+
\usepackage{lmodern}
367+
\usepackage{amsfonts}
368+
\usepackage{xparse}
369+
\usepackage{mathtools}
370+
371+
\newcommand\hi[1]{Hello #1!}
372+
373+
\ExplSyntaxOn
374+
% Convert a roman number into an arabic one
375+
\NewDocumentCommand \romantonum { m }
376+
{ \int_from_roman:n { #1 } }
377+
\ExplSyntaxOff
378+
379+
\begin{document}
380+
381+
\section{Highlight.js}
382+
\hi{you}
383+
This is \LaTeX\ syntax highlighted by \verb|highlight.js|.
384+
You should look at section~\ref{sec:fermat} next.
385+
386+
Did you know that MDCLXI is \romantonum{MDCLXI}? % It's 1661.
387+
388+
\subsection{Fermat}\label{sec:fermat}
389+
I have a wonderful proof that
390+
\[
391+
a^n + b^n \neq c^n
392+
\]
393+
for \(a, b, c, d, n \in \mathbb{Z}_+\) with \(n > 2\).
394+
Sadly, it is too large to fit in this code snippet.
395+
396+
\end{document}
397+
{% endhighlight %}
398+
</div>
399+
</div>
400+
353401
{% header "h3", "SQL" %}
354402
<div class="stacks-preview">
355403
{% highlight html %}

0 commit comments

Comments
 (0)