最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

latex 定义带有方括号的command

IT培训 admin 1浏览 0评论

latex 定义带有方括号的command

来源:

方括号中的参数其实就是默认参数。
使用方法:

\newcommand{name}[num][default]{definition}

例子:

\newcommand{\wbalTwo}[2][Wikimedia]{This is the Wikibook about LaTeXsupported by {#1} and {#2}!}
% in the document body:
\begin{itemize}
\item \wbalTwo{John Doe}
\item \wbalTwo[lots of users]{John Doe}
\end{itemize}

输出:

    This is the Wikibook about LaTeX supported by Wikimedia and John Doe!This is the Wikibook about LaTeX supported by lots of users and John Doe!

latex 定义带有方括号的command

来源:

方括号中的参数其实就是默认参数。
使用方法:

\newcommand{name}[num][default]{definition}

例子:

\newcommand{\wbalTwo}[2][Wikimedia]{This is the Wikibook about LaTeXsupported by {#1} and {#2}!}
% in the document body:
\begin{itemize}
\item \wbalTwo{John Doe}
\item \wbalTwo[lots of users]{John Doe}
\end{itemize}

输出:

    This is the Wikibook about LaTeX supported by Wikimedia and John Doe!This is the Wikibook about LaTeX supported by lots of users and John Doe!

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论