8

I am writing my thesis by using LaTeX and the toptesi package. I am mostly writing on my laptop, but sometimes I need to switch to my other PC. I encounter some problems here when generating the pdf document. The command used to produce the pdf document is

pdflatex -shell-escape tesi.tex

The compilation ends at this point when the error is displayed:

! I can't find file `['.

Which is kind of meaningless to me. The line that seems to cause the error is the first one of this block which uses the minted package to provide source code in the document.

\begin{listing}[!ht]
\begin{minted}[tabsize=4]{json}
{
    "type": "Room",
    "isPattern": "false",
    "id": "Room1",
    "attributes": [
        {
            "name": "temperature",
            "type": "float",
            "value": "23"
        },
        {
            "name": "pressure",
            "type": "integer",
            "value": "720"
        }
    ]
}
\end{minted}
\caption{JSON structure for entity}
\end{listing}

On my laptop my thesis is compiled correctly, the installed packages are the same, so I don't really know what the problem could be.

EDIT:
After some more trying I reached a minimal example that can reproduce the error:

\documentclass[english,12pt]{toptesi}

\usepackage[utf8]{inputenc}
\usepackage{minted}

\begin{document}

\begin{listing}[!ht]
\begin{minted}[tabsize=4]{json}
{
    "type": "Room"
}
\end{minted}
\caption{JSON structure for entity}
\end{listing}

\end{document}

The problem seems to be in the different version of the toptesi package. Both machines run ubuntu 14.04 and all packets were installed from the official repository. If I change the documentclass to something like article the pdf is successfully created and everything works fine.
Here is the full error, as requested:

! I can't find file `['.
\listing ...\par \begingroup \programma \input #1 
                                                  \endgroup 
l.8 \begin{listing}[
                    !ht]
(Press Enter to retry, or Control-D to exit)
  • Welcome to TeX.SX! Can you look in the log file for the version number of minted? I have Package: minted 2015/09/09 v2.1 Yet another Pygments shim for LaTeX – egreg Jan 31 '16 at 11:00
  • Sure, it is Package: minted 2011/09/17 v1.7 Yet another Pygments shim for LaTeX. I think on the laptop is the same since I installed everything from ubuntu 14.04 repository. – Pyrox Jan 31 '16 at 11:05
  • Please, check the other one. However, I get no error if I try TeX Live 2012 or 2013, that have minted version 1.7. – egreg Jan 31 '16 at 11:07
  • I checked and the version is the same. On the laptop it compiles, on the other machine it doesn't (the full thesis, but a minimal document having only that part compiles correctly). – Pyrox Jan 31 '16 at 11:23
  • Try adding \listfiles on the top of the file giving problems and compile on both machines, trying to get past the error (do it from a terminal window and hit return at the error messages). Then look at the end of the log file, after **File List** and check the differences. – egreg Jan 31 '16 at 11:27
5

your class defines listing for an unrelated purpose. If you do not need that you can re-assert the minted version:

\documentclass[english,12pt]{toptesi}

\usepackage[utf8]{inputenc}

\usepackage{minted}
\let\IWANTTHISlisting=\listing

\begin{document}

\let\listing=\IWANTTHISlisting

\begin{listing}[!ht]
\begin{minted}[tabsize=4]{json}
{
    "type": "Room"
}
\end{minted}
\caption{JSON structure for entity}
\end{listing}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.