名前: Th\'or 日時: 2006-09-12 19:16:39 IPアドレス: 210.225.229.*
>>44824 カウンタを新設する方法でよければ,次のような方法でも 見た目は大丈夫だと思います. \newcounter{bashcnt}[chapter] \makeatletter \def\thebashcnt{\@arabic\c@chapter.\@arabic\c@bashcnt} \long\def\@makecaption#1#2{{\small \advance \leftskip by 1cm \advance \rightskip by 1cm \vskip = \abovecaptionskip \sbox\@tempboxa{#1\hskip1zw\relax #2}% \ifdim \wd\@tempboxa <\hsize \centering \fi #1\relax \hskip1zw\relax #2\par% added \relax after #1 \vskip \belowcaptionskip}} \makeatother \renewcommand{\lstlistingname}{リスト} \lstnewenvironment{C}[2]{% \lstset{% caption={#1}, label={src:#1}, float=#2, language=C, <云々>}}{} \lstnewenvironment{bash}[2]{% \refstepcounter{bashcnt}% added stepcounter `bashcnt' \lstset{% title={実行例~\thebashcnt\quad #1の実行結果},% changed to title from caption label={run:#1}, float={#2}, captionpos=b, language=bash, <云々>}}{}
この書き込みへの返事: