Graphics, Figures & TablesFigure Label

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

Figure Label

Post by zhiwanxu »

Hi,

I used [all]{hypcap} package, and \caption for my figure title. My figures will be listed as Figure 1, Figure 2..etc.
How do I change the figure counter to Fig. 1, Fig. 2 ..etc.

Thanks for your help.
Last edited by zhiwanxu on Tue Nov 01, 2011 5:56 pm, edited 1 time in total.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure Label

Post by localghost »

Use the caption package.

Code: Select all

\usepackage[%
  figurename={Fig.},
  tablename={Tab.}
]{caption}

Thorsten
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

Figure Label

Post by zhiwanxu »

Is there any similar option in {all}\hypcap as

Code: Select all

\usepackage[%
figurename={Fig.}
]{caption}
if I don't want to use caption package for getting better anchor position
Last edited by Stefan Kottwitz on Tue Nov 01, 2011 5:45 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure Label

Post by localghost »

What sober reasons are there against the caption package? It should work properly with hyperref and hypcap since it explicitly supports both.
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

Re: Figure Label

Post by zhiwanxu »

I use the following package (datacomp.sty) to run the file. I also used the \caption option you suggested. It gave me the error message:

! Package caption Error: figurename undefined.

See the caption package documentation for explanation.
Type H <return> for immediate help.
...

l.122 \ProcessOptionsWithKV{caption}

any idea how to solve?

Thanks.

--------------------------------------------------
%% This is file `datacomp.sty'
%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{datacomp}

\usepackage{times}
\usepackage{color}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{lscape}
\usepackage[%
figurename={Fig.},
fontsize=footnotesize
]{caption}
\setlongtables
\usepackage{float}
\usepackage[hyperindex, pdfmark, colorlinks, linkcolor=blue, citecolor=red, urlcolor=blue, breaklinks]{hyperref}
\usepackage[all]{hypcap}
\RequirePackage{graphicx}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure Label

Post by localghost »

Update your TeX distribution, but at least the caption package. Get used to keeping packages up to date in general.

And next time when posting code please use the »Code« environment. You can find the according button right above the input window while composing a message. This just keeps your posts clear and legible.

And by the way, the times package is obsolete [1]. Choose an alternative that is up to date.

[1] View topic: Obsolete Packages and Document Classes — Avoid Usage!
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Figure Label

Post by sommerfee »

zhiwanxu wrote:! Package caption Error: figurename undefined.
What version of the caption package are you using? It needs at least a version 3.1 from 2007/07/04 (or newer) for using the "figurename" option.
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

Re: Figure Label

Post by zhiwanxu »

Thanks a lot!
Post Reply