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

SVG extracted using svg-extract looks different from the original SVG #48

Open
amine-aboufirass opened this issue Mar 6, 2023 · 4 comments
Assignees
Labels

Comments

@amine-aboufirass
Copy link

Here's my SVG drawing:

enter image description here

I include it in my LaTeX document using the svg package as follows:

\documentclass{article}

\usepackage{svg}

\begin{document}
    \includesvg{idea.svg}
\end{document}

Which results in the following:

enter image description here

Then I use the svg-extract package to extract it out into a PDF including the rendered LaTeX math:

\documentclass{article}

\usepackage[extractformat=pdf]{svg-extract}

\begin{document}
    \includesvg[keepaspectratio]{idea.svg}
\end{document}

I run latexmk --shell-escape idea.tex and the resulting PDF is as follows:

enter image description here

It looks like the text has been moved to accomodate some smaller bounding box than that which the SVG originally intended.

How can I prevent this behavior and get back the SVG as it looked in the original PDF?

@mrpiggi
Copy link
Owner

mrpiggi commented Mar 6, 2023

Just for the sake of completeness, here is a cross-prost from https://tex.stackexchange.com/questions/678479

@mrpiggi
Copy link
Owner

mrpiggi commented Mar 6, 2023

As mentioned in the comments, for now latexmk --shell-escape -pdf idea.tex should work. Nevertheless, this would need some investigation at some point.

@mrpiggi mrpiggi added the bug label Mar 6, 2023
@mrpiggi mrpiggi self-assigned this Mar 6, 2023
@bedw8
Copy link

bedw8 commented Jan 16, 2024

As mentioned in the comments, for now latexmk --shell-escape -pdf idea.tex should work. Nevertheless, this would need some investigation at some point.

hi, i have the same problem, and that line also doesn't work for me.

I'm not sure, but i'm guessing svg-extract is importing the same preamble of the main document, while including a svg with svg only make it agnostic to the document preamble ???

The thing i'm seeing is, for instance, when i include a svg with pretex=\footnotesize, in the main document it looks well, but in the svg-extract version of it the text font size is normal. Also, I noticed that the text on the extracted version has double space between lines. And that is how i have formatted the text on my main document. But, in the included svg, the text does not have that huge space between lines.

@mrpiggi
Copy link
Owner

mrpiggi commented Jan 17, 2024

hi, i have the same problem, and that line also doesn't work for me.

This kind of error report doesn't work for me. What action should I take without any information. How should I be able to reproduce the issue without a running minimal example?

I'm not sure, but i'm guessing svg-extract is importing the same preamble of the main document, while including a svg with svg only make it agnostic to the document preamble ???

Well, instead of guessing, having a brief look into the package documentation would maybe be an approach.

In general, graphics extracted with package svg-extract should look the same as those included with package svg as long as you carefully do all your markup settings in the preamble.

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

No branches or pull requests

3 participants