\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

enironment 의 도움으로 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}

관련 정보