Como incluir um \newcommand em \maketitle

Como incluir um \newcommand em \maketitle

Esta é a primeira vez que uso LaTeX e realmente preciso de ajuda. Estou fazendo meu relatório do Seminário da Faculdade.

Não consigo fazer o novo comando \namesigaparecer na página de título.

insira a descrição da imagem aqui

Aqui está o .texcódigo

\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}

Eu sei que existem muitos posts anteriores bastante semelhantes a este, mas não consigo combinar os códigos-fonte corretamente.

Além disso, sugira-me onde posso encontrar códigos-fonte específicos para minhas necessidades, ou seja, uma documentação ou livro de texto onde posso encontrar os códigos-fonte com uma pequena explicação.

Responder1

Você pode simplesmente redefinir \maketitlepara fazer o que precisa:

insira a descrição da imagem aqui

\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}

Responder2

Com a ajuda do titlepagemeio ambiente você pode conseguir algo assim. É claro que você pode ajustar tamanhos de fonte, alinhamentos e distâncias de acordo com suas necessidades:

insira a descrição da imagem aqui

\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}

informação relacionada