latex 定义带有方括号的command
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!
最新文章
- 概率图模型(PGM)综述
- java tooltip
- 大型高并发高负载网站的系统架构[转载]
- 正确性、健壮性、可靠性、效率、易用性、可读性(可理解性)、可扩展性、可复 用性、兼容性、可移植性
- .NET 反编译工具
- 5.1 大数定律
- HTK初论
- 音乐剧推荐
- mmap。
- python,jsonschema, marshmallow, “None is not of type ‘string‘
- ABAP 设置ALV复选框
- ext4 笔记一(与ext3比较)
- 【TCP专题】TCP的可靠性传输
- SpringBoot 中定时执行注解(@Scheduled、@EnableScheduling)
- R语言实现聚类kmeans
- 最全的静态网站生成器(开源项目)
- 装机、做系统必备:秒懂MBR和GPT分区表
- tomcat守护进程
- ST
- 最详细的SQL注入语句