增加标题页内的迷你页面缩进

增加标题页内的迷你页面缩进

我在使用小页面时遇到了一些问题:我想并排放置两个小页面,以获得类似于链接图像的输出。

LaTeX 代码的输出

supervisors和列reading committee的对齐方式不正确:我希望它们位于标题行末尾(即更靠右)。生成该输出的代码是

\documentclass[12pt, a4paper]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage{lmodern}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{microtype}
\usepackage[margin=2cm]{geometry}
\usepackage[linktocpage=true]{hyperref}
\hypersetup{breaklinks=true}
\usepackage[noabbrev, nameinlink]{cleveref}
\usepackage[hyphens]{xurl}



\begin{document}
    \centering
    \begin{minipage}{\textwidth}
        \hfill\rule{\textwidth}{1pt}
    \end{minipage}
    \begin{minipage}{\textwidth}
        \centering
        \LARGE
        \textbf{Some title}
    \end{minipage}
    \begin{minipage}{\textwidth}
        \hfill\rule{\textwidth}{1pt}
    \end{minipage}

    \vspace{1.5cm}

    \begin{minipage}[t]{0.45\textwidth}
        \raggedright
        \Large{\textit{Author}:}\\
        \href{mailto:[email protected]}{\large{\textsc{Author}}}
    \end{minipage}
    \hfill
    \noindent
    \begin{minipage}[t]{0.45\textwidth}
        \raggedright
        \Large{\textit{Supervisors}:} \\
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\\
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}
    \end{minipage}

    \bigskip

    \begin{minipage}[t]{0.45\textwidth}
    \end{minipage}
    \hfill
    \noindent
    \begin{minipage}[t]{0.45\textwidth}
        \raggedright
        \Large{\textit{Reading committee}:} \\
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\\
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}\\
        \href{mailto:[email protected]}{\large{\textsc{Prof3}}} \href{dep3Link}{(Dep3)}\\
        \href{mailto:[email protected]}{\large{\textsc{Prof4}}} \href{dep4Link}{(Dep4)}
    \end{minipage}

    \vspace{3.5cm}

    \begin{minipage}[b]{\textwidth}
        \centering
        \Large
        Master's thesis carried out to obtain the degree of Master of Science in Electrical Engineering by \href{mailto:[email protected]}{\large{\textsc{Author}}}.\\
        Academic year xxxx-xxxx.
    \end{minipage}
\end{document}

我怎样才能达到想要的结果?

PS:最终,我会将代码包含到一个文件中,titlepage.tex以便将其包含在更大的文档中(我不知道这些信息是否相关)

答案1

minipages只需在标题后并排使用两个即可简化代码。

minipages将不缩进其内容。要缩进主管和阅读委员会列,您可以将缩进设置为任意长度。通过使用\withof{<text>}calc包),您可以将其设置为与\Large{\textit{Supervisors:}}

我认为在两种情况下使用相同的缩进看起来更好(见下文)。

A

\documentclass[12pt, a4paper]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage{lmodern}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{microtype}
\usepackage[margin=2cm]{geometry}
\usepackage[linktocpage=true]{hyperref}
\hypersetup{breaklinks=true}
\usepackage[noabbrev, nameinlink]{cleveref}
\usepackage[hyphens]{xurl}

\usepackage{calc} % added <<<<<<<<<<
\newlength{\Pindent}

\begin{document}
    \centering
    \begin{minipage}{\textwidth}
        \rule{\textwidth}{1pt}
    \end{minipage}
    \begin{minipage}{\textwidth}
        \centering
        \LARGE
        \textbf{Some title}
    \end{minipage}
    \begin{minipage}{\textwidth}
        \rule{\textwidth}{1pt}
    \end{minipage}
    
    \vspace{1.5cm}
    
    \begin{minipage}[t]{0.35\textwidth}
        \raggedright
        \Large{\textit{Author:}}\par% changed <<<<<<
        \href{mailto:[email protected]}{\large{\textsc{Author}}}
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.6\textwidth}% changed <<<<<<
        \Large{\textit{Supervisors:}}% changed <<<<<<
        \setlength{\Pindent}{\widthof{\Large{\textit{Supervisors:}}}}
        {\parindent\Pindent \par
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}}\par
        \medskip
        \Large{\textit{Reading committee:}}
        \setlength{\Pindent}{\widthof{\Large{\textit{Reading committee:}}}} % try this
        {\parindent\Pindent \par    
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof3}}} \href{dep3Link}{(Dep3)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof4}}} \href{dep4Link}{(Dep4)}
        }
    \end{minipage}  
    
    \vspace{3.5cm}
    
    \begin{minipage}[b]{\textwidth}
        \centering
        \Large
        Master's thesis carried out to obtain the degree of Master of Science in Electrical Engineering by \href{mailto:[email protected]}{\large{\textsc{Author}}}.\\
        Academic year xxxx-xxxx.
    \end{minipage}
\end{document}

取消注释该行

\setlength{\Pindent}{\widthof{\Large{\textit{Reading committee:}}}}

你会得到

b

也许标题页的更好替代方案是

C

使用

    \setlength{\Pindent}{\widthof{\Large{\textit{Supervisors:}}}}
    \begin{minipage}[t]{0.5\textwidth}
        \parindent\Pindent 
        \href{mailto:[email protected]}{\large{\textsc{Author}}}
    \end{minipage}
    \vspace{1.5cm}
    
    \begin{minipage}[t]{0.5\textwidth}% changed <<<<<<
        \Large{\textit{Supervisors:}}% changed <<<<<<       
        {\parindent\Pindent \par
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}}\par
        \medskip
        \Large{\textit{Reading committee:}}
        {\parindent\Pindent \par    
        \href{mailto:[email protected]}{\large{\textsc{Prof1}}} \href{dep1Link}{(Dep1)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof2}}} \href{dep2Link}{(Dep2)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof3}}} \href{dep3Link}{(Dep3)}\par
        \href{mailto:[email protected]}{\large{\textsc{Prof4}}} \href{dep4Link}{(Dep4)}
        }
    \end{minipage}  

相关内容