Latex \newcommand for \end{verbatim} et.al not working -
i'm trying make latex usable, introducing timesavers, i'm having trouble defining new commands terminate environments, @ random.
this works:
\newcommand{\bcv}{\ensuremath{\begin{smallmatrix}}} \newcommand{\ecv}{\ensuremath{\end{smallmatrix}}} \newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}
this not work:
\newcommand{\bal}{\begin{align*}}
\newcommand{\eal}{\end{align*}}
\newcommand{\verbass}[1]{\begin{verbatim} #1 \end {verbatim}}
specifically, think \end value ignored?
when try use \verbass{halp} error: !file ended while scanning use of \@xverbatim.
obviously can use \begin{foo} ... \end{foo} @ locations needed, really, should work!
how \begin{verbatim} works. briefly , roughly.
\begin{verbatim}expanded\verbatim.- then
\verbatimsets category code of each characters 11. chars letters. - then
\verbatimsets font, parindent , calls\@xverbatim. \@xverbatimcatches end of verbatim using following trick:\def\@xverbatim#1\end{#1\end}then \end{verbatim} finishes work.
how \newcommand{\verbass}[1]{\begin{verbatim} #1 \end {verbatim}} work.
- first of
\verbass{halp}reads argument. #1 --> halp\verbassexpands\begin{verbatim} halp \end {verbatim}. important: backslash of\endhas category 0 rather 11.{,}have categories 1 , 2 rather 11.- then
\begin{verbatim}expands\varbatim.\varbatimchanges categories , font. (important) category of backslash (in\end) remains equal 0. - then
\verbatimcalls\@xverbatim. \@xverbatimtries catch argument using following trick:\def\@xverbatim#1\end{#1\end}but impossible because of
\@xverbatimtries catch\endletters (\,e,n,d) have category 11. in fact there 4 letters other category code:\category 0 ,e,n,dcategory 11.\@xverbatimtrying , trying find\endbackslash (\) has category 11 but....file ended while scanning use of \@xverbatim
Comments
Post a Comment