-
-
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
Provide a way to specify multiple base path for finding images, like TEXINPUT #852
Comments
comment by jgm
Agree, but pandoc alrady relies on TeX which also brings a ghostcript. But as said, this would be another issue. An alternative would be that pandoc at least implements an optimization such that it looks if more appropriate graphic files exist. e.g for Then it is in the responsibility of the document author to provide an appropirate format. In this case I would organize this by wortsammler. |
BTW one more thing in the same context: as of now the graphics is included relative to the current working directory. This sometimes causes trouble. Would it be possible to specify an option |
I am not sure why you'd get the error you're seeing if the file exists. Probably it isn't in the right directory (pandoc will look in the directory of the first file specified on the command line). (I'm sorry, but we can't provide line number information here, as this message is emitted by the docx writer, and the pandoc AST does not store source positions.) In any case, I don't have enough to go on to reproduce the problem. |
Oh, is that really true, that pandoc looks for the graphics relative to the directory of the first file specified in the commandline. I thought it looks relative to the current working directory. I will try to provide a test case that can reproduce the problem. |
I made some tests. It appears to me that this behavior is there only in case of docx output. In case of LaTeX/Pdf it is relative to the current working directory. This is somehow inconsistent ;-( So in order to make it more robust, I hereby repeat my proposal to have I know that the command line gets longer and longer ... |
Hi bwl21, were you able to figure out this issue? thanks, |
Same error here when working from Markdown to epub |
Now that we have a representation of resource path in CommonState, it will be easy to add an option like this. |
Option could be called |
: is the most usual way to separate paths :-)
|
Interesting question, if we have a graphics-path or a resource-path. Original request was for a graphics path, but is no problem to extend it to other resources (if there are such). @JJ yes, in unix-land; in windows, the like ":". AFAIK MikTeX accepts C:/foo/bar;X:/bar/foo; as a valid path. So I would support ";" |
I was about to open an issue on this very same problem. I managed to hack-in this feature (LaTeX only) this way; the Directory structure:
Markdown source: ---
graphics: true
header-includes:
- \graphicspath{{./images/}}
---
![Image](photo.jpg) Pandoc does produce an error, but the output is correct:
Since this feature is quite similar to Thanks to all devs and contributors for their excellent work. |
Perhaps the directory of the first input file should be added automatically to the resource path. |
@jgm I suppose that with "first input" you mean "first file on the command line", in which case I think situations where the first input is a configuration file (ie. .sty, .yaml, ...) should be treated differently. However, that shouldn't be a huge problem since, in most cases, I guess it would just fail and fall back to other paths.
|
SEARCHPATH is separated by the usual character, depending on OS (: on unix, ; on windows). Note: This does not yet work for PDF output, because the routine that creates PDFs runs outside PandocMonad. (This has to do with its use of inTemporaryDirectory and its interaction with our exceptions.) The best solution would be to figure out how to move the PDF creation routines into PandocMonad. Second-best, just pass an extra parameter in? See #852.
TODO:
|
Closed by 8c1b81b |
It is highly recommended that the PDF format of the picture prompt message alone some obvious!! |
I get a pandoc message
Would it be possible to make it a bit more expressive such as
I was calling pandoc with multiple output formats, the problem only occurs while generating docx. The image file exists, but as it is a pdf, I guess pandoc cannot process it. If this is the case, pandoc should express that fact.
Pandoc could use ghostscript to convert it to a proper format, but that's another story (or another request:-)
The text was updated successfully, but these errors were encountered: