与独立版和预览版有何区别?

与独立版和预览版有何区别?

我有一张表格,但为了整洁(我会在论文和演讲中使用该图),我想将其编译为单个 PDF 并将其包含includegraphics在内,而不是在论文中呈现表格。

在论文中,它渲染得很好。我使用了以下选项:

\documentclass[11pt,twocolumn]{article}
\usepackage{graphicx}
\usepackage[margin=1in]{geometry}

但是,当我将表格移动到带有standalone预览的文档中时,图形对于页面来说太大了。当然,我仍然可以在 paper.tex 中自己的表格中简单地渲染图形,但我想弄清楚为什么会发生这种情况。你能弄清楚吗?

以下是预览文档:

\documentclass[preview=true]{standalone}

\usepackage{standalone}
\usepackage{rotating}
\usepackage{array}

\usepackage{graphicx}
\usepackage{multirow}

\pagestyle{empty}

\begin{document}

\begin{tabular}{m{0.1in}m{1.4in}m{1.4in}m{1.4in}m{1.4in}m{1.4in}}
  &
\multirow{3}{*}{\begin{minipage}{1.4in}\centering {\bf (a)} Control-control densities \end{minipage}} &
 % 1.4 * 3
 \multicolumn{3}{c}{ \begin{minipage}{4.2in}\centering {\bf (b)} Case-control vs. control-control log densities \end{minipage} } \\
 & & \multicolumn{3}{c}{ \begin{minipage}{4.2in}\centering {\includegraphics[width=4.2in]{colorbar.pdf}} \end{minipage} }\\

 & & \begin{minipage}{1.4in} \centering {0 differential} \end{minipage} & \begin{minipage}{1.4in} \centering {53 differential} \end{minipage} & \begin{minipage}{1.4in} \centering {302 differential} \end{minipage}\\

 \begin{sideways}Replicate 1\end{sideways} & 
  \includegraphics[width=1.4in]{null_1-crop.pdf} &
  \includegraphics[width=1.4in]{rep_1_0-crop.pdf} &
  \includegraphics[width=1.4in]{rep_1_53-crop.pdf} &
  \includegraphics[width=1.4in]{rep_1_302-crop.pdf} \\

 \begin{sideways}Replicate 2\end{sideways} & 
  \includegraphics[width=1.4in]{null_2-crop.pdf} &
  \includegraphics[width=1.4in]{rep_2_0-crop.pdf} &
  \includegraphics[width=1.4in]{rep_2_53-crop.pdf} &
  \includegraphics[width=1.4in]{rep_2_302-crop.pdf} \\
\end{tabular}

\end{document}

答案1

啊——是这句:

\usepackage[margin=1in]{geometry}

将其添加到独立文档即可达到目的。

答案2

当我删除表格后面的空行或删除选项previewstandalonev1.x)时,问题就消失了。请参阅独立包创建固定宽度的页面这解释了为什么会出现这种preview情况。因此,我认为您的问题与该问题重复,并将很快将其关闭。不过,我想在此之前为您发布更正后的代码。请在下面找到它。

请注意,您也不需要加载standalone 包裹只要您不想包含其他standalone文档。请不要再使用旧的 LaTeX 2.0 字体宏\bf。请参阅使文本加粗/斜体的“正确”方法是什么?寻求解释。

\documentclass[preview]{standalone}

\usepackage{rotating}
\usepackage{array}

\usepackage{graphicx}
\usepackage{multirow}

\begin{document}
\begin{tabular}{m{0.1in}m{1.4in}m{1.4in}m{1.4in}m{1.4in}m{1.4in}}
  &
\multirow{3}{*}{\begin{minipage}{1.4in}\centering {\bfseries (a)} Control-control densities \end{minipage}} &
 % 1.4 * 3
 \multicolumn{3}{c}{ \begin{minipage}{4.2in}\centering {\bfseries (b)} Case-control vs. control-control log densities \end{minipage} } \\
 & & \multicolumn{3}{c}{ \begin{minipage}{4.2in}\centering {\includegraphics[width=4.2in]{example-image.pdf}} \end{minipage} }\\

 & & \begin{minipage}{1.4in} \centering {0 differential} \end{minipage} & \begin{minipage}{1.4in} \centering {53 differential} \end{minipage} & \begin{minipage}{1.4in} \centering {302 differential} \end{minipage}\\

 \begin{sideways}Replicate 1\end{sideways} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} \\

 \begin{sideways}Replicate 2\end{sideways} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} &
  \includegraphics[width=1.4in]{example-image.pdf} \\
\end{tabular}
\end{document}

相关内容