General ⇒ Problem with cross-references
Problem with cross-references
Thanks
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
Problem with cross-references
Problem with cross-references
Code: Select all
\documentclass[10pt]{report}
% Load packages
\usepackage{tabularx}
\begin{document}
Ref to tab \ref{tab:tab}.
\par
\begin{table}
\mbox{
\begin{tabular}{|c|c|c|}
\hline \multicolumn{3}{|c|}{My Table}\\ \hline
A1 & B2 & C3 \\ \hline
A2 & ... & .. \\ \hline
A3 & .. & . \\ \hline
\end{tabular}
}
\label{tab:tab}
\end{table}
\end{document}
Problem with cross-references
Code: Select all
\documentclass[10pt]{report}
\usepackage{tabularx}
\usepackage{hyperref}
\begin{document}
Ref to tab \ref{tab:tab}.
\begin{table}
\begin{tabular}{|c|c|c|}
\hline \multicolumn{3}{|c|}{My Table}\\ \hline
A1 & B2 & C3 \\ \hline
A2 & ... & .. \\ \hline
A3 & .. & . \\ \hline
\end{tabular}
\caption{a test table}
\label{tab:tab}
\end{table}
\end{document}Re: Problem with cross-references
Problem with cross-references
Code: Select all
\begin{table}[!ht]
\begin{tabular}{|c|c|c|}
\hline \multicolumn{3}{|c|}{My Table}\\ \hline
A1 & B2 & C3 \\ \hline
A2 & ... & .. \\ \hline
A3 & .. & . \\ \hline
\end{tabular}
\caption{a test table}
\label{tab:tab}
\end{table}
Problem with cross-references
Code: Select all
\documentclass[10pt]{report}
\begin{document}
refer to the section \ref{sec:my_section}
\section*{my section} \label{sec:my_section}
\end{document}
Problem with cross-references
Compare this with the following example where I deleted the *.
Code: Select all
\documentclass[10pt]{report}
\begin{document}
refer to the section \ref{section:my_section}
\section{my section}\label{section:my_section}
\end{document}Edit by localghost: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.