|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
|||||||||||||||||||||||||||||||||||||||||||||||||||
2005年01月11日(火) 旧暦 [n年日記] [更新:"2005/01/11 16:01:39"]#1 [LaTeX][TeX] listinginput\usepackage{moreverb}とすると、その名前の譜から読んで、行番号付のリストを印刷する。 この行番号の付かないものが欲しかった。特にマクロの中で 呼ぶので verbatim は使えない。 /usr/pkg/share/texmf/tex/latex/misc/moreverb.sty を moreverba.sty という名前で写して、さらにその中で、 \def\listinginput の定義部をそっくり写して 一部の名前に a を付け \listinginputa[1]{1}{hoge/constant.s}としたら使えるようになった。番号付のものも同時に使う必要がある という条件での話。 --- moreverb.sty 2005-01-11 13:05:17.000000000 +0900 +++ moreverba.sty 2005-01-11 13:25:36.000000000 +0900 @@ -13,7 +13,7 @@ %% (at your convenience) any later version. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moreverb} +\ProvidesPackage{moreverba} [1997/12/07 v2.2d.2 `more' verbatim facilities% ] @@ -128,6 +128,36 @@ \@doendpe }% } +\def\listinginputa{% + \@ifnextchar[%] + {\@listinginputa}% + {\@listinginputa[1]}} +\begingroup + \catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N + \lowercase{\endgroup + \def\@listinginputa[#1]#2#3{\begingroup + \global\listing@line=#2 + \gdef\listing@step{#1\relax} + \tab@size=\verbatimtabsize + \def\verbatim@processline{\tab@position\tab@size + %\thelisting@line \global\advance\listing@line1 + \toks@{}% + \expandafter\verbatim@tabexpand\the\verbatim@line\@nil}% + \@verbatim\frenchspacing\@vobeyspaces\@vobeytabs + \def\verbatim@addtoline##1~{% + \verbatim@line\expandafter{\the\verbatim@line##1}}% + \openin\verbatim@in@stream=#3 + \ifeof\verbatim@in@stream + \PackageWarning{moreverb}{No file #3.}% + \else + \do@verbatimtabinput + \closein\verbatim@in@stream + \fi + \endtrivlist\endgroup + \@doendpe + }% +} + \def\verbatimcmd{% \PackageError{moreverb}{The verbatimcmd environment is obsolete}% {Use alltt (from the LaTeX base package分類は TeX にするべきか LaTeX にするべきか ? ( つっこみ )
|
最近の日記 2025年02月13日 ・dvipdfmx ICC profile format spec. version 4.3.0 2025年01月29日 ・ham/wsjtx 2025年01月27日 ・wip/wsjtx 5.4.2 2025年01月25日 ・ham/wsjtx 2025年01月15日 ・今更 advent calendar | ||