\maketitle に \newcommand を含める方法

\maketitle に \newcommand を含める方法

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}

関連情報