我想在latex文档中的\newcommand
定义中使用\path
命令。然而,我的定义并不像我预期的那样工作。一个最小的例子是 newcommand定义中的Latex path命令不起作用?
\documentclass[12pt]{article}
\usepackage{path}
\newcommand{\code}[1]{\path!{#1}!}
\begin{document}
Testing the path command with: \code{this.texts.should.not.be.typeseted.on.a.single.line}.
Testing the path command with: \path!this.texts.should.not.be.typeseted.on.a.single.line!.
\end{document}
我在定义新命令时犯的错误是什么?
非常有趣的是'\ path'选择使用'!'标记而不是大括号。看起来它会导致问题。我无法检查“de-macro”如何扩展。 – progo 2010-11-11 10:03:04
它适合我。 – 2010-11-11 10:05:59
@progo:分隔符可以任意选择。您也可以使用'+'或字符串中不包含的任何其他符号。 – ladi 2010-11-11 15:25:01