Unvollständiges \iffalse in einer bestimmten Listenauflistung, unabhängig vom Inhalt

Unvollständiges \iffalse in einer bestimmten Listenauflistung, unabhängig vom Inhalt

Ich habe einen LaTeX-Code, der mir in einer bestimmten Zeile diese Fehler anzeigt:

  • Incomplete \iffalse; all text was ignored after line 140.
  • Forbidden control sequence found while scanning text of \write.in Zeile 140

und dann am Ende des Dokuments:

  • Argument of \@gobble has an extra }. \end{document}
  • Missing } inserted. \end{document}
  • usw.

Der folgende Code hat den Fehler ausgelöst (Zeile 140 befindet sich y[ row[i] ] += ...in \section{COO Kernel}):

\documentclass[11pt,oneside,czech,american]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=4cm,bmargin=3cm,lmargin=3cm,rmargin=2cm,headheight=0.8cm,headsep=1cm,footskip=0.5cm}
\pagestyle{headings}
\setcounter{secnumdepth}{3}
\usepackage{url}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{xcolor}

\makeatletter

\newenvironment{lyxlist}[1]
{\begin{list}{}
{\settowidth{\labelwidth}{#1}
 \setlength{\leftmargin}{\labelwidth}
 \addtolength{\leftmargin}{\labelsep}
 \renewcommand{\makelabel}[1]{##1\hfil}}}
{\end{list}}
\usepackage[varg]{txfonts}
\usepackage{indentfirst}

\clubpenalty=9500

\widowpenalty=9500

\hyphenation{CDFA HARDI HiPPIES IKEM InterTrack MEGIDDO MIMD MPFA DICOM ASCLEPIOS MedInria}

\definecolor{light-gray}{gray}{0.95}
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}

\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\definecolor{Darkgreen}{rgb}{0.0, 0.2, 0.13}
\lstset{
    backgroundcolor=\color{lbcolor},
    tabsize=4,    
    language=[GNU]C++,
    basicstyle=\scriptsize,
    upquote=true,
    aboveskip={0.001\baselineskip},
    columns=fixed,
    showstringspaces=false,
    extendedchars=false,
    breaklines=true,
    prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
    frame=single,
    numbers=left,
    showtabs=false,
    showspaces=false,
    showstringspaces=false,
    identifierstyle=\ttfamily,
    keywordstyle=\color[rgb]{0,0,1},
    commentstyle=\color[rgb]{0.026,0.112,0.095},
    stringstyle=\color[rgb]{0.627,0.126,0.941},
    numberstyle=\color[rgb]{0.205, 0.142, 0.73},
}
\lstset{
    backgroundcolor=\color{lbcolor},
    tabsize=4,
    language=C++,
    captionpos=b,
    tabsize=3,
    frame=lines,
    numbers=left,
    numberstyle=\tiny,
    numbersep=5pt,
    breaklines=true,
    showstringspaces=false,
    basicstyle=\footnotesize,
    keywordstyle=\color[rgb]{0,0,1},
    commentstyle=\color{Darkgreen},
    stringstyle=\color{red},
}
\lstset{
    morekeywords={__global__},
    alsoletter={.},
    morekeywords={blockDim.x},
    morekeywords={blockIdx.x},
    morekeywords={threadIdx.x}
}

\usepackage{babel}
\begin{document}
\tableofcontents{}

\chapter*{Implementation/Kernels of formats}

\addcontentsline{toc}{chapter}{Implementation/Kernels of formats}

\setcounter{chapter}{3}
\setcounter{section}{0}

\section{DIAG Kernel}

\begin{lstlisting}[caption= SpMV pseudocode using DIAG format for storing a matrix from \textit{Efficient sparse matrix-vector multiplication on CUDA} \cite{Bell-Garland}.]
__global__ void
spmv_dia_kernel ( const int num_rows,
                        const int num_cols,
                        const int num_diags,
                        const int   * offsets,
                        const float * data,
                        const float * x,
                                float * y )
{
    int row = blockDim.x * blockIdx.x + threadIdx.x;
    if ( row < num_rows ){
          float dot = 0;

          for ( int n = 0; n < num_diags; n++ ){
                  int col = row + offsets[ n ];
                  float val = data[ num_rows * n + row ];

                  if ( col >= 0 && col < num_cols )
                        dot += val * x[ col ];
          }

          y[ row ] += dot;
    }
}
\end{lstlisting}
\label{Code:Diagonal-matrix-example}

\section{COO Kernel}

\begin{lstlisting}[caption= SpMV pseudocode using COO format for storing a matrix \cite{Parallel-Uppsala}.]
__global__ void
spmv_coo_kernel ( const int num_non_zero_elements,
                       const float * data,
                       const int   * row,
                       const int   * col,
                       const float * x,
                               float * y )
{
    int i = blockDim.x * blockIdx.x + threadIdx.x;
    if ( row < num_non_zero_elements )
          y[ row[i] ] += data[i] * x[ col[i] ];
}
\end{lstlisting}

\section{ELL Oriented Kernels}

\subsection{ELL Kernel}

\begin{lstlisting}[caption = SpMV pseudocode using ELL format for storing a matrix from \textit{Efficient sparse matrix-vector multiplication on CUDA} \cite{Bell-Garland}.]
__global__ void
spmv_ell_kernel ( const int num_rows,
                       const int num_cols,
                       const int num_cols_per_row,
                       const int   * indices,
                       const float * data,
                       const float * x,
                            float * y )
{
    int row = blockDim.x * blockIdx.x + threadIdx.x;

    if( row < num_rows ){
         float dot = 0;

         for ( int n = 0; n < num_cols_per_row; n++ ){
                int col = indices[ num_rows * n + row ];
                float val = data[ num_rows * n + row ];

                 if ( val != 0 )
                       dot += val * x[ col ];
         }

         y[ row ] += dot;
    }
}
\end{lstlisting}

\begin{thebibliography}{1}
\bibitem{Bell-Garland}N Bell, M. Garland: \emph{Efficient sparse matrix-vector multiplication on CUDA}. NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation, 1-32, 2008.

\bibitem{Parallel-Uppsala}D. Lukarski: \emph{Sparse Matrix-Vector Multiplication and Matrix Formats}. Parallel Algorithms for Scientific Computing, Uppsala University, 2013. \url{https://www.it.uu.se/education/phd_studies/phd_courses/pasc/lecture-1}
\end{thebibliography}

\end{document}

Aus irgendeinem Grund bibitemsind Zitate zu s nicht definiert, obwohl anscheinend kein Rechtschreibfehler vorliegt.

Um das Dokument überhaupt korrekt zu kompilieren, wenn ich die Änderungen, die zum Fehler geführt haben, rückgängig mache, muss ich die Dateien .auxund löschen .toc.

Ich bin ziemlich sprachlos.

PS: Die Präambel wurde von einem Professor als Vorlage für alle Studenten erstellt, mir wurde gesagt, ich solle daran nichts ändern.

[BEARBEITEN]: Wie vorgeschlagen, wurde ein minimales Beispiel für die Ausgabe desselben Fehlers erstellt.

[BEARBEITEN]: Protokolldatei hinzugefügt.

[EDIT]: GitHub-Link, vollständiger Projektlink und Logdatei-Link entfernt, da sie für die Antwort nicht erforderlich sind. Ich werde sie in einseparater Ordnerund werde sie nicht entfernen, falls jemand sie ansehen möchte. Wenn die Links aus irgendeinem Grund nicht mehr funktionieren, lassen Sie es mich bitte wissen und ich werde sie irgendwie erneuern, da ich auch von den besagten Dateien eine Sicherungskopie anlege.

Antwort1

Die Lösung für dieses Problem bestand darin, mein MiKTeX im Benutzer- und Administratormodus zu aktualisieren, genau wie @UlrikeFischer sagte:

Aktualisieren Sie Ihr Tex-System - vor allem das Listings-Paket. Mit der neuesten Version funktioniert es wieder. (Überprüfen Sie im Benutzer- und Administratormodus, ob Updates verfügbar sind.)

Entschuldigen Sie, dass ich die Antwort gestohlen habe. Ich möchte diese gelöste Frage lediglich schließen und keinen weiteren Spam versenden und bitte daher darum, als Antwort einen Kommentar zu verfassen.

Wenn Sie möchten, dass ich Ihre Antwort akzeptiere, antworten Sie bitte jederzeit und ich werde sie auch akzeptieren.

verwandte Informationen