Comments (20)
I believe this was due to missing final quotes in the Python code. Strangely, I don't get any issues with that on my system. See if the updated minted.sty
in 2ac55cb works for you.
from minted.
Now I get a different error:
File "<string>", line 1
import hashlib; hasher = hashlib.sha1(); f = open(\'gruml2dbschema.mintedcmd\', \'rb\'); hasher.update(f.read()); f.close(); f = open(\'gruml2dbschema.pyg\', \'rb\'); hasher.update(f.read()); f.close(); f = open(\'gruml2dbschema.mintedmd5\', \'w\'); macro = \'\edef\minted@hash\' + chr(123) + hasher.hexdigest() + chr(125) + \'\'; f.write(\'\makeatletter\' + macro + \'\makeatother\n \'); f.close();
^
SyntaxError: unexpected character after line continuation character
! LaTeX Error: File `gruml2dbschema.mintedmd5' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: mintedmd5)
I guess all the strings in the python code should look like 'foo' or "foo" rather than 'foo'.
from minted.
Can you tell me what operating system you are using? I think we're running into something related to how -shell-escape
interacts with the OS.
from minted.
I'm on Arch Linux. (And just to be clear: also with the new minted.sty, I can compile a document with cache option just fine with pdflatex, and I get the error above only when I try to compile with xelatex. Does xelatex's -shell-escape interact differently than pdflatex's?)
from minted.
On windows I don't have this problem
from minted.
In the meantime, I've switched from TeX Live 2013 to 2014 and from XeTeX to LuaTeX, and (although I think it uses xelatex as its backend) the cache option works without issues. But I can still confirm that error when using xetex.
from minted.
XeLaTeX on windows seems to work with cache, but it has problems with inlined code there⦠See #40 for more information.
from minted.
With the latest minted.sty
, xetex should work on all systems (tested on Windows and Ubuntu). Linux was treating quote escapes differently than Windows.
Please let me know if it works now. Also, any thoughts on the naming scheme for the cache directory? I know that directories starting with a dot (.minted-<name>
) are hidden on some systems by default, and that could be seen as either an advantage or a disadvantage, depending on how you like to think about things.
from minted.
Since I'm using ll
more often than ls
it would be only a matter of
sorting for me, but it seems kind of convention to only have configuration
or similar dotted and a sub folder tmp for temporary or cache files. And
don't use the jobname, please, I have projects with different main files
that all include same singles with code. If you have jobname as part of the
cache I'd, I won't benefit in the amount I could.
Am 22.07.2014 23:04 schrieb "Geoffrey Poore" [email protected]:
With the latest minted.sty, xetex should work on all systems (tested on
Windows and Ubuntu). Linux was treating quote escapes differently than
Windows.Please let me know if it works now. Also, any thoughts on the naming
scheme for the cache directory? I know that directories starting with a dot
(.minted-) are hidden on some systems by default, and that could be
seen as either an advantage or a disadvantage, depending on how you like to
think about things.β
Reply to this email directly or view it on GitHub
#18 (comment).
from minted.
@NobbZ I will have to think about whether the jobname in the cache directory name can be optional. If there's any chance of problematic collisions (I doubt that there is, but I'll have to check), then it will have to stay.
However, there's already a cachedir
option, so if you set that in all your files, you can already have them share everything.
from minted.
@gpoore Still fails on Windows 7 for me with latest version of minted. MikTeX is up to date, all temp files were erased. Shall I paste some logs?
EDIT: Found this. Looks OK but it failed
runsystem(python -c "import hashlib; hasher = hashlib.sha1(); f = open("XeLaTe
X.mintedcmd", "rb"); hasher.update(f.read()); f.close(); f = open("XeLaTeX.
pyg", "rb"); hasher.update(f.read()); f.close(); f = open("XeLaTeX.mintedmd
5", "w"); macro = "\edef\minted@hash" + chr(123) + hasher.hexdigest() +
chr(125) + ""; f.write("\makeatletter" + macro + "\makeatother\endinput
\n "); f.close();")...executed.
! LaTeX Error: File `XeLaTeX.mintedmd5' not found.
Type X to quit or to proceed,
or enter new name. (Default extension: mintedmd5)
from minted.
@LDVSOFT Are you using the absolute latest minted.sty
, not the last release? Are you using any build tools or special cache directories?
from minted.
@gpoore Well, if the aren't any newer minted.sty than on this github. I tried 2.0.alpha3 before reading this thread, now I'm using the one that was on github today (I am very sure about it, but will check right now). I just included cache
option. It created default cache dir and .mintcmd
successfully, though!
from minted.
@gpoore Checked, just downloaded minted.sty from commit 29e8a80
and got failure on minted.md5. I pushed also cachedir=mcache
, folder was created but still a failure on md5.
from minted.
@LDVSOFT I can't replicate the problem with Windows 7 and MiKTeX. Can you provide a minimal document that causes the error and the exact command you are using with MiKTeX?
from minted.
Here it is:
\documentclass[12pt]{book}
\usepackage[cache,cachedir=mcache]{minted}
\begin{document}
\begin{minted}{python}
def gcd(a, b):
\end{minted}
\end{document}
And command:
texify --pdf --engine=xetex --tex-option=--shell-escape --tex-option=-8bit
from minted.
@LDVSOFT This is very strange...I still can't get this to give errors. Please post a complete log when you have a chance. Also, please give me the version of Python (python --version
) and Pygments (pygmentize -V
) that you are using.
from minted.
@gpoore Not a problem
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (MiKTeX 2.9 64-bit) (preloaded format=xelatex 2014.9.8) 22 SEP 2014 12:29
entering extended mode
**D:/LDVSoft/SPbAU/TeX/minted-caching/sample.tex
(D:/LDVSoft/SPbAU/TeX/minted-caching/sample.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\book.cls"
Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\bk12.clo"
File: bk12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@chapter=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex\latex\minted\minted.sty"
Package: minted 2013/12/21 v2.0-alpha3
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/05/08 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
("C:\Program Files\MiKTeX 2.9\tex\latex\fancyvrb\fancyvrb.sty"
Package: fancyvrb 2008/02/07
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)
\FV@CodeLineNo=\count89
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count90
\FV@StepNumber=\count91
\FV@OutFile=\write3
) ("C:\Program Files\MiKTeX 2.9\tex\latex\float\float.sty"
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count92
\float@exts=\toks15
\float@box=\box27
\@float@everytoks=\toks16
\@floatcapt=\box28
)
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\tools\calc.sty"
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count93
\calc@Bcount=\count94
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 75.
LaTeX Info: Redefining \addtolength on input line 76.
\calc@Ccount=\count95
\calc@Cskip=\skip45
)
("C:\Program Files\MiKTeX 2.9\tex\latex\ifplatform\ifplatform.sty"
Package: ifplatform 2010/10/22 v0.4 Testing for the operating system
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is not detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: pdfTeX >= 1.30 not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\catchfile.sty"
Package: catchfile 2011/03/01 v1.6 Catch the contents of a file (HO)
))
(C:\Users\LDVSOFT\AppData\Roaming\MiKTeX\2.9\tex\latex\etoolbox\etoolbox.sty
Package: etoolbox 2011/01/03 v2.1 e-TeX tools for LaTeX
("C:\Program Files\MiKTeX 2.9\tex\latex\misc\etex.sty"
Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)
\et@xins=\count96
)
\etb@tempcnta=\count97
)
(C:\Users\LDVSOFT\AppData\Roaming\MiKTeX\2.9\tex\latex\xstring\xstring.sty
(C:\Users\LDVSOFT\AppData\Roaming\MiKTeX\2.9\tex\generic\xstring\xstring.tex
\@xs@message=\write4
\integerpart=\count98
\decimalpart=\count99
)
Package: xstring 2013/10/13 v1.7c String manipulations (C Tellechea)
)
(C:\Users\LDVSOFT\AppData\Roaming\MiKTeX\2.9\tex\latex\lineno\lineno.sty
Package: lineno 2005/11/02 line numbers on paragraphs v4.41
Invalid UTF-8 byte or sequence at line 296 replaced by U+FFFD.
\linenopenalty=\count100
\output=\toks17
\linenoprevgraf=\count101
\linenumbersep=\dimen105
\linenumberwidth=\dimen106
\c@linenumber=\count102
\c@pagewiselinenumber=\count103
\c@LN@truepage=\count104
\c@internallinenumber=\count105
\c@internallinenumbers=\count106
\quotelinenumbersep=\dimen107
\bframerule=\dimen108
\bframesep=\dimen109
\bframebox=\box29
LaTeX Info: Redefining \\ on input line 3056.
)
\minted@appexistsfile=\read2
\FV@BreakIndent=\dimen110
\FV@BreakSymbolSep=\dimen111
\FV@BreakSymbolIndent=\dimen112
\FV@LineBox=\box30
\FV@IndentBox=\box31
\FV@LinenoBox=\box32
\minted@bgbox=\box33
\minted@code=\write5
\c@minted@FancyVerbLineTemp=\count107
\@float@every@listing=\toks18
\c@listing=\count108
)
runsystem(if not exist "mcache" mkdir "mcache")...executed.
runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set >sam
ple.aex <nul: /p x=^%~$PATH:i>>sample.aex)...executed.
runsystem(del "sample.aex")...executed.
file deleted
(D:\LDVSoft\SPbAU\TeX\minted-caching\mcache/default.pygstyle)
(D:\LDVSoft\SPbAU\TeX\minted-caching\sample.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
("C:\Program Files\MiKTeX 2.9\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: xetex.def on input line 225.
("C:\Program Files\MiKTeX 2.9\tex\xelatex\xetex-def\xetex.def"
File: xetex.def 2014/07/25 v4.03 LaTeX color/graphics driver for XeTeX (RRM/JK)
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
runsystem(python -c "import hashlib; hasher = hashlib.sha1(); f = open(\"sample
.mintedcmd\", \"rb\"); hasher.update(f.read()); f.close(); f = open(\"sample.py
g\", \"rb\"); hasher.update(f.read()); f.close(); f = open(\"sample.mintedmd5\"
, \"w\"); macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr
(125) + \"\"; f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n
\"); f.close();")...executed.
! LaTeX Error: File `sample.mintedmd5' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: mintedmd5)
Enter file name: X
)
(\end occurred inside a group at level 1)
### semi simple group (level 1) entered at line 4 (\begingroup)
### bottom level
(\end occurred when \ifx on line 6 was incomplete)
(\end occurred when \ifx on line 6 was incomplete)
(\end occurred when \ifx on line 6 was incomplete)
Here is how much of TeX's memory you used:
3245 strings out of 429025
47275 string characters out of 3167801
121496 words of memory out of 3000000
6512 multiletter control sequences out of 15000+200000
4107 words of font info for 16 fonts, out of 3000000 for 9000
912 hyphenation exceptions out of 8191
37i,1n,35p,848b,127s stack positions out of 5000i,500n,10000p,200000b,50000s
No pages of output.
Python is 2.7.8, Pygmets is 1.6. Got from commands you gave.
from minted.
@gpoore Helly strange that even the last commited version still has been marked as 2.0-alpha3 on 23 December on first lines.
from minted.
I am closing this because I have tested the latest minted.sty
with caching under Windows and Linux (Ubuntu), with TeX Live and MiKTeX, and everything seems to be working fine. Please open new issues if you continue to have problems after upgrading to the latest commit (958099f).
from minted.
Related Issues (20)
- Breaking line within \newmintinline throws error
- `linerange` to select the exact lines to output HOT 2
- `newmintedfile` env* to specify additional options HOT 9
- [bug] `gobble` results in malformed formatting, `autogobble` works HOT 5
- [show-&-tell] ad-hoc adoptations from a different style to another one. HOT 1
- [feature] Support for PDDL programming language HOT 2
- [bug][compatibility] `Verbatim` environment generated by `minted` with `mathescape` broken with `babel`'s `magyar.ldf` (Hungarian ππΊ language) HOT 1
- JSX highlighting is not working in overleaf HOT 1
- breaksymbolleft flush with line numbers HOT 2
- Write env content to file HOT 2
- Failed Compilation with MikTeX on windows HOT 19
- Overfull hbox with `mintinline` and `breakanywhere` in enumerate environment HOT 1
- Escapeinside content is misplaced in pygtex file for nodejsrepl type HOT 7
- Because of changes in one of the most popular Python installer on Mac, doc needs an improvement (`pip3 install Pygments` doesn't work anymore) HOT 1
- file extension `lol' cannot be used twice HOT 3
- autogobble option not working for me HOT 12
- Can not compile via latexmk in Windows HOT 5
- Missing Pygments output; \inputminted... HOT 2
- [Feature request] named code segments HOT 1
- Get full timestamp in XeTeX through \creationdate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minted.