\usepackage{svg} does not work on own instance #42

Open
opened 2025-03-11 22:58:40 +01:00 by Benjamin_Loison · 26 comments

LaTeX Error: File `svg.sty' not found.

on https://overleaf.lemnoslife.com.

Related to #30 and #5.

Menu > Settings > Compiler does not seem to help as far as I tested with LaTeX in addition to default pdfLaTeX.

I guess that need to use another Docker image or modify current one.

+2

> LaTeX Error: File `svg.sty' not found. on https://overleaf.lemnoslife.com. Related to #30 and #5. *Menu* > *Settings* > *Compiler* does not seem to help as far as I tested with *LaTeX* in addition to default *pdfLaTeX*. I guess that need to use another Docker image or modify current one. +2
Author
Owner

https://plmlatex.math.cnrs.fr wants directly svg-inkscape/ content it seems, maybe there is a $LaTeX option when \usepackage or \includesvg if I remember correctly.

https://plmlatex.math.cnrs.fr wants directly `svg-inkscape/` content it seems, maybe there is a $LaTeX option when `\usepackage` or `\includesvg` if I remember correctly.
Author
Owner

DuckDuckGo search svg-inkscape includesvg LaTeX.

DuckDuckGo search *svg-inkscape includesvg LaTeX*.
Author
Owner

--shell-escape

Source: the Tex Stack Exchange answer 74693

