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

enhancement request, option to use cached file only #113

Closed
davidcarlisle opened this issue Mar 15, 2016 · 4 comments
Closed

enhancement request, option to use cached file only #113

davidcarlisle opened this issue Mar 15, 2016 · 4 comments

Comments

@davidcarlisle
Copy link

A request on stackexchange

http://tex.stackexchange.com/questions/280590/work-around-for-minted-code-highlighting-in-arxiv/280685#280685

asked how to use minted in a submission to arXiv (which does not allow shell escape)

what would be nice would be an option that disabled the call to pygmentize but used the cache directory if it is there, then having run minted locally you would just change the option and package the main file along with the minted generated directory without needing to cal pygmentize again. (of course it would be users responsibility to check that the cache was still valid)

@gpoore
Copy link
Owner

gpoore commented Mar 16, 2016

That's a good idea, and shouldn't be too difficult to implement. I'm currently spending all my spare time on what will become the next PythonTeX, but will try to make time soon to switch back to minted and work on this and the shell-escape issue.

@gpoore gpoore closed this as completed in 1ef982b Jun 2, 2016
@gpoore
Copy link
Owner

gpoore commented Jun 2, 2016

There are now new package options finalizecache and frozencache. These allow the cache to be prepared for (finalizecache) and then used (frozencache) in an environment in which -shell-escape, Python, and/or Pygments are not available. The document must be compiled with finalizecache first, to prepare the cache (mostly renames cache files to listing<number>.pygtex form, so that hashing isn't needed). Then finalizecache may be replaced with frozencache, and from that point on, -shell-escape, Python, and Pygments are optional.

Of course, this only works if minted content does not need to be modified, and if no settings that depend on Pygments or Python need to be changed. The potential pitfall is that invalid modifications can't be detected, but a procedure for checking for this is outlined in the docs.

@davidcarlisle
Copy link
Author

davidcarlisle commented Jun 2, 2016 via email

matthewfeickert added a commit to matthewfeickert/pyhf-funcX-CHEP-2021-proposal that referenced this issue Mar 1, 2021
matthewfeickert added a commit to matthewfeickert/pyhf-funcX-CHEP-2021-proposal that referenced this issue Mar 1, 2021
* Add Make target to build tarball for arXiv that works with AutoTeX
* Use finalizecache and frozencache options for minted to get viable cache for AutoTeX
   - c.f. gpoore/minted#113 (comment)
@veronica320
Copy link

Tip for Overleaf users (originally from this stackexchange post, rhombidodecahedron's comment):

I am an Overleaf user and this worked for me, even using tcolorbox. Step one: compile with \usepackage[finalizecache,cachedir=.]{minted}. Step two: go to logs and output files > other logs and files and download everything with pyg. Step three: change finalizecache to frozencache and upload the tex+all those pyg files to arXiv. Success!

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

No branches or pull requests

3 participants