下面是我正在处理的 latex 示例,它应该生成两个表。一个表有两列,另一个表只有一列。我有一个软件程序,它使表中的任何单词看起来像#blabla替换为 \textcolor{绿色}{$#blabla$}
但我遇到了错误,问题是什么?
它应该生成一个如下所示的文件
下面是原代码,不知道格式对结果有没有影响,所以就直接复制过来,并贴上图片。
\documentclass[a4paper,leqno,twoside]{article}
\usepackage[utf8]{inputenc}
\title{dd}
\usepackage{amsmath}
\usepackage{color}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{supertabular}
\begin{document}
\maketitle
\section{Introduction}
it is a introduction
\subsection{it is a subsection}
\begin{longtabu} to \textwidth {|>{\footnotesize}X[1 , p]| X[3 , l ]| } \hline
\endfirsthead
\multicolumn{2}{c}
\endhead
\endfoot \hline
\endlastfoot
sdf \newline \newline & >>Text \newline asdfl \textcolor{green}{$\#lksdjf$} asldkj.\newline
\end{longtabu}
\begin{longtabu} to \textwidth {>{\normalsize}X[p ] }
\endfirsthead \multicolumn{1}{c}
\endhead
\endfoot
\endlastfoot >>Text \newline >>Text
\end{longtabu}
\end{document}
答案1
这是否就是你想要的?经过一番研究,发现了错误
\multicolumn{2}{c}{} % 2 such cases: missing the last {}
$>>$ % 3 such cases: need math environment
代码
\documentclass[a4paper,leqno,twoside]{article}
\usepackage[utf8]{inputenc}
\title{dd}
\usepackage{amsmath}
\usepackage{color}
\usepackage{tabu}
\usepackage{longtable} \usepackage{supertabular}
\begin{document}
\maketitle
\section{Introduction} it is a introduction
\subsection{it is a subsection}
\begin{longtabu} to \textwidth {|>{\footnotesize}X[1 , p]| X[3 , l ]| } \hline
\endfirsthead
\multicolumn{2}{c}{}
\endhead
\endfoot \hline
\endlastfoot
sdf \newline \newline & $>>$Text \newline asdfl \textcolor{green}{$\#lksdjf$} asldkj.\newline
\end{longtabu}
\begin{longtabu} to \textwidth {>{\normalsize}X[p ] }
\endfirsthead
\multicolumn{1}{c}{}
\endhead
\endfoot
\endlastfoot
$>>$Text \newline $>>$Text
\end{longtabu}
\end{document}