`--shell-escape` Source: [the Tex Stack Exchange answer 74693](https://tex.stackexchange.com/a/74693)
Author
Owner

It works out of the box on https://www.overleaf.com.

It works out of the box on https://www.overleaf.com.
Author
Owner
https://fr.wikipedia.org/wiki/Fichier:Logo_de_la_présidence_de_la_République_(2018).svg
Author
Owner

Screenshot from 2025-03-11 23-13-41.png

![Screenshot from 2025-03-11 23-13-41.png](/attachments/5296dfb8-dd4f-42a7-b8d5-c58b13f00612)
Author
Owner
Tracked at:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdAIc1f5PS0BVni1LbHzNZP5C0dOoYrZfZPdPGt7b4p9A4w
DyUdBVll0b7Wlh/uLxGMibjgtwAG66soTVM3Lh7q2ZWg91BJTlVbnqRnKpL/j3CZ
0oUBweHF8MxAhCNBK82zAvFL+nA3cZkPDuf9FpZfENezGAcyLULOrQ+YuSIKArQ9
4IKq+4mhcjf1VE3AxfM2LNsuxKeG8w2e5bdAFrkGXoHk1XiIMWT8M9jtujbsJayJ
G70mzgC6hmkVIBAJK5XZRk60D+rEfm+5bm+Rbg3CQRYN4aJgsny/
=jpUk
-----END PGP MESSAGE-----
<details> <summary>Tracked at:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdAIc1f5PS0BVni1LbHzNZP5C0dOoYrZfZPdPGt7b4p9A4w DyUdBVll0b7Wlh/uLxGMibjgtwAG66soTVM3Lh7q2ZWg91BJTlVbnqRnKpL/j3CZ 0oUBweHF8MxAhCNBK82zAvFL+nA3cZkPDuf9FpZfENezGAcyLULOrQ+YuSIKArQ9 4IKq+4mhcjf1VE3AxfM2LNsuxKeG8w2e5bdAFrkGXoHk1XiIMWT8M9jtujbsJayJ G70mzgC6hmkVIBAJK5XZRk60D+rEfm+5bm+Rbg3CQRYN4aJgsny/ =jpUk -----END PGP MESSAGE----- ``` </details>
Author
Owner

Screenshot from 2025-03-12 00-32-59.png

inkscapelatex=false (source: the Tex Stack Exchange answer 437498) does not seem helpful here but helps locally with other .svgs to not have distorted text once included in \LaTeX.

![Screenshot from 2025-03-12 00-32-59.png](/attachments/e3162728-7b02-4080-bdab-1394a0d248c6) `inkscapelatex=false` (source: [the Tex Stack Exchange answer 437498](https://tex.stackexchange.com/a/437498)) does not seem helpful here but helps locally with other `.svg`s to not have distorted text once included in $\LaTeX$.
Author
Owner
Related to [Benjamin-Loison/latex2e/issues/24](https://github.com/Benjamin-Loison/latex2e/issues/24).
Author
Owner

Maybe PLMLaTeX SVG never worked.

Maybe PLMLaTeX SVG never worked.
Author
Owner

For CENSORED.svg:

ls CENSORED_svg-*
Output:
CENSORED_svg-raw.pdf
CENSORED_svg-tex.pdf
CENSORED_svg-tex.pdf_tex

are all of these actually necessary?

Being able to generate the needed one without having to compile a .tex would help.

Note that may have to consider a .svg with text.

For `CENSORED.svg`: ```bash ls CENSORED_svg-* ``` <details> <summary>Output:</summary> ``` CENSORED_svg-raw.pdf CENSORED_svg-tex.pdf CENSORED_svg-tex.pdf_tex ``` </details> are all of these actually necessary? Being able to generate the needed one without having to compile a `.tex` would help. Note that may have to consider a `.svg` with text.
Author
Owner

https://plmlatex.math.cnrs.fr complains about missing CENSORED_svg-raw.pdf. So let us provide it as it is not biased it seems that way.

https://plmlatex.math.cnrs.fr complains about missing `CENSORED_svg-raw.pdf`. So let us provide it as it is not biased it seems that way.
Author
Owner

For another .svg I only have _svg-raw.pdf generated and it works fine on https://plmlatex.math.cnrs.fr and I can select the figure text.

For another `.svg` I only have `_svg-raw.pdf` generated and it works fine on https://plmlatex.math.cnrs.fr and I can select the figure text.
Author
Owner

DuckDuckGo search Linux SVG to PDF.

Should ensure that can still select the PDF text. See #issuecomment-3696.

DuckDuckGo search *Linux SVG to PDF*. Should ensure that can still select the PDF text. See [#issuecomment-3696](#issuecomment-3696).
Author
Owner
rsvg-convert -f pdf -o CENSORED.pdf CENSORED.svg
Output:
Command 'rsvg-convert' not found, but can be installed with:
sudo apt install librsvg2-bin

Source: the Super User answer 381128

on my Debian 12 GNOME laptop.

```bash rsvg-convert -f pdf -o CENSORED.pdf CENSORED.svg ``` <details> <summary>Output:</summary> ``` Command 'rsvg-convert' not found, but can be installed with: sudo apt install librsvg2-bin ``` </details> Source: [the Super User answer 381128](https://superuser.com/a/381128) on my Debian 12 GNOME laptop.
Author
Owner
sudo apt install -y librsvg2-bin
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  librsvg2-bin
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 1,584 kB of archives.
After this operation, 5,758 kB of additional disk space will be used.
Get:1 http://ftp.fr.debian.org/debian bookworm/main amd64 librsvg2-bin amd64 2.54.7+dfsg-1~deb12u1 [1,584 kB]
Fetched 1,584 kB in 0s (3,240 kB/s)    
cannot stat initial working directory for /home/benjamin_loison/Desktop/bens_folder/thesis/ssd/prnu_extraction: Permission denied at /usr/sbin/dpkg-preconfigure line 73.
cannot stat initial working directory for /home/benjamin_loison/Desktop/bens_folder/thesis/ssd/prnu_extraction: Permission denied at /usr/sbin/dpkg-preconfigure line 159.
Selecting previously unselected package librsvg2-bin.
(Reading database ... 456372 files and directories currently installed.)
Preparing to unpack .../librsvg2-bin_2.54.7+dfsg-1~deb12u1_amd64.deb ...
Unpacking librsvg2-bin (2.54.7+dfsg-1~deb12u1) ...
Setting up librsvg2-bin (2.54.7+dfsg-1~deb12u1) ...
Processing triggers for man-db (2.11.2-2) ...
Scanning processes...                                                           
Scanning processor microcode...                                                 
Scanning linux images...                                                        

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

Text is still selectable, if pay attention to Benjamin_Loison/matplotlib/issues/27.

rsvg-convert -f pdf -o CENSORED.pdf CENSORED.svg

does not return anything.

svg-inkscape/ and above method results in visually identical PDFs.

Related to Benjamin_Loison/pdf/issues/13.

```bash sudo apt install -y librsvg2-bin ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: librsvg2-bin 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 1,584 kB of archives. After this operation, 5,758 kB of additional disk space will be used. Get:1 http://ftp.fr.debian.org/debian bookworm/main amd64 librsvg2-bin amd64 2.54.7+dfsg-1~deb12u1 [1,584 kB] Fetched 1,584 kB in 0s (3,240 kB/s) cannot stat initial working directory for /home/benjamin_loison/Desktop/bens_folder/thesis/ssd/prnu_extraction: Permission denied at /usr/sbin/dpkg-preconfigure line 73. cannot stat initial working directory for /home/benjamin_loison/Desktop/bens_folder/thesis/ssd/prnu_extraction: Permission denied at /usr/sbin/dpkg-preconfigure line 159. Selecting previously unselected package librsvg2-bin. (Reading database ... 456372 files and directories currently installed.) Preparing to unpack .../librsvg2-bin_2.54.7+dfsg-1~deb12u1_amd64.deb ... Unpacking librsvg2-bin (2.54.7+dfsg-1~deb12u1) ... Setting up librsvg2-bin (2.54.7+dfsg-1~deb12u1) ... Processing triggers for man-db (2.11.2-2) ... Scanning processes... Scanning processor microcode... Scanning linux images... Running kernel seems to be up-to-date. The processor microcode seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host. ``` </details> Text is still selectable, if pay attention to [Benjamin_Loison/matplotlib/issues/27](https://codeberg.org/Benjamin_Loison/matplotlib/issues/27). ```bash rsvg-convert -f pdf -o CENSORED.pdf CENSORED.svg ``` does not return anything. `svg-inkscape/` and above method results in visually identical PDFs. Related to [Benjamin_Loison/pdf/issues/13](https://codeberg.org/Benjamin_Loison/pdf/issues/13).
Author
Owner
Related to [Benjamin_Loison/matplotlib/issues/33](https://codeberg.org/Benjamin_Loison/matplotlib/issues/33).
Author
Owner
The person:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdAHUUGTO4JEMWaXyP2tfyKuHEWH4cA8gsodRpqjXyvUh4w
r7sciquaf/jrSPR9Q4YUaDTJGia6XyCJa4vxIIQVny4kodHQEN2OYx6p8ucPjP/I
1EoBCQIQsMQJRvVYi1h3uNo8Rc31qnFRf3OpwUwGuh3pAntpKP41JTBQeuzzBrMl
XB5cptls6pKWOPY8jk0Vf+HpdeKoCCI8t1QyQw==
=xlLy
-----END PGP MESSAGE-----

also faces this issue for https://plmlatex.math.cnrs.fr.

<details> <summary>The person:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdAHUUGTO4JEMWaXyP2tfyKuHEWH4cA8gsodRpqjXyvUh4w r7sciquaf/jrSPR9Q4YUaDTJGia6XyCJa4vxIIQVny4kodHQEN2OYx6p8ucPjP/I 1EoBCQIQsMQJRvVYi1h3uNo8Rc31qnFRf3OpwUwGuh3pAntpKP41JTBQeuzzBrMl XB5cptls6pKWOPY8jk0Vf+HpdeKoCCI8t1QyQw== =xlLy -----END PGP MESSAGE----- ``` </details> also faces this issue for https://plmlatex.math.cnrs.fr.
Author
Owner
rsvg-convert -f pdf -o CENSORED{_svg-raw.pdf,.svg}

does not return anything and works as wanted.

```bash rsvg-convert -f pdf -o CENSORED{_svg-raw.pdf,.svg} ``` does not return anything and works as wanted.
Author
Owner

Matplotlib PDF export is also text selectable, but may be less clear to edit with Inkscape for instance.

Matplotlib PDF export is also text selectable, but may be less clear to edit with Inkscape for instance.
Author
Owner

image.png

suggests such complexity.

![image.png](/attachments/1e9296c7-c496-401a-bdd5-362431769a78) suggests such complexity.
157 KiB
Author
Owner
Related to [Benjamin_Loison/inkscape/issues/9](https://gitlab.com/Benjamin_Loison/inkscape/-/issues/9).
Author
Owner

Inkscape (despite PDF Import Settings) PDF seems to break axis label, as well as rsvg-convert (and convert)...

Related to Benjamin_Loison/xviewer/issues/13 and Benjamin_Loison/inkscape/issues/12.

Inkscape (despite *PDF Import Settings*) PDF seems to break axis label, as well as `rsvg-convert` (and `convert`)... Related to [Benjamin_Loison/xviewer/issues/13](https://gitea.lemnoslife.com/Benjamin_Loison/xviewer/issues/13) and [Benjamin_Loison/inkscape/issues/12](https://gitlab.com/Benjamin_Loison/inkscape/-/issues/12).
Author
Owner

Note that a screenshot does not help much as we would prefer a .pdf that is not rasterized.

Note that a screenshot does not help much as we would prefer a `.pdf` that is not rasterized.
Author
Owner

inkscape t.svg -o t.pdf does not help, source: the Super User answer 506696.

`inkscape t.svg -o t.pdf` does not help, source: [the Super User answer 506696](https://superuser.com/a/506696).
Author
Owner

The Super User answer 855167:

sudo apt install -y cairosvg
Output:
Installing:                     
  cairosvg

Installing dependencies:
  python3-cairocffi  python3-cffi        python3-pycparser
  python3-cairosvg   python3-cssselect2  python3-xcffib

Suggested packages:
  python-cairocffi-doc  python-cssselect2-doc

Summary:
  Upgrading: 0, Installing: 7, Removing: 0, Not Upgrading: 0
  Download size: 349 kB
  Space needed: 2,503 kB / 15.6 GB available

Get:1 http://deb.debian.org/debian trixie/main amd64 python3-pycparser all 2.22-2 [78.0 kB]
Get:2 http://deb.debian.org/debian trixie/main amd64 python3-cffi all 1.17.1-3 [89.5 kB]
Get:3 http://deb.debian.org/debian trixie/main amd64 python3-xcffib all 1.5.0-1 [63.9 kB]
Get:4 http://deb.debian.org/debian trixie/main amd64 python3-cairocffi all 1.7.1-3 [60.7 kB]
Get:5 http://deb.debian.org/debian trixie/main amd64 python3-cssselect2 all 0.7.0-3 [16.3 kB]
Get:6 http://deb.debian.org/debian trixie/main amd64 python3-cairosvg all 2.7.1-2 [35.8 kB]
Get:7 http://deb.debian.org/debian trixie/main amd64 cairosvg all 2.7.1-2 [4,928 B]
Fetched 349 kB in 0s (2,397 kB/s)          
Selecting previously unselected package python3-pycparser.
(Reading database ... 631534 files and directories currently installed.)
Preparing to unpack .../0-python3-pycparser_2.22-2_all.deb ...
Unpacking python3-pycparser (2.22-2) ...
Selecting previously unselected package python3-cffi.
Preparing to unpack .../1-python3-cffi_1.17.1-3_all.deb ...
Unpacking python3-cffi (1.17.1-3) ...
Selecting previously unselected package python3-xcffib.
Preparing to unpack .../2-python3-xcffib_1.5.0-1_all.deb ...
Unpacking python3-xcffib (1.5.0-1) ...
Selecting previously unselected package python3-cairocffi.
Preparing to unpack .../3-python3-cairocffi_1.7.1-3_all.deb ...
Unpacking python3-cairocffi (1.7.1-3) ...
Selecting previously unselected package python3-cssselect2.
Preparing to unpack .../4-python3-cssselect2_0.7.0-3_all.deb ...
Unpacking python3-cssselect2 (0.7.0-3) ...
Selecting previously unselected package python3-cairosvg.
Preparing to unpack .../5-python3-cairosvg_2.7.1-2_all.deb ...
Unpacking python3-cairosvg (2.7.1-2) ...
Selecting previously unselected package cairosvg.
Preparing to unpack .../6-cairosvg_2.7.1-2_all.deb ...
Unpacking cairosvg (2.7.1-2) ...
Setting up python3-pycparser (2.22-2) ...
Setting up python3-cssselect2 (0.7.0-3) ...
Setting up python3-cffi (1.17.1-3) ...
Setting up python3-xcffib (1.5.0-1) ...
Setting up python3-cairocffi (1.7.1-3) ...
Setting up python3-cairosvg (2.7.1-2) ...
Setting up cairosvg (2.7.1-2) ...
Processing triggers for man-db (2.13.1-1) ...
Scanning processes...                                                                                                                      
Scanning candidates...                                                                                                                     
Scanning processor microcode...                                                                                                            
Scanning linux images...                                                                                                                   

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

User sessions running outdated binaries:
 benjamin_loison @ user manager: thunderbird[72017]
 benjamin_loison @ user service: org.gnome.Shell@wayland.service[69519]

No VM guests are running outdated hypervisor (qemu) binaries on this host.
cairosvg Figure_1.svg -o out.pdf

does not return anything and solved Firefox PDF rendering (SVG was fine, but not PDF until now) and PLMLaTeX Overleaf as well.

[The Super User answer 855167](https://superuser.com/a/855167): ``` sudo apt install -y cairosvg ``` <details> <summary>Output:</summary> ``` Installing: cairosvg Installing dependencies: python3-cairocffi python3-cffi python3-pycparser python3-cairosvg python3-cssselect2 python3-xcffib Suggested packages: python-cairocffi-doc python-cssselect2-doc Summary: Upgrading: 0, Installing: 7, Removing: 0, Not Upgrading: 0 Download size: 349 kB Space needed: 2,503 kB / 15.6 GB available Get:1 http://deb.debian.org/debian trixie/main amd64 python3-pycparser all 2.22-2 [78.0 kB] Get:2 http://deb.debian.org/debian trixie/main amd64 python3-cffi all 1.17.1-3 [89.5 kB] Get:3 http://deb.debian.org/debian trixie/main amd64 python3-xcffib all 1.5.0-1 [63.9 kB] Get:4 http://deb.debian.org/debian trixie/main amd64 python3-cairocffi all 1.7.1-3 [60.7 kB] Get:5 http://deb.debian.org/debian trixie/main amd64 python3-cssselect2 all 0.7.0-3 [16.3 kB] Get:6 http://deb.debian.org/debian trixie/main amd64 python3-cairosvg all 2.7.1-2 [35.8 kB] Get:7 http://deb.debian.org/debian trixie/main amd64 cairosvg all 2.7.1-2 [4,928 B] Fetched 349 kB in 0s (2,397 kB/s) Selecting previously unselected package python3-pycparser. (Reading database ... 631534 files and directories currently installed.) Preparing to unpack .../0-python3-pycparser_2.22-2_all.deb ... Unpacking python3-pycparser (2.22-2) ... Selecting previously unselected package python3-cffi. Preparing to unpack .../1-python3-cffi_1.17.1-3_all.deb ... Unpacking python3-cffi (1.17.1-3) ... Selecting previously unselected package python3-xcffib. Preparing to unpack .../2-python3-xcffib_1.5.0-1_all.deb ... Unpacking python3-xcffib (1.5.0-1) ... Selecting previously unselected package python3-cairocffi. Preparing to unpack .../3-python3-cairocffi_1.7.1-3_all.deb ... Unpacking python3-cairocffi (1.7.1-3) ... Selecting previously unselected package python3-cssselect2. Preparing to unpack .../4-python3-cssselect2_0.7.0-3_all.deb ... Unpacking python3-cssselect2 (0.7.0-3) ... Selecting previously unselected package python3-cairosvg. Preparing to unpack .../5-python3-cairosvg_2.7.1-2_all.deb ... Unpacking python3-cairosvg (2.7.1-2) ... Selecting previously unselected package cairosvg. Preparing to unpack .../6-cairosvg_2.7.1-2_all.deb ... Unpacking cairosvg (2.7.1-2) ... Setting up python3-pycparser (2.22-2) ... Setting up python3-cssselect2 (0.7.0-3) ... Setting up python3-cffi (1.17.1-3) ... Setting up python3-xcffib (1.5.0-1) ... Setting up python3-cairocffi (1.7.1-3) ... Setting up python3-cairosvg (2.7.1-2) ... Setting up cairosvg (2.7.1-2) ... Processing triggers for man-db (2.13.1-1) ... Scanning processes... Scanning candidates... Scanning processor microcode... Scanning linux images... Running kernel seems to be up-to-date. The processor microcode seems to be up-to-date. No services need to be restarted. No containers need to be restarted. User sessions running outdated binaries: benjamin_loison @ user manager: thunderbird[72017] benjamin_loison @ user service: org.gnome.Shell@wayland.service[69519] No VM guests are running outdated hypervisor (qemu) binaries on this host. ``` </details> ``` cairosvg Figure_1.svg -o out.pdf ``` does not return anything and solved Firefox PDF rendering (SVG was fine, but not PDF until now) and PLMLaTeX Overleaf as well.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/overleaf#42