-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Suggestion: MS writer, preserve image name #4475
Comments
I now have a lua filter + ms macro version that works for me and also tries to convert graphics to PDF. I would gladly share this (the Lua part also contains some other stuff; I could prepare a cleaned-up version) if you are interested, but if |
I'm certainly interested. You might consider sharing your filter on pandoc/lua-filters. |
Oh, great! So do you want to have a look at the lua filter to see how it handles these changes and then consider what to take from it, and I share the filter for the rest? The relevant parts would be |
is this still broken ? |
See #4475. + PDFPIC is now used for PDF images in figures. + Inline images that are postscript or PDF are rendered using PSPIC or PDFPIC. This isn't ideal, because they will still be rendered as if in a separate paragraph, but it's probably better than just printing the image name. + Units are included in height. For further improvement, we might consider in Text.Pandoc.PDF using something like `convertImages` (which we currently use for converting to PDF via LaTeX) to convert SVG (and other?) images to PDF so they can be rendered in this way.
I just pushed some small improvements (PDF images will now work). |
i have tried the lua filter and template enhancements referenced above (from @teoric), but they did not work for me. |
I suppose this is not the right place to discuss my enhancements, but I can try to look into problems if you write to me or raise an issue at my repo. One problem that occurs sometimes has to do with the output of some tools, which may be easy to fix locally. @jgm, PDF inclusion and your further plans sound great, thank you! |
@teoric i was only using your filter to see if it was i viable workaround @jgm i am really interested at improving the ms writer by giving feedback to explain my situation a little bit better: my use case involves mostly converting markdown to pdf with a ms template that i adapted from the standard. i also use a pagebreak.lua filter script to align some headers to the start of a new page. what i now need is to insert full-width images in png/jpg/svg formats. |
@terefang I was only trying to tell you that I would be willing to help you exploring/improving viability and that there are some undocumented stumbling blocks and dependencies. (Not documented because nobody has ever expressed interest in using this, and for me, the approach has been viable the few times I needed it ;-).) But I understand now that you are seeking a different solution entirely. |
@teoric i understand, thanks, but for me the way forward is to have this in pandoc |
See jgm#4475. + PDFPIC is now used for PDF images in figures. + Inline images that are postscript or PDF are rendered using PSPIC or PDFPIC. This isn't ideal, because they will still be rendered as if in a separate paragraph, but it's probably better than just printing the image name. + Units are included in height. For further improvement, we might consider in Text.Pandoc.PDF using something like `convertImages` (which we currently use for converting to PDF via LaTeX) to convert SVG (and other?) images to PDF so they can be rendered in this way.
Currently (pandoc 2.1.2), pandoc's
ms
writer drops the complete image from the sourcebecomes
But it seems to become so useful that I would suggest to make the file name available somehow; that way, one can make use of it when working with the
ms
document, and get a nice PS/PDF out of it. The following would be very unobtrusive markup-wise:(Only provide WIDTH and HEIGHT if defined in the original document in useful units. Potentially comment them if they are percent values or other useless values.)
This would even work if
images/name
is an EPS graphic and the file is processed with-Tps
, but not give a nice caption. Else, it would be easily replaced by.PDFPIC "images/name" WIDTH HEIGHT
, if one cares to do so.If the resulting error messages are too annoying, or you want to come closer to the LaTeX approach, one could consider the following; this way, tweaking the output to a real figure would be rather simple, and would show a real placeholder.
(Only provide WIDTH and HEIGHT if defined in the original document in useful units. Potentially comment them if they are percent values or other useless values.)
and e.g. include in the standard template as a dummy definition:
For the term
figure
, you could rely on thegroff
localisation efforts (\*[locale]-lifg
), but that may be to advanced as you would also have tomso <LANG>.tmac
, which only exists for some languages.The text was updated successfully, but these errors were encountered: