-
-
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
Add working dir / source path as template variable #5464
Comments
As a workaround, one can set the function Meta (meta)
-- set current working directory. Works on Mac and Linux; not sure about Windows.
meta.pwd = os.getenv 'PWD'
return meta
end |
If |
@tarleb That's an option, another idea I had was For most of my documents I have rather basic needs so panzer et al are overkill. This addition would make another common usecase doable without any addons and it complements the |
According to a StackOverflow answer, there is no easy, platform independent way to get the current working directory from within Lua. I've started work on a module to expose the relevant Haskell functions to Lua. This should also help with other common filter operations. |
for reference: I guess, that's #5468 |
I've got almost the same problem as in #3431: I want to include the source file in the output document.
For
context
, I have included the following snippet:This will include the source file as PDF attachment, but only with an absolute input file name (
pandoc $PWD/test.md -t context -s -o test.pdf
) or with context running from the same directory (pandoc test.md -t context -s -o test.tex; context test.tex
), otherwisecontext
will look for the file in the temporary pdf folder.This could be solved either with a variable with the full paths (
fullpathsourcefile
?) or a variable with pandoc's current working directory (usable as\attachment[file=$pwd$/$sourcefile$,method=hidden]
).The text was updated successfully, but these errors were encountered: