Skip to content
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

Rendering to DocX, fails to find images. #19

Closed
jxhn opened this issue Mar 7, 2013 · 7 comments
Closed

Rendering to DocX, fails to find images. #19

jxhn opened this issue Mar 7, 2013 · 7 comments

Comments

@jxhn
Copy link

jxhn commented Mar 7, 2013

I have been trying using to the SmartMarkdown Plugin to render to PDF and HTML without issue and including the images but when I try to render it to DocX I get the following error:

Fail to generate output.
�Command: pandoc -t docx    /var/folders/j_/lpm97wj53cbc0cnprvps5nh00000gn/T/tmprCTLsX.md -o /Users/jomahoney/code/FYP/Project.docx

Errors: pandoc: Could not find image `images/login.png', skipping...
pandoc: Could not find image `images/profile.png', skipping...
pandoc: Could not find image `images/module.png', skipping...
pandoc: Could not find image `images/workbench.png', skipping...

But as mentioned the images are in the correct directory. I notice the the render uses a temp file, perhaps this is causing the images to not be found? Any ideas?

@demon386
Copy link
Owner

I think the problem is because we're writing the content to a temporary file, and the image is not in the directory that temporary file resides.

I'll investigate this within about 2-3 days. Sorry for the delay.

@demon386
Copy link
Owner

@jomahoney Hi, I've tried on my machine, and seems that I have no problem linking image when generating docx.

You used Mac OS X too right? Can you successfully generate the docx using the command line?

@jxhn jxhn closed this as completed Mar 6, 2014
@jxhn
Copy link
Author

jxhn commented Mar 6, 2014

User Error

@timmkrause
Copy link

What was the solution to your problem? Always mention your solution, you can help somebody else as well. Me in this case. ;-)

@michiindc
Copy link

Pandoc wants the path to the image to be absolute it seems, not relative to the current working directory: /Users/username/Documents/project/img/example.png.

Pandoc 1.13.1, OS X 10.9.5

@tomak-git
Copy link

It seems that relative paths to images work only if you execute the Pandoc command from within the directory where your working files (the text and images) are. Otherwise you need to use absolute paths. Tested on Ubuntu 14.04 with stock Pandoc.

@mimmori
Copy link

mimmori commented Mar 9, 2016

Is there a plan to work to allow to use relative link? It would be very useful for working on different machines.

The problem seems present only with docx output. I have tried to generate html file and it works well in a relative way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants