使用 longtable 的几个问题

使用 longtable 的几个问题

我对 LaTeX 还很陌生,但我喜欢它的排版清晰度,并且我正在使用它来创建一些几何图形的 pdf,与科学写作无关。

现在我正在处理一些李萨如图形,我想要一些包含大量李萨如图形的页面来探索不同的参数。对于绘图,我使用 TikZ 包。我使用.texPython 脚本生成所有代码。

如果您有更好的解决方案,longtable请提供建议,我只是一个新用户。

首先,我想要自动间距:如果我尝试在一行中放置 20 个数字,表格会超出页面,我必须手动更改参数[scale=0.2]\begin{tikzpicture}这很烦人。

然后我想让表格不居中,而是填满整个页面,但我不知道该怎么做。我希望这个截图能更好地解释:

在此处输入图片描述

这是我的 TeX 代码(仅包含我认为重要的部分):

\documentclass{article}
\usepackage{tikz}
\usepackage{longtable}

\begin{document}
\begin{center}
    \bf{\Huge{ Lissajous figures \\ }}
\end{center}

\begin{longtable}{llllllllllllllllllll}
\begin{tikzpicture}[scale=0.2]
\draw (0.0,0.0) -- (0.32,0.32);
\draw (0.32,0.32) -- (0.61,0.61);
...
\draw (-0.61,-0.61) -- (-0.32,-0.32);
\draw (-0.32,-0.32) -- (0.0,0.0);
\end{tikzpicture}

&
\begin{tikzpicture}[scale=0.2]
\draw (0.0,0.16) -- (0.32,0.47);
\draw (0.32,0.47) -- (0.61,0.73);
...
\draw (-0.61,-0.47) -- (-0.32,-0.16);
\draw (-0.32,-0.16) -- (0.0,0.16);
\end{tikzpicture}



\\
\hfill
\end{longtable}

\end{document}

答案1

我不知道你是如何生成图表的,所以我用小块替换了它们。我使用包rotating来提供sidewaystable环境,这让 – 令人惊讶的是 – 出现了一个横向表格!

这些小块的左上角被切掉了,所以你可以看到它们是侧面显示的。sidewaystable通常会浮动到它自己的页面上。

\documentclass{article}
\usepackage{rotating}
\newcommand\block{\rule{2em}{1em}\llap{\rule{1em}{2em}}}
\begin{document}
\begin{sidewaystable}
  \caption{A sideways table of blocks}
  \begin{tabular}{*{20}{l}}
    \block & \block & \block & \block & \block & \block & \block & \block & \block & Ten    & \block & \block & \block & \block & \block & \block & \block & \block & \block & Twenty \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block \\
    \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block & \block
  \end{tabular}
\end{sidewaystable}
\end{document}

概览

以下是同一文件的详细信息:

细节

相关内容