benweet / stackedit

In-browser Markdown editor
https://stackedit.io/
Apache License 2.0
21.78k stars 2.73k forks source link

Equations aren't rendered right after PDF export #1692

Open sayeg84 opened 3 years ago

sayeg84 commented 3 years ago

After exporting a document with the normal PDF export (based from an HTML template, NOT with Pandoc), some of the equations on my text don't render properly. The equations are OK in the viewer of the editor, and if I print the document as a file, they are also displayed correctly. Only exporting to PDF is wrong.

In the editor, the equation looks like:

Screenshot from 2020-12-02 11-26-07

After exporting:

Screenshot from 2020-12-02 11-26-18

¿Any idea if this is a bug or a problem with using the normal HTML template for exporting?

dmeburk commented 3 years ago

I have the same issue. :(

b4r commented 3 years ago

What is the markdown you're using for the equations please?

sayeg84 commented 3 years ago
## Tarea 05

#### Física Computacional. Grupo 8423.

#### Facultad de Ciencias. Universidad Nacional Autónoma de México

**Instrucciones:** debes **escoger cinco de los siguientes ejercicios** y resolverlos  dentro de un Notebook titulado `tarea05_apellidoPaterno_nombre.ipynb` . Entregar dicho Notebook mediante Google Classroom

La separación entre ejercicios debe de ser completamente clara. El uso de celdas de Markdown así como los comentarios del código se recomiendan ampliamente.

1. Uno de los problemas más importantes en la historia de la física es el **problema de tres cuerpos**, por su equivalencia con encontrar la trayectoria exacta del sistema Sol-Luna-Tierra. Supongamos que tenemos tres cuerpos en dos dimensiones, cuyas posiciones en coordenadas cartesianas y masas se denotan $\mathbf{r}_i(t) = (x_i(t),y_i(t))$, $m_i$ para $i=1,2,3$. Usando unidades naturales,la fuerza que experimenta el cuerpo $i$ es

$$
\begin{aligned}
F_i(\mathbf{r_i},\mathbf{r_j},\mathbf{r_k}) &= \frac{m_i m_j}{\Vert \mathbf{r}_j - \mathbf{r}_i\Vert^3} (\mathbf{r}_j - \mathbf{r}_i)  \\ 
&+ \frac{m_i m_k}{\Vert \mathbf{r}_k - \mathbf{r}_i\Vert^3} (\mathbf{r}_k - \mathbf{r}_i)
\end{aligned}
$$ 
b4r commented 3 years ago

Were there any modified settings in StackEdit or just default settings?

sayeg84 commented 3 years ago

Default settings. Using Styled HTML template:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{{files.0.name}}</title>
  <link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>

{{#if pdf}}
<body class="stackedit stackedit--pdf">
{{else}}
<body class="stackedit">
{{/if}}
  <div class="stackedit__html">{{{files.0.content.html}}}</div>
</body>

</html>
b4r commented 3 years ago

The reason I ask if settings are default is because I cannot get vanilla stackedit version v5.14.5 to render $$ data for the formulas. I guess I'm missing something - are you using a different version of stackedit?

I might be missing a package - would there be something else needed to render formulas?

dmeburk commented 3 years ago

I have the same problem as OP. I am using v5.14.5. I did not add any packages---this is StackEdit "off the shelf." When Export as PDF, the math typesets but does so incorrectly.

DaMatrix commented 2 years ago

I can confirm that I get the results as the OP when using print to PDF, but only when the editor is in dark mode. If I change the editor to light mode, KaTeX formulas look fine with print to PDF.