Skip to content

Instantly share code, notes, and snippets.

@astronasutarou
Created January 17, 2014 09:34
Show Gist options
  • Save astronasutarou/8470641 to your computer and use it in GitHub Desktop.
Save astronasutarou/8470641 to your computer and use it in GitHub Desktop.
deluxetable.sty で cont'd な table を List of Tables に載せない,かつ label の多重定義を起こさないようなハック
diff --git a/deluxetable.sty b/deluxetable.sty
index *******..******* ******
@@ -127,7 +127,13 @@
\pt@ncol=#1\relax
\global\let\pt@addcol\@empty
}%
-\newcommand\tablecaption[1]{\gdef\pt@caption{#1}}%
+\newcommand\tablecaption[1]{%
+ \gdef\pt@caption{#1}%
+ \gdef\pt@short@caption{#1}%
+}%
+\newcommand\tablelabel[1]{%
+ \gdef\pt@label{#1}%
+}%
\newcommand\tablehead[1]{%
\gdef\pt@head{%
\hline\hline
@@ -153,6 +159,8 @@
\newcommand\tableheadfrac[1]{\gdef\pt@headfrac{#1}}%
\AtBeginDocument{%
\let\pt@caption\@empty
+ \let\pt@short@caption\@empty
+ \let\pt@label\@empty
\let\pt@head\@empty
\let\pt@tail\@empty
\pt@width\textwidth
@@ -279,7 +287,9 @@
\def\start@pt@tabular{%
\@plano@float
\center
- \expandafter\caption\expandafter{\pt@caption}%
+ \expandafter\caption\expandafter[\pt@short@caption]{\pt@caption}%
+ \@ifx@empty\pt@label{}{%
+ \expandafter\label\expandafter{\pt@label}}%
\pt@typesize%AO-type sizes in deluxetable
\expandafter\@tabular\expandafter{\pt@format}%
}%
@@ -332,7 +342,9 @@
\endcenter
\end@plano@float
\clearpage
\addtocounter{table}{\m@ne}%
+ \let\pt@short@caption\empty
+ \let\pt@label\empty
\let\fnum@table=\fnum@ptablecont
\let\@makecaption\@makecaption@plano@cont
\global\pt@ncol=\pt@column% Either 0 or value of \tablecolumns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment