-
Notifications
You must be signed in to change notification settings - Fork 96
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
Control texmode via SVG attribute #194
Conversation
Hello @fberlakovich, Thanks for the PR :)
|
Sure, no problem. Regarding Inkscape: maybe. I have zero experience with Inkscape and don't know if Inkscape allows adding/editing custom SVG properties. I can have a look though. |
For Inkscape, modifying the |
Could you have another look? I added the requested changes (I think). Btw, my endgoal would be to use this new feature to selectively export text to either math text, raw text, escaped text or text converted to paths. Certain formatting options in draw.io are hard to translate to latex text formatting (font name alone is difficult, because latex uses the berry naming scheme for font names...), but I haven't found an angle yet to selectively achieve the text to path conversion. |
Hello @fberlakovich There is also Also don't forget to use Text formating is complicated with Latex that's also why this feature is not so well developed in the code base. For example scaling a svg will impact font size, but this is not taken into account in the tikz code for now. |
Thanks for pointing it out, fixed.
I have a prototype that parses the HTML in the |
I am really sorry, I forgot formatting the tests 🤦 . I will fix it right away and also try to run the workflow locally to avoid future mistakes |
I fixed the formatting issue and also, what I believe, is a typo in the |
Can we not directly convert But thanks again for PR :) |
The reason why Inkscape (to the best of my knowledge) can't deal with
I didn't get round to working on the conversion since I posted my comment, but will share the code as soon as it is functional. |
Description
The PR fixes an issue with output to stdout and adds the ability to select the
texmode
with an SVG attribute.Use Case
I use
svg2tikz
to convert SVGs exported from draw.io to tikz. Most of the time I want to use the convenient text formatting options in draw.io. Sometimes, however, I want to use some latex feature in e.g. a label of an object, but keep the text formatting of all other objects. With this PR, I can add a custom attribute to the label that specifies its text should be interpreted raw. The text of the label then containts the necessary Latex code, whereas all other labels retain their draw.io formatting.Type of change
How Has This Been Tested?
The PR includes a file test for the new feature.