Comments (4)
If you use a Python raw string r-string
with mo.md
as in the example at this link, it will work https://marimo.app/l/is03zm.
Unfortunately, our "view as markdown" option is automatically making the string an f
-string, which breaks LaTeX. We need to fix this, thanks for bringing it to our attention. (cc @mscolnick)
marimo code:
import marimo
__generated_with = "0.6.24-dev2"
app = marimo.App()
@app.cell
def __():
import marimo as mo
mo.md(
r"""
$$
\begin{array}{lllll}
\text {IS : } & \hat{y}_{t}=\mathbb{E}_{t} \hat{y}_{t+1}-\frac{1}{\sigma}\left(i_{t}-\mathbb{E}_{t} \pi_{t+1}-r_{t}^{n}\right)+u_t\\
\text {Taylor rule : } & \ i_{t} = \pi_t + r^n_t+\phi_{\pi} \pi_{t}+\phi_{y} \hat{y}_{t} \\
\text {AD : } & \hat{y}_{t}= \hat{c}_{t} \\
\text {AS : } & \pi_{t} =\kappa \hat{y}_{t}+\beta \cdot \mathbb{E}_{t} \pi_{t+1} \\
\text {Real interest : } & r_{t}^{n} =\rho_r \cdot r_{t-1}^{n}+\varepsilon_{t}^{r} \quad , \quad \varepsilon_{t}^{r} \sim {\cal{N}}(0,1) \\
\text {Demand shock : } & u_{t} =\rho_u \cdot u_{t-1}+\varepsilon_{t}^{u} \quad , \quad \varepsilon_{t}^{u} \sim {\cal{N}}(0,1) \\
\end{array}
$$
"""
)
return mo,
@app.cell
def __(mo):
mo.md(
r"""
$$
\begin{align}
\hat{y}_t & =\mathbb{E}_t \hat{y}_{t+1}-\frac{1}{\sigma}\left(i_t-\mathbb{E}_t \pi_{t+1}-r_t^n\right)+u_t&& \tag{IS}\\
\ i_t & = \pi_t + r^n_t + \phi_\pi \pi_t+\phi_y \hat{y}_t &&\tag{Taylor Rule}\\
\hat{y}_t &=\hat{c}_t&&\tag{AD}\\
\pi_t &=\kappa \hat{y}_t+\beta \cdot \mathbb{E}_t \pi_{t+1}&&\tag{AS}\\
u_{t} &=\rho^u \cdot u_{t-1}+\varepsilon_{t}^{u} \quad , \quad \varepsilon_{t}^{u} \sim {\cal{N}}(0,1)&&\tag{Demand shock}\\
r_{t}^{n} &=\rho^r \cdot r_{t-1}^{n}+\varepsilon_{t}^{r} \quad , \quad \varepsilon_{t}^{r} \sim {\cal{N}}(0,1)&&\tag{Real Interest Rate}
\end{align}
$$
"""
)
return
@app.cell
def __(mo):
mo.md(rf"")
return
if __name__ == "__main__":
app.run()
from marimo.
@VivaldoMendes this will be fixed in the next release (0.7.0), which should be available in a day or two.
from marimo.
@akshayka, excellent news.
from marimo.
I have tested it in Marimo v0.7.0, and the LaTeX is already correctly rendered. There is still a minor issue that I am unsure whether it deserves further attention. In notebooks for teaching or exams, we regularly use equations and tags. Tags are usually justified on the right-hand side of the cell. As it stands now, the tags are centered on the right-hand side, see image below (in marimo):
The more commonly used way to justify tags is as follows (in Pluto or in a normal LaTeX editor):
The LaTeX code to produce the image above:
$$\begin{align}
\hat{y}_t & =\mathbb{E}_t \hat{y}_{t+1}-\frac{1}{\sigma}\left(i_t-\mathbb{E}_t \pi_{t+1}-r_t^n\right)&& \tag{IS}\\
\ i_t & = \pi_t + r^n_t+\phi_\pi \pi_t+\phi_y \hat{y}_t + x_t &&\tag{Taylor Rule}\\
\hat{y}_t &=\hat{c}_t&&\tag{AD}\\
\pi_t &=\kappa \hat{y}_t+\beta \cdot \mathbb{E}_t \pi_{t+1}&&\tag{AS}\\
r^n_t &=\rho_r \cdot r^n_{t-1}+\varepsilon_{t}^{r} \quad , \quad \varepsilon_{t}^{r} \sim {\cal{N}}(0,1)&&\tag{Natural real interest rate} \\
x_{t} &=\rho_x \cdot x_{t-1}+\varepsilon_{t}^{x} \quad , \quad \varepsilon_{t}^{z} \sim {\cal{N}}(0,1)&&\tag{Decision making shocks}
\end{align}$$
Thanks.
from marimo.
Related Issues (20)
- Broken links at https://docs.marimo.io/guides HOT 4
- LaTeX displayed as raw text instead of math formulae in plotly HOT 7
- Inline math not displaying correctly in slide mode HOT 1
- Content created through JS bypasses user defined CSS HOT 4
- Configuration option to display dataframes using plain formatter
- Create a Copy Notebook Option
- Interruptible RPCs
- use external editor (e.g. neovim) for writing code, hot-reload it in the marimo editor HOT 2
- docstring popup for functions when in brackets HOT 3
- Some Firefox keyboard shortcuts are captured, while some not HOT 4
- Headings with the same name are highlighted multiple time in the table of contents
- showing a polars dataframe with array column is slow HOT 2
- mo.mpl.interactive() leaves blank figures if you're not looking HOT 3
- lazy cells (re-work of disabled cells) HOT 3
- Show Python results in Python notation HOT 2
- ipyaladin viewer style sheet issue in marimo notebooks
- "no module named pandas" when plotting Polars DataFrame with Altair HOT 2
- Assertion errors when adding a custom logging handler
- ability to disable `import *` error
- support for spyder-like view of dataframes and arrays HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marimo.