It seems that simple equations cannot be rendered in write.as: see my curve fitting draft. The same formula does work using conventional latex editors such as Overleaf.

Does anyone know how to solve this compatibility issue, or is write.as just not very good for formulas ?

Oh cool, glad you found a workaround! We definitely want to these fix issues with Markdown / MathJax parsing, and there’s actually an old WriteFreely issue for this in particular: #177.

I’ll add any other tricks/hacks other users will need to typeset latex.
A new hack was needed when using the align environment: \begin{align*} ... \end{align*}.
Using the “normal” latex syntax (with escaped underscores):

$$
\begin{align*}
y &\approx f\_\theta \circ g\_\phi (y) \\
x &\approx g\_\phi \circ f\_\theta (x) \\
\end{align*}
$$

Does not produce the expected aligned equations. Instead, one should use:

$$
\begin{align\*}
y &\approx f\_\theta \circ g\_\phi (y) \\\
x &\approx g\_\phi \circ f\_\theta (x) \\\
\end{align\*}
$$

This means two things: one should

escape the * in the begin & end, giving the syntax \begin{align\*}

escape the line jumps \\, giving the syntax \\\ at the end of each line

I think a good rule of thumb is: if your latex symbol has meaning in markdown (e.g. _ , *, \, etc), you should escape it in your latex code. This is because the markdown interpretation of the syntax takes precedence over the latex one.

Another issue: when typing the variable $r$ in mathmode, one sometimes writes parentheses () around r: \(r\) for function values. This will create a registered trademark symbol ® . To avoid this, put spaces $( r )$ around r.

A specific case when one might need to escape symbols is for set notation.
The set { x } is usually obtained using the syntax \{x\}, but for now we need to write \\{ x \\}.