Longtable 错误

Longtable 错误

当我编译 latex 时,我遇到了各种错误。无论我尝试更改代码中的哪些内容,我都会遇到几个不同的错误。我已经这样做了大约一周,所以我可能需要帮助来解决这个问题。希望有人能来帮我清理表格,并帮助将其变成我其余表格的工作示例。

Runaway argument?
{\tablename \ \thetable \ -- \textit {Continued from previous page} \\\ETC.
! File ended while scanning use of \multicolumn.
<inserted text>
            \par
l.21 \input{"KCMPlusUserGuideSource.tex"}

这是源文本文件:

\usepackage{longtable}
\documentclass{article}
\begin{document}
<!--                        
\begin{longtable}{|p{2cm}|p{3cm}|p{2cm}|}
\hline
\caption{A simple longtable example}
\label{hello} \\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} \\
\hline
\endfirsthead
\multicolumn{3}{c}% 
{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} \\
\hline
\endhead
\hline \multicolumn{3}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
show            & true, false                                               & Whether or not to draw the series. \\ \hline
xaxis           & 'xaxis' or 'x2axis'                                       & Which x axis to use with this series. \\ \hline
yaxis           & 'yaxis' or 'y2axis'                                       & Which y axis to use with this series. \\ \hline
renderer        & \$.jqplot.BarRenderer, \$.jqplot.PieRenderer, \$.jqplot.MeterGaugeRenderer & A class of a renderer which will draw the series. \\ \hline
rendererOptions & {a,b,c...}                                                & Options to pass on to the renderer. \\ \hline
label           & 'label'                                                   & Line label to use in the legend. \\ \hline
showLabel       & true, false                                               & True to show label for this series in the legend. \\ \hline
color           &                                                           & CSS color spec for the series. \\ \hline
lineWidth       & n                                                         & Width of the line in pixels.  \\ \hline
lineJoin        & 'round'                                                   & Canvas lineJoin style between segments of series. \\ \hline
lineCap         & 'round'                                                   & Canvas lineCap style at ends of line. \\ \hline
shadow          & true, false                                               & Whether or not to draw a shadow on the line. \\ \hline
shadowAngle     & n                                                         & Shadow angle in degrees. \\ \hline
shadowOffset    & n                                                         & Shadow offset from line in pixels. \\ \hline
shadowDepth     & n                                                         & Number of times shadow is stroked, each stroke offset shadowOffset from the last. \\ \hline
shadowAlpha     & n                                                         & Alpha channel transparency of shadow.  0 = transparent. \\ \hline
\end{longtable}
-->
\end{document}

以下是序言:

\NeedsTeXFormat{LaTeX2e}

\newcommand{\titleinfo}{Default Title - should be overridden} 
\newcommand{\authorinfo}{The Kildrummy Corporation Limited} 
\newcommand{\releaseinfo}{Release 1.2}
\newcommand{\copyrightinfo}{Copyright \copyright \ \the\year \ The Kildrummy Corporation Limited}
\newcommand{\versioninfo}{Version: 0}

\title{\titleinfo} 
\author{\releaseinfo \\ \\ \authorinfo}

\usepackage[pdftex]{graphicx}
\usepackage{tabulary}
\usepackage{booktabs}
\usepackage{paratype}
\usepackage[titletoc]{appendix}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage{longtable}
\usepackage{graphicx}

\let\oldsection\section 
\renewcommand{\section}{\clearpage\oldsection} 

\setlength{\textwidth}{6.2in}
\addtolength{\voffset}{-5pt}
\addtolength{\hoffset}{-27pt}
\setlength{\marginparwidth}{20pt}
\setlength{\marginparsep}{5pt}

\renewcommand*\rmdefault{ptm}\normalfont\upshape
\renewcommand*\sfdefault{ptm}\normalfont\upshape
\renewcommand*\ttdefault{ptm}\normalfont\upshape

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{\slshape \rightmark}

\lhead[\fancyplain{}{\footnotesize \titleinfo}]{\fancyplain{}{\footnotesize \titleinfo}}
\rhead[\fancyplain{}{\releaseinfo}]       {\fancyplain{}{\releaseinfo}}
\lfoot[\fancyplain{}{\footnotesize \copyrightinfo}]{\fancyplain{}{\fancyplain{}{\footnotesize \copyrightinfo}}}
\cfoot[\fancyplain{}{}]{\fancyplain{}{}}
\rfoot[\fancyplain{}{\thepage}]{\fancyplain{}{\thepage}}

\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand*\familydefault{\sfdefault}

任何帮助表示感谢

答案1

您的文档(最后一次编辑之后)的顺序错误,\usepackage并且\documentclassXML 注释语法不正确,<!--我不认为它会产生您发布的错误消息,该消息来自另一个文档。

\documentclass{article}
\usepackage{longtable}

\begin{document}

\begin{longtable}{|p{2cm}|p{3cm}|p{2cm}|}
\hline
\caption{A simple longtable example}
\label{hello} \\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} \\
\hline
\endfirsthead
\multicolumn{3}{c}% 
{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} \\
\hline
\endhead
\hline \multicolumn{3}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
show            & true, false                                               & Whether or not to draw the series. \\ \hline
xaxis           & 'xaxis' or 'x2axis'                                       & Which x axis to use with this series. \\ \hline
yaxis           & 'yaxis' or 'y2axis'                                       & Which y axis to use with this series. \\ \hline
renderer        & \$.jqplot.BarRenderer, \$.jqplot.PieRenderer, \$.jqplot.MeterGaugeRenderer & A class of a renderer which will draw the series. \\ \hline
rendererOptions & {a,b,c...}                                                & Options to pass on to the renderer. \\ \hline
label           & 'label'                                                   & Line label to use in the legend. \\ \hline
showLabel       & true, false                                               & True to show label for this series in the legend. \\ \hline
color           &                                                           & CSS color spec for the series. \\ \hline
lineWidth       & n                                                         & Width of the line in pixels.  \\ \hline
lineJoin        & 'round'                                                   & Canvas lineJoin style between segments of series. \\ \hline
lineCap         & 'round'                                                   & Canvas lineCap style at ends of line. \\ \hline
shadow          & true, false                                               & Whether or not to draw a shadow on the line. \\ \hline
shadowAngle     & n                                                         & Shadow angle in degrees. \\ \hline
shadowOffset    & n                                                         & Shadow offset from line in pixels. \\ \hline
shadowDepth     & n                                                         & Number of times shadow is stroked, each stroke offset shadowOffset from the last. \\ \hline
shadowAlpha     & n                                                         & Alpha channel transparency of shadow.  0 = transparent. \\ \hline
\end{longtable}

\end{document}

相关内容