Graphics, Figures & TablesCross-reference and pdf file

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mam
Posts: 4
Joined: Sun Dec 28, 2008 4:42 am

Cross-reference and pdf file

Post by mam »

I inserted several pdf pages into my tex file and I'm trying to cross-reference those pages as tables, not a page, in my tex file. It always gives a wrong and constant reference number to all those pages. I'm wondering that is there a way to add a pdf page as a table or cross-reference it. I couldn't figure out this. I hope someone can help me.
Thank you in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

alexz
Posts: 8
Joined: Fri Sep 12, 2008 8:39 pm

Re: Cross-reference and pdf file

Post by alexz »

pls post some sample code and we'll make some suggestions
mam
Posts: 4
Joined: Sun Dec 28, 2008 4:42 am

Re: Cross-reference and pdf file

Post by mam »

Hi,
Here, it's.

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{easytable}
\usepackage{setspace}
\usepackage{tabls}
\usepackage[T1]{fontenc}
\usepackage[authoryear]{natbib}
\def\bibpreamble{\protect\addcontentsline{toc}{chapter}{Bibliography}}
\bibliographystyle{aer}
\usepackage{lipsum}
\usepackage{pdfpages}
\usepackage{pslatex}
\usepackage{float,array}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{subfig}
\usepackage[dvips,pdftex,bookmarks=true]{hyperref}

\graphicspath{
{converted_graphics/}
{C:/MURAT/Labor/}
{C:/Users/m/Documents/My Files/}
{./}
}


\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}

\begin{document}
\doublespacing

\section{Introduction}

Table-~\ref{tab:Summary}A reports summary statistics for the
restricted and unrestricted samples for our largest sample.

\newpage


\bibliographystyle{aer} %Alphabetical listing
%\bibliographystyle{unsrt} %
\bibliography{Galactic}

\newpage

\pagestyle{empty}

\section{Graphs and Tables}
\newpage
\begin{table}[tbp]
\centering
\includegraphics[bb=54 141 586 536,width=5.67in,height=4.21in,keepaspectratio]{C:/MURAT/Thesis/Table11.pdf}

\label{tab:Summary}
\end{table}


\end{document}

Thanks
Murat
alexz
Posts: 8
Joined: Fri Sep 12, 2008 8:39 pm

Re: Cross-reference and pdf file

Post by alexz »

Hi, I added the {tabbing} env inside {table}, works now. Not exactly sure why but that's what i use for tables. Here's your code, removed the path ref due to my mac.

Alex

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{easytable}
\usepackage{setspace}
\usepackage{tabls}
\usepackage[T1]{fontenc}
\usepackage[authoryear]{natbib}
\def\bibpreamble{\protect\addcontentsline{toc}{chapter}{Bibliography}}
\bibliographystyle{aer}
\usepackage{lipsum}
\usepackage{pdfpages}
\usepackage{pslatex}
\usepackage{float,array}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{subfig}
\usepackage[dvips,pdftex,bookmarks=true]{hyperref}

\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}

\begin{document}
\doublespacing

\section{Introduction}

Table-~\ref{tab:Summary}. A reports summary statistics for the
restricted and unrestricted samples for our largest sample.

\newpage


\bibliographystyle{aer} %Alphabetical listing
%\bibliographystyle{unsrt} %
\bibliography{Galactic}

\newpage

\pagestyle{empty}

\section{Graphs and Tables}
\newpage
\begin{table}[tbp]
\centering
\begin{tabbing}
%\includegraphics[bb=54 141 586 536,width=5.67in,height=4.21in,keepaspectratio]{C:/MURAT/Thesis/Table11.pdf}
\end{tabbing}
\label{tab:Summary}
\end{table}


\end{document}
mam
Posts: 4
Joined: Sun Dec 28, 2008 4:42 am

Re: Cross-reference and pdf file

Post by mam »

Hi Alex,
I tried your suggestion but I'm still getting a wrong reference number. I'm wondering that do you have any idea or suggestion about it.
Thanks a lot.
Murat
alexz
Posts: 8
Joined: Fri Sep 12, 2008 8:39 pm

Re: Cross-reference and pdf file

Post by alexz »

Mine seems to work. Here is the code, i'll also upload the pdf. Maybe I'm not understanding the problem.

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{easytable}
\usepackage{setspace}
\usepackage{tabls}
\usepackage[T1]{fontenc}
\usepackage[authoryear]{natbib}
\def\bibpreamble{\protect\addcontentsline{toc}{chapter}{Bibliography}}
\bibliographystyle{aer}
\usepackage{lipsum}
\usepackage{pdfpages}
\usepackage{pslatex}
\usepackage{float,array}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{subfig}
\usepackage[dvips,pdftex,bookmarks=true]{hyperref}

\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}

\begin{document}
\doublespacing

\section{Introduction}

Table-~\ref{tab:Summary}. My png is on page~\pageref{tab:Summary}. A reports summary statistics for the
restricted and unrestricted samples for our largest sample.

\newpage


\bibliographystyle{aer} %Alphabetical listing
%\bibliographystyle{unsrt} %
\bibliography{Galactic}

\newpage

\pagestyle{empty}

\section{Graphs and Tables}
\newpage
\begin{table}[tbp]
\centering
\begin{tabbing}
\includegraphics[width=2in,keepaspectratio]{rbs.png}
\end{tabbing}
\caption{this is my png}
\label{tab:Summary}
\end{table}


\end{document}
Attachments
xx.pdf
(41.25 KiB) Downloaded 345 times
mam
Posts: 4
Joined: Sun Dec 28, 2008 4:42 am

Re: Cross-reference and pdf file

Post by mam »

I realized "\caption{}" is necessary. When I included that, it worked.
Thanks a lot
Murat
Post Reply