Cheatsheet
Nikola
Jupyter line/cell magic commands
https://metakernel.readthedocs.io/en/latest/source/README.html
Conda
Git
pdf2htmlEX
pdf2htmlEX --zoom 1.3 test.pdf
pdf2htmlEX --embed cfijo --dest-dir out test.pdf
Markdown
https://www.markdownguide.org/basic-syntax/
md + LaTex
Inline syntax $e^{ix} = \cos x + i\sin x$
outputs $e^{ix} = cos x + isin x$
Complex formulas.
\begin{cases} \begin{aligned} \hat{x}_{k+1|k+1} & = \hat{x}_{k+1|k} + \gamma_{k+1} K_{k+1} \left( y_{k+1} - C \hat{x}_{k+1|k} \right) \\ e_{k+1|k+1} & = \left(I-\gamma_{k+1} K_{k+1} C \right) e_{k+1|k} -\gamma_{k+1} K_{k+1} \nu_{k+1} \\ P_{k+1|k+1} & = P_{k+1|k} - \gamma_{k+1} K_{k+1}C~P_{k+1|k} \\ K_{k+1} & = P_{k+1|k} C^\intercal (C P_{k+1|k} C^\intercal+R_z)^{-1} \end{aligned} \end{cases}
I recommend to use <div class="math">...</div> if you copy the code directly from LaTex. It's useful for \text{...}
, \align{...}
, and other commands which are not compiled correctly, even if you use $$...$$
. Also, works good with \label{eq:equation1}
and \eqref{eq:equation1}
, without the need to use tag{eq1}
.
md + referencing equations
Although \label{eq:equation1}
and \eqref{eq:equation1}
works good with <div class="math">...</div>, the alternative is to use tags in Jupyter Notebook.
md + Prism import
md + Embedded pdf
<object data="https://drive.google.com/viewerng/viewer?embedded=true&url=https://raw.githubusercontent.com/<user_name>/<repository_name>/master/<file_name>.pdf" width="100%" height="1200px"> <p>It appears you don't have a PDF plugin for this browser or JavaScript is disabled. You can <a href="https://drive.google.com/viewerng/viewer?embedded=true&url=https://raw.githubusercontent.com/<user_name/<repository_name>/master/<file_name>.pdf">download the PDF.</a></p> </object>
reStructuredText
https://getnikola.com/quickstart.html
rST + LaTex
Inline syntax :math:`e^{ix} = \cos x + i\sin x`
outputs \(e^{ix} = \cos x + i\sin x\)
.. math:: \begin{cases} \begin{aligned} \hat{x}_{k+1|k+1} & = \hat{x}_{k+1|k} + \gamma_{k+1} K_{k+1} \left( y_{k+1} - C \hat{x}_{k+1|k} \right) \\ e_{k+1|k+1} & = \left(I-\gamma_{k+1} K_{k+1} C \right) e_{k+1|k} -\gamma_{k+1} K_{k+1} \nu_{k+1} \\ P_{k+1|k+1} & = P_{k+1|k} - \gamma_{k+1} K_{k+1}C~P_{k+1|k} \\ K_{k+1} & = P_{k+1|k} C^\intercal (C P_{k+1|k} C^\intercal+R_z)^{-1} \end{aligned} \end{cases}
rST + Code highlighting
.. code-block:: octave for k = 1:nk+1 % Constrained MPC control law (RH-FH) LQ-MPC at every step k if mode == 'reg' [Ustar,fval,flag] = quadprog(H,L*x,Pc,qc+Sc*x); elseif mode == 'trk' [NUstar,fval,flag] = quadprog(H,L*epsilon(:,k),Pc_ssto,qc_ssto+Sc_ssto*epsilon(:,k)); end % check feasibility if flag < 1 disp(['Optimization is infeasible at k = ',num2str(k)]); break; end end
rST + Prism import
rST + Embedded pdf
.. raw:: html <object data="https://drive.google.com/viewerng/viewer?embedded=true&url=https://raw.githubusercontent.com/<user_name/<repository_name>/master/<file_name>.pdf" width="100%" height="800px"> <p>It appears you don't have a PDF plugin for this browser or JavaScript is disabled. You can <a href="https://drive.google.com/viewerng/viewer?embedded=true&url=https://raw.githubusercontent.com/<user_name/<repository_name>/master/<file_name>.pdf">download the PDF.</a></p> </object>