Skip to content

Commit

Permalink
add LaTeX code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
b-kelly committed Nov 10, 2020
1 parent 662a0e3 commit 45af5ed
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions docs/product/components/code-blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,54 @@
</div>
</div>

{% header "h3", "LaTeX" %}
<div class="stacks-preview">
{% highlight html %}
<pre class="s-code-block language-csharp">
</pre>
{% endhighlight %}
<div class="stacks-preview--example">
{% highlight latex %}
% !TeX encoding = utf8
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsfonts}
\usepackage{xparse}
\usepackage{mathtools}

\newcommand\hi[1]{Hello #1!}

\ExplSyntaxOn
% Convert a roman number into an arabic one
\NewDocumentCommand \romantonum { m }
{ \int_from_roman:n { #1 } }
\ExplSyntaxOff

\begin{document}

\section{Highlight.js}
\hi{you}
This is \LaTeX\ syntax highlighted by \verb|highlight.js|.
You should look at section~\ref{sec:fermat} next.

Did you know that MDCLXI is \romantonum{MDCLXI}? % It's 1661.

\subsection{Fermat}\label{sec:fermat}
I have a wonderful proof that
\[
a^n + b^n \neq c^n
\]
for \(a, b, c, d, n \in \mathbb{Z}_+\) with \(n > 2\).
Sadly, it is too large to fit in this code snippet.

\end{document}
{% endhighlight %}
</div>
</div>

{% header "h3", "SQL" %}
<div class="stacks-preview">
{% highlight html %}
Expand Down

0 comments on commit 45af5ed

Please sign in to comment.