Re: longtable環境内の自作カウンタがカウントしない?(解決,感謝)

名前: 長島隆廣
日時: 2006-11-23 20:10:36
IPアドレス: 219.215.44.*

>>45979 多くの皆さんの迅速なご指導に感謝します.ありがとうございました. お陰様で,解決致しました.以下にご報告致します. 自作のスタイルファイル(nagashima.sty)を作り,その中に \newcount\tnctr% \tnctr=0% \def\tnno{\global\advance\tnctr1 \the\tnctr}% と記述し,nagashima.sty を c:/usr/local/share/texmf/tex/tnstyf/nagashima.sty に保存しました.そして \documentclass[a4paper,10pt]{jarticle}% \usepackage{nagashima}% \usepackage[alpine,clock,electronic,geometry,misc,weather]{ifsym}% \usepackage{longtable}% \setlength{\LTcapwidth}{0.9\textwidth}%% キャプションの幅を設定 \begin{document}% \newcommand{\tabtopsp}[1]{\vbox{\vbox to#1{}\vbox to1zw{}}}% % %%%%% 長い表の始まり %%%%% \tabcolsep=1.2em% \setlength{\arrayrulewidth}{0.5pt}% \setlength{\doublerulesep}{2pt}% \renewcommand{\arraystretch}{1.3}% % \begin{longtable}{|r|l|l|l|l|}% (内部省略 {\tnno}) \end{longtable}% \end{document} で {\tnno} の箇所に (1) (2) (3) (4) (5) ... と連番が生成しました. スタイルファイル(nagashima.sty)のなかの \def\tnno{\advance\tnctr1 \the\tnctr}% であったものに \global を追加して \def\tnno{\global\advance\tnctr1 \the\tnctr}% に書き換えて成功しました.ご指導,ご協力,大変ありがとうございました.

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます。適宜改行を入れてください)