將風景圖 pdf 包含到文件中

將風景圖 pdf 包含到文件中

我有一個超過 2 頁的大圖,我想將其包含到我的乳膠文件中。該圖是外部 PDF,並且已經是橫向格式。我希望能夠透過 引用文本中的圖形\ref,因此它需要一個標籤。下面的程式碼工作正常,但是當我使用環境時figure,圖像的旋轉是錯誤的(不再是橫向的)。我通過嘗試了替代解決方案。includegraphics,但圖像總是太小(並且不知何故不居中)。有什麼辦法可以正確地做到這一點嗎?

\documentclass{article}
\usepackage{pdfpages}

\begin{document}

Figure \ref{fig:document} shows\ldots

\begin{figure}[h!]
\includepdf[pages=1,landscape=true]{Figure1.pdf}  % exemplary landscape figure, 2 pages long
\label{fig:document}
\end{figure}

\end{document}

它實際上不一定是圖形環境,因為我不使用圖形列表。我只需要能夠連結到它並引用它。任何提示都高度讚賞。

編輯:請注意,在這種情況下,不需要標題。我基本上是在尋找一種方法來包含已經有標題的圖片。但我想從文本中鏈接它。

答案1

您可以將它們包含在landscape環境中,然後使用minipages 強制標題與圖像位於同一頁上。但這不會導致全角包含:

\documentclass{article}
\usepackage[]{graphicx}
\usepackage{caption}
\usepackage{pdflscape}

\begin{document}

Figure \ref{fig:duck1} shows\ldots

\begin{landscape}
  \noindent
  \begin{minipage}{\linewidth}
    \centering
    \includegraphics
      [page=1,width=\linewidth,height=.95\textheight,keepaspectratio]
      {example-image-duck}
    \captionof{figure}{a duck\label{fig:duck1}}
  \end{minipage}
  \begin{minipage}{\linewidth}
    \includegraphics
      [page=2,width=\linewidth,height=.95\textheight,keepaspectratio]
      {example-image-duck}
    \captionof{figure}{another duck\label{fig:duck2}}
  \end{minipage}
\end{landscape}

\end{document}

在此輸入影像描述

遲來的編輯:

下面生成兩個可點擊的鏈接,使 PDF 檢視器跳到放置兩隻鴨子的頁面:

\documentclass{article}
\usepackage{pdfpages}
\usepackage[]{hyperref}

\begin{document}

\hyperlink{hyp:duck1}{the first duck} and 
\hyperlink{hyp:duck2}{the second duck}

\clearpage % important or else the first link is on the wrong page
\hypertarget{hyp:duck1}
  {\includepdf[pages=1,landscape=true]{example-image-duck}}
\hypertarget{hyp:duck2}
  {\includepdf[pages=2,landscape=true]{example-image-duck}}

\end{document}

相關內容