feature request: new special for accessing the <defs> part of the SVG file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dvisvgm |
Fix Released
|
Medium
|
Martin Gieseking |
Bug Description
Hi, another feature request entered as a bug report.
For the purposes of TikZ, it would be nice to have three new specials that give access to the <defs> part of the output SVG.
The background is that, for instance, a pattern or a filter is something that should be declared in the <defs> part of the output SVG. Things still work if they are declared right inside the main <g> of the document, but it would be nicer if a special gave access to the <defs> part.
Taking this a step further, what would be ideal are three specials like the following:
\special{
\special{
\special{
The idea is the following: Everything between the defstart and defend special should not be placed in the main svg stream; rather it should be put "on hold". Later, when the refdef special is encountered for the given name, the stuff that has been put on hold is inserted (once) into the <defs> of the current svg element. If the refdef is encountered a second time on the same page, nothing happens. If the refdef is later encountered on another page, the stuff is inserted once more into the <defs> of that other page.
This would allow one to write things like the following
...
\special{
\special{
\special{
foobar
...
on page 3:
\special{
\special{
yadda
\special{
\special{
...
on page 5:
\special{
\special{
yadda yadda
\special{
\special{
Changed in dvisvgm: | |
status: | New → In Progress |
Changed in dvisvgm: | |
status: | In Progress → Fix Committed |
Changed in dvisvgm: | |
milestone: | none → 1.7 |
Changed in dvisvgm: | |
status: | Fix Committed → Fix Released |
That shouldn't be too complicated to implement. However, it requires a prescan of all previous pages in order to collect all required definitions. I'll see what I can do without increasing the overall conversion speed too much.