这是我第一次使用 LaTeX,我真的需要帮助。我正在做大学研讨会报告。
我无法让新命令\namesig
出现在标题页上。
以下是.tex
代码
\documentclass[a4 paper,12pt]{report}
\usepackage[hmargin=4.5cm,
vmargin=4.5cm]{geometry}
%%Name of the Title and subtitle
\title{%
The uIP Stack \\
\large A Small Memory Footprint TCP/IP Stack for Microcontrollers\\
}
%% First Page of the Report
\author{Mohammad Arshad Ali \\
{ECE-A}\\
{B.E. 4/4}\\
{2451-15-735-040}\\
}
%% Signature of the Guide
\newcommand{\namesig}[2][5cm]{%
\begin{tabular}{@{}p{#1}@{}}
#2 \\[2\normalbaselineskip] \hrule \\[0pt]
{\small \textit{Signature}}
\end{tabular}
}
\begin{document}
\maketitle
\noindent \namesig{Dr. K. Usha}\hfill \namesig{Sudhir Dakey}
\end{document}
我知道以前有很多帖子与此非常相似,但我无法正确结合源代码。
还请建议我,在哪里可以找到符合我的要求的源代码,即文档或教科书,我可以在其中找到带有一些解释的源代码。
答案1
您可以重新定义\maketitle
以执行您需要的操作:
\documentclass[a4 paper,12pt]{report}
\usepackage[hmargin=4.5cm,
vmargin=4.5cm]{geometry}
%%Name of the Title and subtitle
\title{%
The uIP Stack \\
\large A Small Memory Footprint TCP/IP Stack for Microcontrollers\\
}
%% First Page of the Report
\author{Mohammad Arshad Ali \\
{ECE-A}\\
{B.E. 4/4}\\
{2451-15-735-040}
}
%% Signature of the Guide
\newcommand{\namesig}[2][5cm]{%
\begin{tabular}{@{}p{#1}@{}}
#2 \\[2\normalbaselineskip] \hrule \\[0pt]
{\small \textit{Signature}}
\end{tabular}
}
\makeatletter
\renewcommand{\maketitle}{
\begin{center}
\pagestyle{empty}
\phantom{.} %necessary to add space on top before the title
\vspace{3cm}
{\Huge \bf \@title\par}
\vspace{2.5cm}
{\LARGE \@author}\\[1cm]
{\Large\@date}
\vspace{4.5cm}
\noindent \namesig{Dr. K. Usha}\hfill \namesig{Sudhir Dakey}
%if you want something in the bottom of the page just use /vfill before that.
\end{center}
}\makeatother
\begin{document}
\maketitle
\end{document}
答案2
借助titlepage
环境,您可以实现类似这样的效果。当然,您可以根据需要调整字体大小、对齐方式和距离:
\documentclass[a4 paper,12pt]{report}
\usepackage[hmargin=4.5cm,vmargin=4.5cm]{geometry}
\newcommand{\namesig}[2][5cm]{%
\begin{tabular}{@{}p{#1}@{}}
#2 \\[2\normalbaselineskip] \hrule \\[0pt]
{\small \textit{Signature}}
\end{tabular}
}
\begin{document}
\begin{titlepage}
\centering
\vspace*{2cm}
\LARGE The uIP Stack
\large A Small Memory Footprint TCP/IP Stack for Microcontrollers
\vspace{2cm}
Mohammad Arshad Ali \\
{ECE-A}\\
{B.E. 4/4}\\
{2451-15-735-040}\\
\vspace{1cm}
\today
\vspace{5cm}
\namesig{Dr. K. Usha}\hfill \namesig{Sudhir Dakey}
\end{titlepage}
\end{document}