English 中文(简体)
晚餐
原标题:Latex ewcommand for end{verbatim} et.al not working
  • 时间:2010-10-07 16:35:34
  •  标签:
  • latex

我试图通过引入几倍的平均数,使晚期变得可行,但我对确定完全任意终止环境的新指挥感到不安。

This works:
ewcommand{cv}{ensuremath{egin{smallmatrix}}} ewcommand{ecv}{ensuremath{end{smallmatrix}}} ewcommand{e}{egin{enumerate}}
ewcommand{ee}{end{enumerate}}

This does not work:
ewcommand{al}{egin{align*}}
ewcommand{eal}{end{align*}}

ewcommand{verbass}[1]{egin{verbatim} #1 end {verbatim}}

具体而言,我认为最终价值只是被忽视吗?

当我尝试使用<条码>。 我犯了一个错误:! 文件在扫描使用@xverbatim时结束。

显然,我可以在必要时在所有地点使用egin-{foo}......终端{foo},但这确实应当奏效!

问题回答

egin{verbatim} work。 简略扼要。

  1. egin{verbatim} is expanded to verbatim.
  2. Then verbatim sets category code of each characters to 11. Now all chars is letters.
  3. Then verbatim sets font, parindent and calls @xverbatim.
  4. 利用以下trick计达到逐字记录的结尾:

    def@xverbatim#1end{#1end}
    
  5. 然后,结束工作。

How ewcommand{verbass}[1]{egin{verbatim} #1 end {verbatim}} work.

  1. First of all verbass{Halp} reads its argument.
  2. #1 --> Halp
  3. verbass expands to egin{verbatim} Halp end {verbatim}. Important: backslash of end has category 0 rather than 11. Moreover { and } have categories 1 and 2 rather than 11.
  4. Then egin{verbatim} expands to varbatim. varbatim changes all categories and font. But (important) the category of backslash (in end) remains equal to 0.
  5. Then verbatim calls @xverbatim.
  6. 试图利用以下trick计来抓你的论点:

    def@xverbatim#1end{#1end}
    

    but it is impossible because of @xverbatim tries to catch end where all letters (,e,n,d) have the category 11. But in fact there are four letters with other category code: with category 0 and e,n,d with category 11.

  7. @xverbatim is trying and trying to find end where backslash () has category 11 but.... File ended while scanning use of @xverbatim

rel=“nofollow”>here 基本上,LaTeX坚持说,逐字逐字逐字逐字逐字逐句。

我远非专业方案家,但迅速解决的办法可以是:


ewcommand{myverbatim}[1]{egin{tt} detokenize{#1} end{tt} \ }

产出不是很微不足道,因为分界线被忽略。 如果有此愿望,可以重复指挥线(?)。





相关问题
Effective Version Control for Slides

I have to maintain a huge set of training material in forms of slides. At a first glance, I ve noticed there s no support for version control in OpenOffice OOImpress (but I might be wrong on this). ...

Maths in LaTex table of contents

I am trying to add a table of contents for my LaTex document. The issue I am having is that this line: subsubsection{The expectation of (X^2)} Causes an error in the file that contains the ...

Using vim s `gqap sometimes indents unusually

For the life of me, I cannot figure out the cause of this: when writing in LaTeX documents, I like to keep my line width to maximum of 80 characters. As such, I will execute the vim command gqap and ...

aligning math equations in Latex

I am trying to align the following equations around the equal sign. What can I do? Thanks! I am using the AMSMath package $$mddot{x}_{1}-K(x_{2}+x_{12})+C(dot{x}_{12}+dot{x}_{2})+2Cdot{x}_{1} ...

LaTeX output does not update

I have just begun using LaTeX. I am working in Windows and am using TeXnicCenter as my editor. When I build and output, having the following code: documentclass{article} egin{document} This is a ...

How to put line break in a math

I d like to express the following sentence (source_location is also italic, it s not correctly rendered): Each entry has a list of tuple: < source_location, R/W, trip_counter, occurrence, killed ...

热门标签