程序包数组错误:非法前置令牌

程序包数组错误:非法前置令牌

我收到以下错误:

Package array Error: Illegal pream-token (\renewcommand): `c' used \renewcommand

当我运行最小工作示例时:

\documentclass{article}

\usepackage{hyperref}
% The hy­per­ref pack­age is used to han­dle cross-ref­er­enc­ing com­mands in LATEX to pro­duce hy­per­text links in the doc­u­ment.

\usepackage[margin=0.5in]{geometry}

\usepackage{array}

\usepackage{lscape}
% For pages in landscade mode

\usepackage{longtable}
% For tables stretching over multiple pages

\begin{document}

\begin{landscape}

\begin{longtable}
    \small
    \centering
    \renewcommand{\arraystretch}{1.2}
    \begin{tabular}{|>{}m{2in} |>{}m{3.5in} | >{}m{0.8in}| >{}m{0.3in} |>{}m{0.7in} | } \hline
    \textbf{Author(s)} & \textbf{Title} & \textbf{Type} & \textbf{Year} & \textbf{Cited-by} \\ \hline
    F.M. Cardullo, A.V. Ercole, J.A. Houck, L.C. Kelly &
    {A}lgorithm for {S}imulating {A}tmospheric {T}urbulence and {A}eroelastic {E}ffects on {S}imulator {M}otion {S}ystems &
    techreport &
    2012 & 
    ~ \\ \hline

    \end{tabular}
\end{longtable}

\end{landscape}

\end{document}

答案1

您不应该tabular在里面有一个longtable,列规范应该直接添加到中longtable

\documentclass{article}

\usepackage{hyperref}
% The hy­per­ref pack­age is used to han­dle cross-ref­er­enc­ing com­mands in LATEX to pro­duce hy­per­text links in the doc­u­ment.

\usepackage[margin=0.5in]{geometry}

\usepackage{array}

\usepackage{lscape}
% For pages in landscade mode

\usepackage{longtable}
% For tables stretching over multiple pages

\begin{document}

\begin{landscape}
    \small
    \centering
    \renewcommand{\arraystretch}{1.2}
\begin{longtable}{|>{}m{2in} |>{}m{3.5in} | >{}m{0.8in}| >{}m{0.3in} |>{}m{0.7in} | }
\hline
    \textbf{Author(s)} & \textbf{Title} & \textbf{Type} & \textbf{Year} & \textbf{Cited-by} \\ \hline
    F.M. Cardullo, A.V. Ercole, J.A. Houck, L.C. Kelly &
    {A}lgorithm for {S}imulating {A}tmospheric {T}urbulence and {A}eroelastic {E}ffects on {S}imulator {M}otion {S}ystems &
    techreport &
    2012 & 
    ~ \\ \hline
\end{longtable}

\end{landscape}

\end{document}

相关内容