-
-
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
feature request: leave temporary file behind with --verbose #2288
Comments
No, I don't want to do this. +++ Paulo Ney de Souza [Jul 09 15 15:09 ]:
|
Couldn't it be implemented by using a separate switch, explicitly, like |
+++ Kurt Pfeifle [Jul 09 15 16:00 ]:
That would be the way to do it, but I still don't see a |
This option makes debugging easier. For example, in my own Makefiles, I have: %.tex: %.html
pandoc -o $@ $< ...
%.pdf: %.tex
xelatex $< ... because even though the intermediate %.pdf: %.html
pandoc -o $@ $< ... |
The background of Paul's feature request is this thread which I just now transformed into A "compelling" reason is to get easier access to the intemediate LaTeX files. In the current case it was relatively easy to copy'n'paste 81 lines of LaTeX code from the terminal (after scrolling about 1000 lines back). But imagine an 810 or 8100 lines long LaTeX file, and scrolling back 10.000 lines in the terminal... It's a good thing we now have at least Without it, it would have been impossible (for me!) to pinpoint at the line which is the culprit for the failed |
And it is not just a question of a long TeX file. In my case the pandoc run I agree that would be best implemented as a separate flag from --verbose. Paulo Ney On Thu, Jul 9, 2015 at 4:52 PM, Kurt Pfeifle notifications@github.com
|
There's probably an indirect way you could get the images. +++ Paulo Ney de Souza [Jul 09 15 17:14 ]:
|
Yes! That works nicely. Thanks! ... and now that I understand the meaning PN On Thu, Jul 9, 2015 at 5:22 PM, John MacFarlane notifications@github.com
|
Just being curious if this is still alive? I would love to keep the LaTeX index file (*.ind), because we have a large project where the total index |
See @hftf's comment. Just create a bash or make file to use pandoc to generate .tex, then call latex seperately. |
I know I can do it that way, but I would really like to just run it through pandoc. At the moment I'm running it through pandoc and then through LaTeX. I think it would be a great help if Pandoc just had an option like |
Pandoc doesn't run mkindex anyway in creating PDFs.
+++ Ton Kersten [Jul 19 17 00:49 ]:
… I know I can do it that way, but I would really like to just run it
through pandoc. At the moment I'm running it through pandoc and then
through LaTeX.
I think it would be a great help if Pandoc just had an option like
--keep-temp and a way to find out where they are. I can then copy the
file(s) I need and clean up.
This way I keep a clean working directory without all the extra mess of
LaTeX.
—
You are receiving this because you commented.
Reply to this email directly, [1]view it on GitHub, or [2]mute the
thread.
References
1. #2288 (comment)
2. https://github.com/notifications/unsubscribe-auth/AAAL5KWygPFov_d6yWsP3_MkoX2i7SPkks5sPbULgaJpZM4FVp14
|
But that is not what I mean. During the LaTeX run the Running just sole It would be very nice if Pandoc would just leave the |
I have another use case where this feature would be really useful. My markdown source has a lot SVG images. Thanks to #265, these are converted to PNG with PDF as output format. But in LaTeX output they are not and can't be processed. However, I use biblatex for citations, which is not supported in pandoc's PDF output. So I have to decide between converting all the SVG images manually (if I chose .tex output) and giving up on biblatex (if I chose .pdf output). Running pandoc with |
I see the point. The main issue is that it would add a
lot of complexity. We'd need to figure out when runs
of biber or biblatex are needed. We'd need a way to
select between them. And then, once we've implemented
this, people will ask, "what about mkindex/xindy?"
Before long, we're reimplementing latexmk. My thought
was that we should cut this off at the start. People
who want to use native LaTeX features can create their
own pipelines.
per-review <notifications@github.com> writes:
… I have another use case where this feature would be really useful.
My markdown source has a lot SVG images. Thanks to #265, these are converted to PNG with PDF as output format. But in LaTeX output they are not and can't be processed. However, I use biblatex for citations, which is not supported in pandoc's PDF output. So I have to decide between converting all the SVG images manually (if I chose .tex output) and giving up on biblatex (if I chose .pdf output).
Running pandoc with `--extract-media` doesn't help because SVG images are not converted.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#2288 (comment)
|
I was referring to the original feature request (allowing the the temporary files to be left behind), nothing more. This is not so much about expanding the feature set of pandoc as making it easier for advanced users to build upon what pandoc already does. Being able to use the temporary files pandoc generates with PDF output (but then deletes) would allow users to take advantage of the fact that pandoc automatically converts images where necessary and rewrites the paths to them in the .tex file it generates. None of this is possible with LaTeX output, where SVG files are not converted. In this case the |
It's not too hard to create a Lua filter that automatically converts SVGs to PDFs: function Image (elem)
local cmd = 'rsvg-convert -f pdf -a -o "' .. elem.src .. '.pdf" "' .. elem.src .. '"'
print(cmd)
os.execute(cmd)
elem.src = elem.src .. '.pdf'
return elem
end This could be improved a bit (e.g. it currently assumes that all images are SVGs), but it works fairly well as a drop-in replacement for pandoc's automatic image conversion otherwise. |
Note: if you use |
It seems like @jgm's last comment provides a sufficient solution. Can this be closed? |
I believe it should be closed, indeed, as the latex directory can be "saved" using latexmk. This is the way I use it, and it works just fine. |
I think this issue needs to be reopened as there is still no general solution to keeping the intermediate files, which is critical for easy debugging and for certain other tasks (such as the examples involving indexes, given above). Running pandoc with Also, it's not just the TeX engine that creates intermediate files that you might want to keep. As an example, if you are using pandoc to convert HTML to PDF and the HTML includes SVG files, pandoc will run |
I don't think this is a valid criticism: you can ask latexmk to run xelatex for you, using
or
and you can pass that option to pandoc using
Your other points ("most other TeX engines don't have an |
Point taken, and thank you for the correction. Nevertheless, if you're trying to debug a layout issue while using (say) xelatex, the last thing you want to do is to port the build environment to running latexmk instead in the hope that it will help debug the proble (not least because latexmk often needs separate installation). |
I generally agree that leaving temporary files could be an extremely useful option, I was simply indicating this in case you needed a workaround. |
After rereading the thread due to recent contributions, I had a thought about how to design this feature and break down its implementation into small actionable steps.
If we assume that by implementing this enhancement Pandoc must deal with every temporary file generated by every workflow, then sure, this black-and-white thinking applies. But we can also start at a much more basic level of controlling what Pandoc already does. If a line of code in Pandoc is for deleting a file, then simply wrapping an if-statement around it could be the first step to implementing this feature. The if-statement checks if the value of an option, something like |
Sorry, I don't understand why a new feature is needed, given the possibility of doing
|
This doesn't work when there are intermediate files generated by Pandoc, as in the case when the HTML contains SVG images. In this case, Pandoc runs |
I seem to be encountering the opposite problem with pandoc 3.1.11.1 on Windows (MSYS2).
Adding |
@sboukortt not sure. This shouldn't happen; we're using |
I’m not sure it was introduced in 3.1.11.1 specifically; perhaps I should try to bisect. But I don’t remember it being an issue before a few weeks (months?) ago. |
If you can bisect, that would really help. There are no recent changes that seem relevant. |
Sorry, but it sounds like a separate issue than this feature request – can move to another venue (new issue or mailing list)? |
Here's a short program to act as a pad to inspect the parameters the intended executable was invoked with and save the temporary file passed as one of the parameters: https://gist.github.com/ZoomRmc/91599eb180f534be5c8ecde0ca11ab4b |
The conversion to PDF could leave the temporary files behind when called with the option --verbose. They are displayed on the screen, but many of the files produced can be images, etc ... whose display on the terminal window is not optimal.
Paulo Ney
The text was updated successfully, but these errors were encountered: