Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Maybe make inkscapearea=page the default? #37

Open
Assignees
mrpiggi
Labels
Milestone
@schtandard

Description

@schtandard

It has always confused me that the default forinkscapearea isdrawing and notpage. To me,page is the obvious choice. To my knowledge, all other contexts in whichsvgs are used (e.g. websites) use the page as the bounding box for the drawing. That is to say, users will likely expect that behavior. After all, that's its whole purpose. Usingdrawing means discarding information on how the drawing should be displayed that was provided by its creator. The aliasescrop andnocrop illustrate this quite well: I find it pretty weird for an image inclusion mechanism to crop the image by default.

Especially in the context of LaTeX, I often need to make use of the page boundaries. An example is when I have multiple drawings that should be displayed next to / above each other. Then I can createsvgs with identical sizes (or at least aspect ratios) without worrying about the precise drawing size and just scale them identically in LaTeX.

It gets even messier when LaTeX code is involved. As an example, consider the following drawing.
image
Including this with thedrawing option cannot yield anything sensible. Thepage option preserves the intention of the creator (frame added in LaTeX):
image

All in all, this seems like a really strange default choice to me and I would argue for changing it. It isn't a super pressing issue (there aretwoquestions caused by it on tex.sx for now) but I thinkpage would be a much better default.

I do realize, of course, that this would mean breaking backward compatibility, which is unfortunate. If other things doing that are also in the works, I would love to see this change included in the next major release, though.


Files used for illustration:

  • geometric_series.svg
    <?xmlversion="1.0"encoding="UTF-8"?><svgwidth="108.49mm"height="12.396mm"version="1.1"viewBox="0 0 108.49 12.396"xmlns="http://www.w3.org/2000/svg">  <defs>    <markerid="StopL"overflow="visible"orient="auto">      <pathtransform="scale(.8)"d="m0 5.65v-11.3"fill="none"stroke="#000"stroke-width="1pt"/>    </marker>  </defs>  <gtransform="translate(-33.067 -30.844)">    <textx="121.70834"y="37.041664"font-family="'Libertinus Sans'"font-size="4.2333px"letter-spacing="0px"stroke-width=".26458"word-spacing="0px"style="line-height:1.25"xml:space="preserve"><tspanx="121.70834"y="37.041664"stroke-width=".26458">\raisebox{-.5ex}{\(\displaystyle\sum_{k = 0}^\infty \frac{1}{2^k} = 2\)}</tspan></text>    <pathd="m58.208 37.042h29.104 14.552 7.276 3.638 1.819 0.90951 0.45475 0.22737 0.22738"fill="none"marker-end="url(#StopL)"marker-mid="url(#StopL)"marker-start="url(#StopL)"stroke="#000"stroke-width=".265"/>    <textx="52.916668"y="37.041664"font-family="'Libertinus Sans'"font-size="4.2333px"letter-spacing="0px"stroke-width=".26458"text-align="end"text-anchor="end"word-spacing="0px"style="line-height:1.25"xml:space="preserve"><tspanx="52.916668"y="37.041664"stroke-width=".26458"text-align="end"text-anchor="end">\raisebox{-.5ex}{a series:}</tspan></text>  </g></svg>
  • svg_test.tex
    \documentclass{article}\usepackage[inkscapearea=page]{svg}\begin{document}\fbox{%\includesvg{geometric_series}%}\end{document}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp