在新命令中传递参数,以便可以在整个文档中使用

在新命令中传递参数,以便可以在整个文档中使用

我想要定义一个新命令,这样一旦我将值传递为 ANNEXURE-I,它就应该右对齐、加粗、加下划线,并且字体应该增大。此外,我希望整个文档对齐,这样当我们继续书写时,它会自动转到下一行。我附上了我需要作为输出的图像期望输出 我用 Latex 写了一些东西 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Handling the crossover of intersecting lines
% Author: Steffen Knoll
\documentclass{article}
\usepackage[english]{babel}

% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\begin{document}
\begin{flushright}
\textbf{ANNEXURE-I}
\end{flushright}

\begin{center}
 \textbf{To be executed by team}
\\[6.0ex]
\end{center}
I, .................................................................................... (Name of the candidate)\\ No........................................................... S/D/o...................................\\
resident of.......................................................do hereby 

\newpage
\begin{flushright}
\textbf{ANNEXURE-II}
\end{flushright}

\begin{center}
 \textbf{To be executed by team}
\\[6.0ex]
\end{center}
I, .................................................................................... (Name of the candidate)\\ No........................................................... S/D/o...................................\\
resident of.......................................................do hereby 



\end{document}

答案1

像这样:

% Handling the crossover of intersecting lines
% Author: Steffen Knoll
\documentclass{article}
\usepackage[english]{babel}

% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}

\newcommand{\annex}[1]{%
\begin{flushright}
\large\textbf{\underline{#1}}
\end{flushright}%
}
\begin{document}
\annex{ANNEXURE-I}

\begin{center}
\textbf{To be executed by team}
\\[6.0ex]
\end{center}
I, .................................................................................... (Name of the candidate)\\ No........................................................... S/D/o...................................\\
resident of.......................................................do hereby 

\newpage
\annex{ANNEXURE-II}

\begin{center}
\textbf{To be executed by team}
\\[6.0ex]
\end{center}
I, .................................................................................... (Name of the candidate)\\ No........................................................... S/D/o...................................\\
resident of.......................................................do hereby 

\end{document}

相关内容