-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix #1907: Support svg image in LaTeX output. #2166
Conversation
This PR should solve #1907 |
9becd94
to
d3ebab0
Compare
@@ -1182,7 +1184,11 @@ def visit_image(self, node): | |||
options = '' | |||
if include_graphics_options: | |||
options = '[%s]' % ','.join(include_graphics_options) | |||
self.body.append('\\includegraphics%s{%s}' % (options, uri)) | |||
if node['uri'].lower().endswith('svg') or \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think endswith(('.svg', '.svgz'))
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I agree with you.
It seems this is a new feature. The |
In addition, it seems enabling |
@tk0miya Yes, I can add an option in conf.py. How about |
I think I have a better way to implement this without touching the |
New idea looks good to me! And, I think the feature should be implemented as sphinx extension (cf. @birkenfeld @shimizukawa What do you think about this? |
@tk0miya It is more than LaTeX and svg --- it can also convert pdf/eps to svg for html output. Maybe we can call it |
Oh, sorry. I did not noticed your comments... It might the users can not guess what it does if it is named as The naming of the extensions is very important, I think. but, at the same time, it is very difficult to get an agreements about it. |
Thanks, I'll name it as auto_image_converter . I'll make another PR :) |
In case you're not aware of it, the About the name: Since it depends on Inkscape, probably it should have |
However this relies on an existing installation of inkscape. The tests of svg should be ignored if no inkscape installation is found.