2

What is wrong with this code please? When I delete second, third and forth mylisting it works fine.

Error:

! Incomplete \iffalse; all text was ignored after line 18.\fi<> ./xxxxx1.texThe file ended while I was skipping conditional text.This kind of error happens when you say \if...' and forgetthe matching\fi'. I've inserted a `\fi'; this might work.! Emergency stop.<> ./xxxxx1.tex (job aborted, no legal \end found)Here is how much of TeX's memory you used:15397 strings out of 492970288300 string characters out of 3135863541153 words of memory out of 300000019012 multiletter control sequences out of 15000+2000006105 words of font info for 19 fonts, out of 3000000 for 90001141 hyphenation exceptions out of 819154i,5n,80p,836b,2515s stack positions out of 5000i,500n,10000p,200000b,50000s! ==> Fatal error occurred, no output PDF file produced!

Here is the code:

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[czech]{babel}
\usepackage{listings}
\usepackage{natbib}
\renewcommand{\lstlistingname}{Soubor}
\newcommand{\listingsfont}{\ttfamily}

\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\tcbuselibrary{listings}
\newtcbinputlisting[auto counter]{\mylisting}[2][]{listing file={#2},title=Listing,colback=red!5!white,colframe=gray!75!black,,fonttitle=\bfseries,listing only,breakable,title=Soubor \thetcbcounter: #1}
\begin{document}


\mylisting[\textbf{A \texttt{B}}, label=A]{file0.txt}

\mylisting[\textbf{C \texttt{D} \texttt{E} }, label=F]{file1.txt}

\mylisting[\textbf{G}, label=H]{file2.txt}

\mylisting[\textbf{I}, label=J]{file3.txt}
\end{document}

One of not working file:

 57297.54820 4271.0000  1.010  0.753   16384
   1.00001   1.00001   1.00001   1.00001   1.00001   1.00001   1.00001   1.00001
   1.00001   1.00001   1.00001   1.00001   1.00001   1.00000   1.00000   1.00000
   1.00000   1.00000   1.00000   0.99999   0.99999   0.99999   0.99999   0.99998
   0.99998   0.99998   0.99998   0.99997   0.99997   0.99997   0.99997   0.99996
   0.99996   0.99996   0.99995   0.99995   0.99995   0.99995   0.99994   0.99994
   0.99994   0.99993   0.99993   0.99993   0.99992   0.99992   0.99992   0.99991
  • 2
    Once you create the fours files file0.txt, ..., file3.txt this code works fine for me. I suspect that you have an error in one the text files. –  May 10 '19 at 03:48
  • I added one of not working file. What the problem please? – Lukáš Altman May 10 '19 at 04:00
  • 3
    I can compile this without problems with the data file provided. Could it be that you have strange signs in your data files? –  May 10 '19 at 04:29
  • This was a whole file that I can't compile, there aren't any strange signs – Lukáš Altman May 10 '19 at 04:33
  • 1
    What are the real names of the files? – Ulrike Fischer May 10 '19 at 06:39
  • 1
    @LukášAltman do not test your original files test what you post, do as you are asking others to do, copy the above files into a new directory and reproduce the error, if they do not reproduce the error, then please edit the example so that it does, and supply _all needed files so the example runs without missing file errors. – David Carlisle May 10 '19 at 06:50
  • 2
    Do the error still happens of you comment out the babel line? Smells like some active character gone awry... – Rmano May 10 '19 at 07:10
  • 2
    I can reproduce the issue if the file you want to input has - (hyphen) in its name. The error disappears as soon as I remove the hyphen from the file name. Is that the case in your framework? – egreg May 10 '19 at 07:30
  • @Ulrike Fischer @egreg thank you very much. The problem was - in the name of file. – Lukáš Altman May 10 '19 at 19:30

1 Answers1

0

It's the same old problem with Czech and Slovak babel that causes problems all the time, see: [1], [2]. The babel packages replace all hyphens “-” with a dash or something, which breaks a ton of other packages. To turn this “feature” off, just add this to the preamble:

\AtBeginDocument{\shorthandoff{-}}
m93a
  • 271