Redian新闻
>
how to make a newcommand for verbatim
avatar
how to make a newcommand for verbatim# TeX - TeX电子排版系统
yy
1
I tried to alias a newcommand for verbatim like:
\newcommand{\bev}{\begin{verbatim}}
\newcommand{\eev}{\end{verbatim}}
I don't know why the latex seems not recognize this newcommand at all?
Am I missing something?
Thanks,
avatar
T*n
2
You can't to that.
\begin{verbatim} puts TeX's tokenizer in a special mode
where each charcter becomes a token (instead of commands
like "\whatever" being read in as a single token), and it obeys
spaces and obeys line breaks, and no longer understands the
meaning of other characters. The only way to kick itself out
of this mode is for it to run across the exact token sequence
(string) "\end{verbatim}". So the "\end{verbatim}" isn't really an
end-environment command here, it's a dumb text strin

【在 yy 的大作中提到】
: I tried to alias a newcommand for verbatim like:
: \newcommand{\bev}{\begin{verbatim}}
: \newcommand{\eev}{\end{verbatim}}
: I don't know why the latex seems not recognize this newcommand at all?
: Am I missing something?
: Thanks,

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。