在下面的 MWE 中,我想要一个像这样的命令
\keywords{one \and two \and three foo bar \and four $x^2$-foo}
\documentclass{article}
\title{My title}
\author{My author}
\begin{document}
\maketitle
\begin{abstract}
Lorem ipsum...
\end{abstract}
%\keywords{one \and two \and three foo bar \and four $x^2$-foo}
\section{Introduction}
\end{document}
答案1
\documentclass{article}
\title{My title}
\author{My author}
\newcommand\keywords[1]{%
\begingroup
\let\and\\
\par
\noindent\textbf{Keywords:}\\#1\par
\endgroup
}
\begin{document}
\maketitle
\begin{abstract}
Lorem ipsum...
\end{abstract}
\keywords{one \and two \and three foo bar \and four $x^2$-foo}
\section{Introduction}
\end{document}
答案2
添加定义
\newcommand\keywords[1]%
{\begin{flushleft}
\let\and\\%
\textbf{Keywords:}\\
#1
\end{flushleft}%
}
你的序言。
\documentclass{article}
\newcommand\keywords[1]%
{\begin{flushleft}
\let\and\\%
\textbf{Keywords:}\\
#1
\end{flushleft}%
}
\title{My title}
\author{My author}
\begin{document}
\maketitle
\begin{abstract}
Lorem ipsum...
\end{abstract}
\keywords{one \and two \and three foo bar \and four $x^2$-foo}
\section{Introduction}
\end{document}