Graphics, Figures & TablesUsing ref with the chngcntr package.

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jgomez2
Posts: 6
Joined: Sat Jan 05, 2013 6:03 am

Using ref with the chngcntr package.

Post by jgomez2 »

Hi all,

So I am using the package chngcntr in my document and this seemed to solve alot of my problems, all of a sudden all my tables and figures now had {SectionNumber}.{TableNumberInThatSection} however I go back and I look at all my \ref entries, and while all have the correct numbering, if I click on the hypertext then it sends me to a very odd part of the document. Has anyone encountered this? Has anyone successfully found a work-around to this?

J

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

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Using ref with the chngcntr package.

Post by sommerfee »

Take a closer look at the README provided by hyperref. You need to

1. Load the chngcntr package

2. Load the hyperref package (so it can patch the chngcntr package code)

3. Use the chngcntr package via \counterwithin resp. \counterwithout (so the versions patched by hyperref will be used)

Any other order can result in strange results, like yours.

See also: http://www.tex.ac.uk/cgi-bin/texfaq2htm ... perdupdest
Last edited by sommerfee on Thu Jan 10, 2013 12:18 am, edited 1 time in total.
jgomez2
Posts: 6
Joined: Sat Jan 05, 2013 6:03 am

Re: Using ref with the chngcntr package.

Post by jgomez2 »

Thanks, this did indeed work!

I appreciate it.
Post Reply