Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbols gets messed up in Notebook #28

Open
buergi opened this issue Jun 1, 2021 · 2 comments
Open

Symbols gets messed up in Notebook #28

buergi opened this issue Jun 1, 2021 · 2 comments

Comments

@buergi
Copy link

buergi commented Jun 1, 2021

  • itikz version: 0.1.5
  • Python version: Python 3.8.10 (default, May 19 2021, 13:12:57) [MSC v.1916 64 bit (AMD64)]
  • Operating System: Win 10 20H2 19042.985
  • Jupyter Core: 6.4.0
  • Browser: Firefox 88.0.1 (64-Bit)

Description

In the first cell I'm trying to write D_p which works, in the second one I'm writing S_p and it writes D_p as well.
grafik

Same here, but even the numbers are messed up.
grafik

The generated SVG is correct, it seems the problem is that the browser seems to mix the content of the nodes when multiple SVGs are embedded in one notebook. I have now idea if this is possible, but it seems to be the case. Any ideas how to fix this?

What I Did

Here is the code again

%load_ext itikz

%%itikz --implicit-pic --temp-dir
\node at (0,0) {$D_p = 200 \mathrm{mm}$};
\node at (5,0) {$S_p = 200 \mathrm{mm}$};

%%itikz --implicit-pic --temp-dir
\node at (0,0) {$A_p = 500 \mathrm{mm}$};
\node at (7,0) {$B_p = 500 \mathrm{mm}$};
@spielhuus
Copy link

spielhuus commented Jul 7, 2021

The problem seems to be pdf2svg. it creates the same id's in all the pictures, but with embedded SVG images, they have to be unique over the whole page. dvisvgm seems to work. I have uninstalled pdf2svg and created a shell script that calls dvisvgm.

/usr/bin/pdf2svg

#!/bin/bash
dvisvgm --pdf --output=$2 $1

it would be great if pdf2svg would be replaced with dvisvgm in itikz.

@tombackstrom
Copy link

tombackstrom commented Aug 4, 2022

If you do not have the root credentials to access /usr/bin/ and if you're using anconda, then you can apply @spielhuus solution but put the script in your anaconda3/bin -folder instead.

In addition, on my system, dvisvgm outputs a status message, which gets displayed as an error message in the notebook. To reduce verbosity, change the script to

#!/bin/bash
dvisvgm --pdf --output=$2 -v0 $1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants