General ⇒ Problem with cross-references
Problem with cross-references
Thanks
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
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.