# How to prevent labels from showing up after creating table using csvsimple's csvreader

I'm using ShareLaTeX's Institute of Physics template for this project. I have created a few data tables and since the report I'm making is relatively long and may change in order, I want each one to have a label. I'm importing my data from CSV files and using the csvsimple package to create tables using its csvreader command in the figure enviornment. My issue is that, for some reason, after the first table, every subsequent label is printed out in the PDF.

I have tried using the showlabels package to prevent labels from being shown by using \usepackage[nolabels]{showlabels} and \usepackage[final]{showlabels}, but neither of those commands had any effect.

Here's the code that I'm using along with a couple of CSV files that I'm using and the output:

\documentclass[12pt,a4paper,final]{iopart}
\newcommand{\gguide}{{\it Preparing graphics for IOP journals}}
%Uncomment next line if AMS fonts required
\usepackage{iopams}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{csvsimple}
\usepackage{caption}
\usepackage{array}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage{float}
\usepackage[final]{showlabels}

\makeatletter
\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
\makeatother

\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}
\section{\label{sec:level1} Procedure}

\subsection{\label{sec:level2} Organization}
\subsection{\label{sec:level2} Trivialities and Setup-Determining Experiments}
\begin{table}[H]
\label{tab: MassofMasses}
\centering
\caption{Actual Mass of Masses by Label}
table head=\hline Label & Mass (g)\\\hline,
table foot=\hline]
{ActualMassofMasses.csv}{Mass number=\label, Actual mass=\mass}
{\label & \mass}
\end{table}

\begin{table}[H] \label{tab:CenterofMass}
\centering
\caption{Distance from Tip of Hook to Center of Mass of Masses}
table head=\hline Mass (g) & Distance (cm)\\\hline,
table foot=\hline]
{CenterofMass.csv}{mass=\mass, tip to CM=\distance}
{\mass & \distance}
\end{table}


Output

Thanks in advance for any help! Also, if I've missed anything that I need to include then please ask me for it.

There are also some other problems using your style and class files, but I can give a solution to the problem you described.

{ActualMassofMasses.csv}{Mass number=\label, Actual mass=\mass}


redefines the standard \label macro. Note that this redefinition is global.

To avoid this, we could save and restore the original \label, but the preferred way would be to rename your private macro, e.g.

{ActualMassofMasses.csv}{Mass number=\mylabel, Actual mass=\mass}


The full code is:

\documentclass[12pt,a4paper,final]{iopart}
\newcommand{\gguide}{{\it Preparing graphics for IOP journals}}
%Uncomment next line if AMS fonts required
\usepackage{iopams}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{csvsimple}
\usepackage{caption}
\usepackage{array}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage{float}
\usepackage[final]{showlabels}

\makeatletter
\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
\makeatother

\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}
\section{\label{sec:level1} Procedure}

\subsection{\label{sec:level2} Organization}
\subsection{\label{sec:level2} Trivialities and Setup-Determining Experiments}
\begin{table}[H]
\label{tab: MassofMasses}
\centering
\caption{Actual Mass of Masses by Label}
table head=\hline Label & Mass (g)\\\hline,
table foot=\hline]
{ActualMassofMasses.csv}{Mass number=\mylabel, Actual mass=\mass}
{\mylabel & \mass}
\end{table}

\begin{table}[H] \label{tab:CenterofMass}
\centering
\caption{Distance from Tip of Hook to Center of Mass of Masses}