Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于自动生成表列表的Latex代码_Latex - Fatal编程技术网

用于自动生成表列表的Latex代码

用于自动生成表列表的Latex代码,latex,Latex,我在latex代码中自动生成表列表时遇到问题。事实上,我是latex新手,我尝试添加\listoftables,还有一些包,如fancyhdr,但我仍然无法实现。下面我给出了一个示例代码,请建议我进行更改 \documentclass{article} \usepackage{amssymb} \usepackage{amsmath} \usepackage{graphicx} \usepackage{fancyhdr} \begin{document} \listoftables

我在latex代码中自动生成表列表时遇到问题。事实上,我是latex新手,我尝试添加\listoftables,还有一些包,如fancyhdr,但我仍然无法实现。下面我给出了一个示例代码,请建议我进行更改

\documentclass{article}

\usepackage{amssymb}
\usepackage{amsmath}
 \usepackage{graphicx}
 \usepackage{fancyhdr}

\begin{document}

 \listoftables
\noindent Test Cases

\noindent Test Case 1

\begin{enumerate}
\item  ID1: Taking input query from user and store raw data

\item  DESCRIPTION: Allow user to provide input from available list of keywords and 
store collected raw data in database.
\end{enumerate}

\begin{tabular}{|p{0.8in}|p{0.9in}|p{0.9in}|p{0.9in}|p{0.9in}|} \hline 
Steps & Input & Expected output & Actual Result & Remarks \\ \hline 
Select the keyword as required & Keyword is given as input for further processing &   
Background process for collecting tweets related to keyword must start & Background  
process for collecting tweets related to keyword is started & Pass \\ \hline 
Store raw tweet data in temporary storage & Raw tweet data collected by background 
process & The raw tweet data must be stored in database & The raw tweet data is stored 
in database & Pass \\ \hline 
\end{tabular}

\textbf{Table 1: Test Case 1}

\noindent \textbf{}

\noindent Test Case 2

\begin{enumerate}
\item  ID2: Processing and displaying collected data

\item  DESCRIPTION: The raw tweets need to be separated, categorized and processed  
tweets are displayed.
\end{enumerate}

\begin{tabular}{|p{0.8in}|p{0.9in}|p{0.9in}|p{0.9in}|p{0.9in}|} \hline 
Steps & Input & Expected output & Actual result & Remarks \\ \hline 
Run background process for sorting tweets & Raw tweets are provided for sorting & 
Tweets must be processed for separating their properties and stored in other tables as  
per attributes & Tweets are processed as per their properties and stored in other 
tables as per attributes  & Pass \\ \hline 
Retrieve tweets from database and show them on user interface & Query for retrieving  
tweets from database  & The tweets must be displayed on user interface with name and 
profile picture of tweeter user who tweeted. & The tweets are displayed on the user 
interface with all expected properties & Pass \\ \hline 
\end{tabular}

\textbf{Table 2: Test Case 2}

\end{document}

一个
表格
仅仅是一个乳胶盒子,可以在任何地方使用;它不代表什么是
表格
,这是您在表格列表(LoT)中放置某些内容时“需要”的第一件事。嗯,从技术上讲,您不需要
,但我马上就要开始了。在您的示例中,您可以使用

\listoftables

...

\begin{table}[ht]
  \begin{tabular}{..}
    ...
  \end{tabular}
  \caption[This is a table]{This is a table that holds valuable information.}
\end{table}

...
这是
\caption
内容的一部分,它进入了这个地段。更具体地说,它是打印在批次中的(可选)第一个参数,或者如果没有指定,则是(强制)第二个参数

请注意,我们已将
表格
包装在
表格
中。后者称为float,它可以在文档中更广泛地使用。如果您想管理此浮动的放置(可能是因为您不喜欢LaTeX决定此浮动的方式),请阅读

强制放置的一种方法是完全避免
表格
(浮动),并使用{table}功能的
\captionof。这使LaTeX误以为它在
(float)中,并允许您设置“常规
\caption
”。tiny提供了类似的功能*。说清楚一点,你可以使用

...

\begin{tabular}{..}
  ...
\end{tabular}\par\nobreak
\captionof{table}[This is a table]{This is a table that holds valuable information.}

...
使用
\par\nobreak
会尝试将
表格
及其关联的
\caption
保持在同一页面上

当然,上述讨论同样适用于
s。也就是说,您可以在文档中的任何位置使用(比如)
\includegraphics[…]{…}
,但您需要为该
图使用适当的
\caption
(或
\captionof
)才能将其纳入图列表(LoF)


*无论是
caption
还是
capt of
都受到了这样一个事实的困扰:它会更新
\@captype
,但永远不会重置它。因此,最好提供一些使用
\captionof
的范围,比如
\begingroup
\endgroup
\endgroup

,而不是大量使用它