小页面标题结构问题

小页面标题结构问题

在此处输入图片描述

我无法将标题和日期放在同一行的正确位置,但文档的其余部分可以。我尝试了所有可能的方法调整 \textwidth,但仍然不起作用

\begin{minipage}{1\textwidth}
\begin{flushleft}
    \textbf{Tianjin Foreign Studies University}, French Language and Literature
\end{flushleft}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{flushright}
  \textbf{Sep 11 - Jul 14} \\%[1.1cm]
\end{flushright}
\end{minipage}


\begin{itemize}[leftmargin=0.5in]
\item \textbf{Obtained 93/100} in the graduation thesis
\end{itemize}

答案1

您的示例中的迷你页面合计为 150% 文本宽度,无法放在一行中。结果是您的第二个迷你页面被移至下一行。

只要与 的组合 <= textwidth,它们就会并排放置。作为奖励,您可以使用选项指定小页面的内容应顶部对齐[t]

\documentclass{article}

\begin{document}
\noindent\begin{minipage}[t]{.6\textwidth}
\textbf{Tianjin Foreign Studies University}, 

French Language and Literature
\end{minipage}%
\begin{minipage}[t]{.4\textwidth}
\hfill\textbf{Sep 11 - Jul 14}
\end{minipage}

\end{document}

在此处输入图片描述

答案2

只是补充samcarter 的回答针对评论中提到的情况提供替代方案。

迷你页面似乎是针对标题太长而无法与右侧日期一起显示的情况而设计的。但在这种不会发生这种情况的情况下,\hfill可以使用更简单的替代方案,效果相同。

\documentclass{article}

\begin{document}
\textbf{Tianjin Foreign Studies University} \hfill \textbf{Sep 11 - Jul 14}
\end{document}

在此处输入图片描述

如果标题太长,可能需要使用 minipage。只要您注意缩进(可能已经在文档中完成了)和两个 minipage 之间的间距,就可以将它们设置为恰好等于一个文本宽度,这样可以简化操作。

\documentclass{article}

\begin{document}
\noindent % <-- if your document doesn't set this globally you should add it, otherwise you will have less than 1 textwidth available
\begin{minipage}[t]{.6\textwidth}
\textbf{Tianjin Foreign Studies University}, French Language and Literature
\end{minipage}% <-- notice the percent sign, so there is no space between minipages, otherwise you will have less than 1 textwidth available
\begin{minipage}[t]{.4\textwidth}
\hfill\textbf{Sep 11 - Jul 14} % here `\hfill` substitutes your `flushright` environment
\end{minipage}
\end{document}

在此处输入图片描述

相关内容