Graphics, Figures & TablesLabel values jumping while using custom label

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
couperc
Posts: 9
Joined: Fri Apr 09, 2010 3:31 pm

Label values jumping while using custom label

Post by couperc »

Hi

I'm using a custom label but when i use it within a tabulary environment it seems to jump the label number by hte number of labels within the environment (see below). Anyone any suggestions?

Code: Select all

\documentclass[12pt]{report}
\usepackage[footnotesize]{caption}
\usepackage{graphicx}
\usepackage{tabulary}
\usepackage{geometry}
\geometry{top=20mm, bottom=20mm, left=35mm, right=20mm}
\linespread{1.5}


\begin{document}
\newcounter{fluidcounter}
\setcounter{fluidcounter}{0}
\newcommand{\fluid}[1]{\refstepcounter{fluidcounter}\thefluidcounter\label{#1}}



I define a few fluids sucah as Sample \fluid{s1} and Sample \fluid{s2} and maybe even Sample \fluid{s3}
I then want to define a number of fluisds with proerties, so i use this:
\begin{table}[ht]
\caption{Table of Fluids measured}
\begin{tabulary}{0.75\textwidth}{|l|l|l|l|l|l|}
\hline
Sample & Location & Carrier & Material & Mean Radius & Saturation Magnetisation \\ \hline
\hline
\fluid{s4} & Mexico & Isopar-M & Mn$_{0.3}$Fe$_{0.7}$Fe$_{3}$0$_{4}$ & 5nm & .04 T \\ \hline
\fluid{s5} & Commercial & kerosene & Magnetite & 5nm & .09 T \\ \hline
\fluid{s6} & Romania (A3) & Isopar-M & Magnetite & 5nm & .04 T \\ \hline
\fluid{s7} & France (Ademtech) & Isopar-M & Magnetite & 5nm & .09 T \\ \hline
\fluid{s8} & Commercial, German (EMG901) & Isoparaffin & Magnetite & 5nm & .06 T \\ \hline
\fluid{s9} & Commercial, German (EMG905) & Isoparaffin & Magnetite & 5nm & .04 T \\ \hline
\fluid{s10} & Russia & Isoparaffin & Magnetite & 5nm & .06 T \\ \hline
\fluid{s11} & Commerical, Wales (EFH1)& Mineral oil & Magnetite & 5nm & .04 T \\ \hline
\fluid{s11} & Germany (Space01) & Isoparaffin & Cobalt ferrite & 5nm & .06 T \\ \hline
 \hline 
\end{tabulary}
\label{tr1}
\end{table}
\end{document}

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

couperc
Posts: 9
Joined: Fri Apr 09, 2010 3:31 pm

Re: Label values jumping while using custom label

Post by couperc »

anyone?
Post Reply