Skip to content

Instantly share code, notes, and snippets.

@bollwyvl
Last active March 18, 2022 18:15
Show Gist options
  • Save bollwyvl/d7bf71ea6884b047cc95db95bf5a7e2d to your computer and use it in GitHub Desktop.
Save bollwyvl/d7bf71ea6884b047cc95db95bf5a7e2d to your computer and use it in GitHub Desktop.
a jupyter/latex demo environment
channels:
- conda-forge
- nodefaults
dependencies:
- antlr-python-runtime
- jupyterlab >=3.3.2
- jupyter-lsp-python-plugins
- jupyter-lsp-latex
- jupyterlab-link-share
- jupyterlab-lsp
- matplotlib-base
- scipy
- seaborn
- sympy >=1.10
{
"LabApp": {
"collaborative": true
},
"LatexConfig": {
"latex_command": "tectonic"
}
}
{
"@krassowski/jupyterlab-lsp:plugin": {
"language_servers": {
"texlab": {
"serverSettings": {
"latex.lint.onChange": true
}
}
}
}
}
if [ "$NB_USER" = "jovyan" ]; then
mkdir -p $NB_PYTHON_PREFIX/share/jupyter/lab/settings/
cp overrides.json $NB_PYTHON_PREFIX/share/jupyter/lab/settings/
fi
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\title{JupyterLab \LaTeX}
\date{}
\maketitle
\section{Introduction}
This is a sample document demonstrating the ability to live-edit
\LaTeX documents in JupyterLab.
\\
\\
Right-click on this document, and select "Show LaTeX Preview".
A new panel should open up on the right with the PDF that is generated
by this document. If there are any errors in the document, an
error panel should open below.
\\
\\
We can write equations:
\begin{equation}
\rho \left( \frac{\partial \mathbf{u}}{\partial t} + \mathbf{u} \cdot \nabla \mathbf{u} \right) =
-\nabla P + \eta \nabla^2 \mathbf{u} + \rho \mathbf{g}.
\end{equation}
\\
\\
And we can write tables:
\begin{center}
\begin{tabular}{ | l | c | r| }
\hline
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\hline
\end{tabular}
\end{center}
\subsection{We can add new subsections}
And we can include images, such as the Jupyter logo:
\begin{center}
\includegraphics[width=0.65\textwidth]{images/jupyter_logo.png}
\end{center}
\pagebreak
You can also use SyncTeX by typing ⌘(CMD)/CTRL+⇧(SHIFT)+X.
\end{document}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment