文字轉到下一行 - 如何保持在同一行?

文字轉到下一行 - 如何保持在同一行?

我的論文封面是這樣的:

論文封面

相關的MWE看起來像這樣(我正在使用模板)

\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
John \textsc{Smith}
% Your name
\href{mailto:[email protected]}{[email protected]}
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
Dr. Cornelius \textsc{Van der Westhuizen}% Supervisor's Name
\href{mailto:[email protected]}{[email protected]}
\end{flushright}
\end{minipage}\\[4cm]

如何將「Westhuizen」的「Huizen」部分移到同一行?

答案1

儘管由於主管的姓名很長而可能需要明確的換行符(雙反斜線),但只需在姓名後面提供一個空格就足夠了:

Dr. Cornelius \textsc{Van der Westhuizen} % Supervisor's Name
\href{mailto:[email protected]}{[email protected]}

當您輸入它時,%緊跟在大括號中的名稱後面的 會導致\href{...}緊緊地綁在名稱的末尾,沒有中斷。 (它也不是一個公認的逗號位置;即使該行被逗號斷開,這也不會是所需的輸出。)

答案2

我認為你應該考慮改變幾件事:

  • 正如其他人已經指出的那樣,第二個小頁面的寬度根本不足以排版整個名稱。將寬度增加到類似0.45\textwidth.

  • ~我建議您不要只用(空格)分隔兩個小頁面,而是使用\hspace{\fill}.這樣,具有兩個名稱的區塊將跨越文字區塊的整個寬度。 (如果您認為這樣做會使兩個名稱相距太遠,請考慮將兩個小型頁面放入一個較大的小型頁面環境(例如 width 0.8\textwidth)中,該環境可以是中心設定的。)

  • 為了佈局對稱,我會在您的電子郵件地址之前添加明確的換行符主管的電子郵件地址。

在此輸入影像描述

\documentclass{article}
\usepackage[margin=1in]{geometry}      % set margins to suit your needs
\usepackage[colorlinks=true]{hyperref} % for \href macro
\begin{document}

\noindent
\begin{minipage}{0.3\textwidth}
\begin{flushleft} 
\large
\emph{Author:}\\
John \textsc{Smith}\\ % Your name
\href{mailto:[email protected]}{[email protected]}
\end{flushleft}
\end{minipage}
\hspace{\fill}
\begin{minipage}{0.45\textwidth}
\begin{flushright} 
\large
\emph{Supervisor:} \\
Dr.\ Cornelius \textsc{Van der Westhuizen}\\ %Supervisor's Name
\href{mailto:[email protected]}{[email protected]}
\end{flushright}
\end{minipage}

\end{document}

答案3

這是一個非常糟糕的快速修復,\usepackage{mathtools}需要該套件。請注意,您\\在他們的名字後面缺少了一個。

\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
John \textsc{Smith}
% Your name
\href{mailto:[email protected]}{[email protected]}
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
\leavevmode\llap{Dr. Cornelius }\textsc{Van der Westhuizen}\\% Supervisor's Name
\href{mailto:[email protected]}{[email protected]}
\end{flushright}
\end{minipage}\\[4cm]

也許只加入缺失的\\就夠了:

\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
John \textsc{Smith}
% Your name
\href{mailto:[email protected]}{[email protected]}
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
Dr. Cornelius \textsc{Van der Westhuizen}\\% Supervisor's Name
\href{mailto:[email protected]}{[email protected]}
\end{flushright}
\end{minipage}\\[4cm]

另外,請發布完整的微量元素下次。

答案4

除了提供的其他答案之外,您還可以將名稱放在框中:

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{hyperref}
\begin{document}

\noindent
\begin{minipage}{0.4\textwidth}
  \begin{flushleft} \large
  \emph{Author:}\\
    John \textsc{Smith}
    % Your name
    \href{mailto:[email protected]}{[email protected]}
  \end{flushleft}
\end{minipage}%%
%%
\hspace*{\fill}%%
%%
\begin{minipage}{0.4\textwidth}
  \begin{flushright} \large
    \emph{Supervisor:} \\
    \makebox[1.5in][r]{Dr. Cornelius \textsc{Van der Westhuizen}}\\% Supervisor's Name
    \href{mailto:[email protected]}{[email protected]}
  \end{flushright}
\end{minipage}\\[4cm]


\end{document}

由於我不知道您的頁面設定是什麼(邊距有多大),這可能會導致外觀過於擁擠。

相關內容