Skip to content
Snippets Groups Projects
Commit a84a8524 authored by Timon Idema's avatar Timon Idema
Browse files

Added latex macros to config and ex1.

parent 79c4725c
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
title: Open textbooks demonstration title: Open textbooks demonstration
author: Timon Idema author: Timon Idema
logo: tudelft.png logo: tudelft.png
description: Demonstration of what can be done with a Jupyter Book. This book is meant as a template to build on.
copyright: Delft University of Technology, CC BY-SA 4.0 copyright: Delft University of Technology, CC BY-SA 4.0
# Only build files in the ToC to avoid building README, etc. # Only build files in the ToC to avoid building README, etc.
...@@ -24,10 +25,29 @@ bibtex_bibfiles: ...@@ -24,10 +25,29 @@ bibtex_bibfiles:
- references.bib - references.bib
# Sphinx, for html formatting. Needs checking version. # Sphinx, for html formatting. Needs checking version.
# Mathjax config allows us to define tex macros. Note that we need to escape the \ in a latex math command with an extra \.
sphinx: sphinx:
config: config:
html_js_files: html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
mathjax3_config:
tex:
macros:
"kB" : "k_\\mathrm{B}"
# extra_extensions:
# - sphinx_proof
# - sphinx_exercise
# - sphinx_tojupyter
# Parse, for processing LaTeX-style math. See https://jupyterbook.org/en/stable/content/math.html#latex-style-math and https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-amsmath
parse:
myst_enable_extensions:
# don't forget to list any other extensions you want enabled,
# including those that are enabled by default!
# meaning that we have to explicitly include dollarmath!
- amsmath
- dollarmath
# Information about where the book exists on the web # Information about where the book exists on the web
repository: repository:
...@@ -35,7 +55,7 @@ repository: ...@@ -35,7 +55,7 @@ repository:
# path_to_book: docs # Optional path to your book, relative to the repository root # path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional) branch: master # Which branch of the repository should be used when creating links (optional)
# Add GitHub buttons to your book # Add GitHub / GitLab buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository # See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html: html:
use_issues_button: true use_issues_button: true
......
...@@ -106,6 +106,29 @@ mechanism, or multiple levels). ...@@ -106,6 +106,29 @@ mechanism, or multiple levels).
7. Awareness 7. Awareness
## Math, labels and macros
We defined a macro (in config) for Boltzmann's constant $\kB$. Also, see equation {eq}`Boltzmannconstant`.
$$
\kB.
$$ (Boltzmannconstant)
Unfortunately, labels don't work yet for amsmath environments, although they do get numbered:
\begin{equation}
S = \kB \log(\Omega).
\end{equation}
Let's try if we can do something else:
```{math}
:label: block
\begin{align}
a &= b \\
c &= d
\end{align}
```
Can we now refer to equations {eq}`block`?
(sec:Notes_Central_limit_theorem)= (sec:Notes_Central_limit_theorem)=
## Useful notes and equations ## Useful notes and equations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment