表格后的 Vfill 不起作用

表格后的 Vfill 不起作用

我在顶部有一个表格,想将标题放在页面中间 - 或者用 vspace 放置。但这样做不行。这是我的代码,问题出在第 17 行(vfill 什么也不做)。

\documentclass[a4paper, oneside]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\begin{document}

\begin{table}[t]
   \begin{tabularx}{\textwidth}{|XX|} \hline
    \textbf{Received:}           & \textbf{Approved:}  \\
                              & \textbf{Date:}      \\
                              & \textbf{Signature:} \\
\textbf{(for the instructor)} &
    \\ \hline
  \end{tabularx}
\end{table}

\vfill %Why does this do nothing?

\begin{center}
\begin{minipage}{.6\textwidth}
\begin{center}
\Large{{\itshape Course}\\}
{\fontsize{40}{48} \textsc{\textbf{Title}}}\\
\rule{7.5cm}{0.1cm}\\
\vspace{0.25cm}
\begin{large}
\textsc{%
University\\
Institution\\
\today\\
}%
\vspace{0.25cm}
\rule{3.75cm}{0.1cm}
\end{large}
\end{center}
\end{minipage}
\end{center}

\vfill

Author \hfill E-mail

\end{document}

谨此致以亲切的问候并提前致以谢意。

答案1

table创建浮动。因此在主页中,在 之前没有任何内容\vfill,因此 LaTeX 认为无需填充它。(没有内容可填充。)但是,您可能不希望此处出现浮动:您不希望表格移动。因此不要将其放在 中table

\documentclass[a4paper, oneside]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\begin{document}

\noindent\begin{tabularx}{\textwidth}{|XX|} \hline
\textbf{Received:}           & \textbf{Approved:}  \\
                          & \textbf{Date:}      \\
                          & \textbf{Signature:} \\
\textbf{(for the instructor)} &
\\ \hline
\end{tabularx}

\vfill %Why does this do nothing?


\begin{center}
\begin{minipage}{.6\textwidth}
\centering
{\Large\itshape Course\\}
{\fontsize{40}{48} \textsc{\textbf{Title}}}\\
\rule{\linewidth}{0.1cm}\\
\vspace{0.25cm}
\large
\textsc{%
University\\
Institution\\
\today\\
}%
\vspace{0.25cm}
\rule{3.75cm}{0.1cm}
\end{minipage}
\end{center}

\vfill

Author \hfill E-mail

\end{document}

表格非浮动

相关内容