This is an attempt.
The class icgg.cls
loads hyperref
. We create a new command \collabel
which is executed each time a \label
command is issued.
If, for example, you issue \label{foo}
a new label called col:foo
is created at the same point of the document. if you want to know the column to which \label{foo}
refers to, you have to use the command \columnref{col:foo}
.
Here's an example (replace \documentclass[twocolumn]{article} \usepackage{hyperref}
with \documentclass{icgg}
in your document):
\documentclass[twocolumn]{article}
\usepackage{hyperref}
\usepackage{lipsum} %only for the example
\makeatletter
\AtBeginDocument{%
\let\oldlabel\label
\newcommand*\collabel[1]{%
\begingroup
\protected@write\@auxout{}{%
\string\newlabel{col:#1}{%
{\if@firstcolumn 1\else 2\fi}%
{}%
{}%
{}%
{}%
}%
}%
\endgroup
}
\renewcommand*\label[1]{%
\collabel{#1}\oldlabel{#1}
}
\def\columnref#1{%
\HyRef@StarSetRef{#1}\@firstoffive
}
}
\makeatother
\begin{document}
\section{First section}\label{sec:first}
\lipsum[1-4]
\section{Second section}\label{sec:second}
\lipsum[1-3]\label{sec:third}
Section \ref{sec:first} starts at page \pageref{sec:first} in column \columnref{col:sec:first},
while section \ref{sec:second} starts at page \pageref{sec:second} in column \columnref{col:sec:second}
\end{document}
Output:
Zoom on the relevant part:
Note that the command \if@firstcolumn
sometimes fails to detect the right column, so you may have some wrong references.
\documentclass{...}
and ending with\end{document}
.icgg.cls
come from? Can you give us a link to it?