Thank you.
Code: Select all
\makeatletter
\newenvironment{tablehere}
{\def\@captype{table}}
{}
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatotherCode: Select all
\makeatletter
\newenvironment{tablehere}
{\def\@captype{table}}
{}
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatotherLearn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Code: Select all
\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}
\makeatletter
\newenvironment{tablehere}
{\def\@captype{table}}
{}
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatother
\begin{document}
\begin{multicols}{2}
\section{foobar}
\lipsum[1]
\begin{figurehere}
foo
\caption{foo}\label{tab:foo}
\end{figurehere}
\lipsum[1]
\begin{figurehere}
bar
\caption{bar}
\label{tab:bar}
\end{figurehere}
See figures~\ref{tab:foo} and~\ref{tab:bar}.
\lipsum[2]
\end{multicols}
\end{document}Code: Select all
\documentclass[10pt]{article}
\usepackage[pdftex]{graphicx}
\usepackage{multicol}
\makeatletter
\newenvironment{tablehere}
{\def\@captype{table}}
{}
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatother
\begin{document}
\section{A section}
\begin{figurehere}
\begin{center}
\includegraphics[width=0.45\textwidth]{./myfigure} \\ %[1cm]
\end{center}
\label{RL4}
\caption{An incorrectly labeled image, i.e. Figure 6.}
\end{figurehere}
A reference, \ref{RL4}, corresponding to the section number i.e. 4.1.
\begin{figurehere}
\begin{center}
\includegraphics[width=0.45\textwidth]{./my2ndfigure} \\ %[1cm]
\end{center}
\label{RL4}
\caption{Another incorrectly labeled image, i.e. Figure 7.}
\end{figurehere}
A reference, \ref{RL4}, corresponding to the section number i.e. 4.1.
\end{document}
\label after \caption. The \caption command is the one that actually steps the underlying counter.Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis