Graphics, Figures & TablesRedefining the table name (e.g. Supplemental Table)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
volcs0
Posts: 3
Joined: Mon Jul 02, 2012 5:48 am

Redefining the table name (e.g. Supplemental Table)

Post by volcs0 »

I'm using emulategpj to make tables for my manuscript.

http://hea-www.harvard.edu/~alexey/emulateapj

Instead of the title being Table 1, Table 2,
I'd like it to be Supplemental Table 1, Supplemental Table 2, etc.

So, as a kludge, I found that if I go into the emulateapj,cls file and change:

Code: Select all

\if@chicago
 \def\@eapj@cap@font{\scshape}
 \def\@eapj@figname{Fig.}
 \def\@eapj@tabname{TABLE}
\else
 \def\@eapj@cap@font{\bfseries}
 \def\@eapj@figname{Figure}
 \def\@eapj@tabname{Table}
\fi
to

Code: Select all

\if@chicago
 \def\@eapj@cap@font{\scshape}
 \def\@eapj@figname{Fig.}
 \def\@eapj@tabname{SUPPLEMENTAL TABLE}
\else
 \def\@eapj@cap@font{\bfseries}
 \def\@eapj@figname{Figure}
 \def\@eapj@tabname{Table}
\fi
that it works.

But I would rather not touch the cls file, obviously.

So, I'm trying to figure out how to just put something into my .tex file.

I tried something like this:

Code: Select all

\newcommand\startsupplement{%
 \makeatletter 
 \renewcommand\def\@eapj@tabname{SUPPLEMENTAL TABLE}
  \makeatother}
but that doesn't work.

And I tried playing with redefining this line:

Code: Select all

 \def\fnum@table{{\@eapj@cap@font \@eapj@tabname~\thetable}}
which is also from the .cls, but I couldn't figure it out.

I've spent several hours now googling and trying things, so I'm just going to ask the Forum.

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Redefining the table name (e.g. Supplemental Table)

Post by kaiserkarl13 »

Code: Select all

  \makeatletter
    \if@chicago
     \def\@eapj@cap@font{\scshape}
     \def\@eapj@figname{Fig.}
     \def\@eapj@tabname{SUPPLEMENTAL TABLE}
    \else
     \def\@eapj@cap@font{\bfseries}
     \def\@eapj@figname{Figure}
     \def\@eapj@tabname{Table}
    \fi
  \makeatother
should do what you want. Note that the \makeatletter tag is necessary so that you can use the at sign (@) as part of a command name. TeX normally doesn't allow that unless you're writing a class or style file (it's intended as an implementation-hiding device, so the "guts" of the command can change without needing to inform the user).
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Redefining the table name (e.g. Supplemental Table)

Post by sommerfee »

volcs0 wrote:I tried something like this:

Code: Select all

\newcommand\startsupplement{%
 \makeatletter 
 \renewcommand\def\@eapj@tabname{SUPPLEMENTAL TABLE}
  \makeatother}
but that doesn't work.
It should be:

Code: Select all

\makeatletter
\newcommand\startsupplement{%
 \renewcommand\def\@eapj@tabname{SUPPLEMENTAL TABLE}}
\makeatother
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Redefining the table name (e.g. Supplemental Table)

Post by cgnieder »

sommerfee wrote:It should be:

Code: Select all

\makeatletter
\newcommand\startsupplement{%
 \renewcommand\def\@eapj@tabname{SUPPLEMENTAL TABLE}}
\makeatother
This would still redefine \def (I'm sure Sommerfee simply missed that one :) )

Code: Select all

\makeatletter
\newcommand\startsupplement{%
 \renewcommand*\@eapj@tabname{SUPPLEMENTAL TABLE}}
\makeatother
Regards
site moderator & package author
Post Reply