-
Notifications
You must be signed in to change notification settings - Fork 12
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
Text scaling issues #10
Comments
If I get you right you are trying to extract a large picture, where the text actually is in the right size but the resulting image has to be scaled down for inclusion in the document, right? Well, currently not an easy task but could be done with something like \documentclass{scrartcl}
\ifpdftex{
\usepackage[T1]{fontenc}
}{
\usepackage{fontspec}
}
\usepackage{svg}
\usepackage{svg-extract}
\begin{document}
\section*{This is a test}
\begin{figure}
\centering
\includesvg[%
exclude,
extractpath=basedir,extractname=filename,%
pretex=\Huge,
extractwidth=50cm
]{svg-example}
\IfFileExists{svg-example_svg-tex-extract.pdf}{%
\includegraphics[width=\textwidth]{svg-example_svg-tex-extract.pdf}%
}{}
\end{figure}
\end{document} As you can see, this is a combination of using I will try to create a new command |
Awesome! |
Just to give you an example which was tricky: |
I solved it like this:
|
I think this works when image is not really really huge. |
Try with an example I attached above. |
With the example I obtain this:
|
Oh, yes, but with |
I have never tried with math formulas |
I mean, this is the mean reason why to use this package, no? Otherwise I can just export SVG to PDF myself and embed it as PDF into my LaTeX document? If I understand correctly, setting |
On the whole, yes, but with a few little things added (like the path search or the automatic invocation of the Inkscape export after an update of the SVG file). |
@major-mayer Your title is probably not centered. It's actually the text-anchor css property that has to be set to middle on the parent xml element. There is actually an inkscape export bug related to this: https://gitlab.com/inkscape/inkscape/-/issues/1170 Long story short: open the svg in inkscape, press "T" to enter text edit mode, click on your title, then in the toolbar, select the "center" option. Do not select text while doing so, or it will set the alignment to the wrong xml element, and it will get ignored during export. You'll see a small square box in inkscape, positioned at the middle of your text box. That is the anchor, text will be centered around it. Move the title around to the desired position. Regarding the font size, you can probably prefix it with \large in the svg, though I haven't tried it. |
Let me give my two cents regarding this: The main advantage of using Thus, I would vote against including somethign like Now, the fact that many people are confused about how text in the |
I totally agree with you there. I will place a clear notice at the beginning of the documentation for the next release. I had already started working on |
I cannot really get text to correctly align with the image. I am guessing because the image is heavily scaled down. I tried using
pretex=\tiny
andpretex=\relscale{0.1}
but it is still off (text too large).I am thinking that maybe a solution would be if:
That would make it use the LaTeX fonts but allow precise scaling as needed.
It looks like this package could support that but it is not yet fully possible? So
svg-extract
could extract to a separate PDF with custom preamble inextractpreamble
, but then I think that instead of the original image the extracted PDF should be included in the main document.The text was updated successfully, but these errors were encountered: