Include landscape figure pdf into document
I have a large figure over 2 pages which I would like to include into my latex file. This figure is an external PDF and in landscape format already. I want to be able to reference the figure in the text via ref
, so it needs a label. The code below works fine, but as soon as I use the figure
environment, the rotation of the image is wrong (no landscape anymore). I tried an alternative solution via. includegraphics
, but the image was always too small (and somehow not centered). Is there any way to do that properly?
documentclass{article}
usepackage{pdfpages}
begin{document}
Figure ref{fig:document} showsldots
begin{figure}[h!]
includepdf[pages=1,landscape=true]{Figure1.pdf} % exemplary landscape figure, 2 pages long
label{fig:document}
end{figure}
end{document}
It doesnt really have to be a figure environment, as I do not use a list of figures. I just need to be able to link to it and reference it. Any hints highly appreciated.
Edit: Please note, in this case, a caption is not necessary. I am basically looking for a method to include a picture that already has a caption. But I want to link it from the text.
pdfpages landscape
add a comment |
I have a large figure over 2 pages which I would like to include into my latex file. This figure is an external PDF and in landscape format already. I want to be able to reference the figure in the text via ref
, so it needs a label. The code below works fine, but as soon as I use the figure
environment, the rotation of the image is wrong (no landscape anymore). I tried an alternative solution via. includegraphics
, but the image was always too small (and somehow not centered). Is there any way to do that properly?
documentclass{article}
usepackage{pdfpages}
begin{document}
Figure ref{fig:document} showsldots
begin{figure}[h!]
includepdf[pages=1,landscape=true]{Figure1.pdf} % exemplary landscape figure, 2 pages long
label{fig:document}
end{figure}
end{document}
It doesnt really have to be a figure environment, as I do not use a list of figures. I just need to be able to link to it and reference it. Any hints highly appreciated.
Edit: Please note, in this case, a caption is not necessary. I am basically looking for a method to include a picture that already has a caption. But I want to link it from the text.
pdfpages landscape
Thefigure
environment can't span several pages. Therefore you should use thecapt-of
package (orcaption
if you already use it for something else) and thecaptionof{figure}{<caption>}
command.
– Skillmon
Mar 14 at 18:57
@Skillmon ah I see, thanks. So just usecaptionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.
– ghx
Mar 14 at 19:09
Did you useusepackage{capt-of}
orusepackage{caption}
in the preamble?
– Skillmon
Mar 14 at 21:16
I am usingusepackage{caption}
– ghx
Mar 14 at 23:03
includepdf
is not meant to produce something with a caption..
– Skillmon
Mar 15 at 9:37
add a comment |
I have a large figure over 2 pages which I would like to include into my latex file. This figure is an external PDF and in landscape format already. I want to be able to reference the figure in the text via ref
, so it needs a label. The code below works fine, but as soon as I use the figure
environment, the rotation of the image is wrong (no landscape anymore). I tried an alternative solution via. includegraphics
, but the image was always too small (and somehow not centered). Is there any way to do that properly?
documentclass{article}
usepackage{pdfpages}
begin{document}
Figure ref{fig:document} showsldots
begin{figure}[h!]
includepdf[pages=1,landscape=true]{Figure1.pdf} % exemplary landscape figure, 2 pages long
label{fig:document}
end{figure}
end{document}
It doesnt really have to be a figure environment, as I do not use a list of figures. I just need to be able to link to it and reference it. Any hints highly appreciated.
Edit: Please note, in this case, a caption is not necessary. I am basically looking for a method to include a picture that already has a caption. But I want to link it from the text.
pdfpages landscape
I have a large figure over 2 pages which I would like to include into my latex file. This figure is an external PDF and in landscape format already. I want to be able to reference the figure in the text via ref
, so it needs a label. The code below works fine, but as soon as I use the figure
environment, the rotation of the image is wrong (no landscape anymore). I tried an alternative solution via. includegraphics
, but the image was always too small (and somehow not centered). Is there any way to do that properly?
documentclass{article}
usepackage{pdfpages}
begin{document}
Figure ref{fig:document} showsldots
begin{figure}[h!]
includepdf[pages=1,landscape=true]{Figure1.pdf} % exemplary landscape figure, 2 pages long
label{fig:document}
end{figure}
end{document}
It doesnt really have to be a figure environment, as I do not use a list of figures. I just need to be able to link to it and reference it. Any hints highly appreciated.
Edit: Please note, in this case, a caption is not necessary. I am basically looking for a method to include a picture that already has a caption. But I want to link it from the text.
pdfpages landscape
pdfpages landscape
edited Mar 15 at 13:37
ghx
asked Mar 14 at 17:55
ghxghx
465
465
Thefigure
environment can't span several pages. Therefore you should use thecapt-of
package (orcaption
if you already use it for something else) and thecaptionof{figure}{<caption>}
command.
– Skillmon
Mar 14 at 18:57
@Skillmon ah I see, thanks. So just usecaptionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.
– ghx
Mar 14 at 19:09
Did you useusepackage{capt-of}
orusepackage{caption}
in the preamble?
– Skillmon
Mar 14 at 21:16
I am usingusepackage{caption}
– ghx
Mar 14 at 23:03
includepdf
is not meant to produce something with a caption..
– Skillmon
Mar 15 at 9:37
add a comment |
Thefigure
environment can't span several pages. Therefore you should use thecapt-of
package (orcaption
if you already use it for something else) and thecaptionof{figure}{<caption>}
command.
– Skillmon
Mar 14 at 18:57
@Skillmon ah I see, thanks. So just usecaptionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.
– ghx
Mar 14 at 19:09
Did you useusepackage{capt-of}
orusepackage{caption}
in the preamble?
– Skillmon
Mar 14 at 21:16
I am usingusepackage{caption}
– ghx
Mar 14 at 23:03
includepdf
is not meant to produce something with a caption..
– Skillmon
Mar 15 at 9:37
The
figure
environment can't span several pages. Therefore you should use the capt-of
package (or caption
if you already use it for something else) and the captionof{figure}{<caption>}
command.– Skillmon
Mar 14 at 18:57
The
figure
environment can't span several pages. Therefore you should use the capt-of
package (or caption
if you already use it for something else) and the captionof{figure}{<caption>}
command.– Skillmon
Mar 14 at 18:57
@Skillmon ah I see, thanks. So just use
captionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.– ghx
Mar 14 at 19:09
@Skillmon ah I see, thanks. So just use
captionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.– ghx
Mar 14 at 19:09
Did you use
usepackage{capt-of}
or usepackage{caption}
in the preamble?– Skillmon
Mar 14 at 21:16
Did you use
usepackage{capt-of}
or usepackage{caption}
in the preamble?– Skillmon
Mar 14 at 21:16
I am using
usepackage{caption}
– ghx
Mar 14 at 23:03
I am using
usepackage{caption}
– ghx
Mar 14 at 23:03
includepdf
is not meant to produce something with a caption..– Skillmon
Mar 15 at 9:37
includepdf
is not meant to produce something with a caption..– Skillmon
Mar 15 at 9:37
add a comment |
1 Answer
1
active
oldest
votes
You could include them in a landscape
environment and then use minipage
s to enforce that the caption is on the same page as the image. This will not lead to full width inclusion though:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
usepackage{pdflscape}
begin{document}
Figure ref{fig:duck1} showsldots
begin{landscape}
noindent
begin{minipage}{linewidth}
centering
includegraphics
[page=1,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{a ducklabel{fig:duck1}}
end{minipage}
begin{minipage}{linewidth}
includegraphics
[page=2,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{another ducklabel{fig:duck2}}
end{minipage}
end{landscape}
end{document}
A late edit:
The following produces two clickable links that make the PDF viewer jump to the pages the two ducks are placed:
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}
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
|
show 1 more comment
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479526%2finclude-landscape-figure-pdf-into-document%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could include them in a landscape
environment and then use minipage
s to enforce that the caption is on the same page as the image. This will not lead to full width inclusion though:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
usepackage{pdflscape}
begin{document}
Figure ref{fig:duck1} showsldots
begin{landscape}
noindent
begin{minipage}{linewidth}
centering
includegraphics
[page=1,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{a ducklabel{fig:duck1}}
end{minipage}
begin{minipage}{linewidth}
includegraphics
[page=2,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{another ducklabel{fig:duck2}}
end{minipage}
end{landscape}
end{document}
A late edit:
The following produces two clickable links that make the PDF viewer jump to the pages the two ducks are placed:
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}
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
|
show 1 more comment
You could include them in a landscape
environment and then use minipage
s to enforce that the caption is on the same page as the image. This will not lead to full width inclusion though:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
usepackage{pdflscape}
begin{document}
Figure ref{fig:duck1} showsldots
begin{landscape}
noindent
begin{minipage}{linewidth}
centering
includegraphics
[page=1,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{a ducklabel{fig:duck1}}
end{minipage}
begin{minipage}{linewidth}
includegraphics
[page=2,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{another ducklabel{fig:duck2}}
end{minipage}
end{landscape}
end{document}
A late edit:
The following produces two clickable links that make the PDF viewer jump to the pages the two ducks are placed:
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}
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
|
show 1 more comment
You could include them in a landscape
environment and then use minipage
s to enforce that the caption is on the same page as the image. This will not lead to full width inclusion though:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
usepackage{pdflscape}
begin{document}
Figure ref{fig:duck1} showsldots
begin{landscape}
noindent
begin{minipage}{linewidth}
centering
includegraphics
[page=1,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{a ducklabel{fig:duck1}}
end{minipage}
begin{minipage}{linewidth}
includegraphics
[page=2,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{another ducklabel{fig:duck2}}
end{minipage}
end{landscape}
end{document}
A late edit:
The following produces two clickable links that make the PDF viewer jump to the pages the two ducks are placed:
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}
You could include them in a landscape
environment and then use minipage
s to enforce that the caption is on the same page as the image. This will not lead to full width inclusion though:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
usepackage{pdflscape}
begin{document}
Figure ref{fig:duck1} showsldots
begin{landscape}
noindent
begin{minipage}{linewidth}
centering
includegraphics
[page=1,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{a ducklabel{fig:duck1}}
end{minipage}
begin{minipage}{linewidth}
includegraphics
[page=2,width=linewidth,height=.95textheight,keepaspectratio]
{example-image-duck}
captionof{figure}{another ducklabel{fig:duck2}}
end{minipage}
end{landscape}
end{document}
A late edit:
The following produces two clickable links that make the PDF viewer jump to the pages the two ducks are placed:
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}
edited Mar 16 at 13:41
answered Mar 15 at 9:47
SkillmonSkillmon
23.6k12247
23.6k12247
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
|
show 1 more comment
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
thanks, I actually had something similar working. The problem is that the image is pretty large and this method makes it shrink too much in the width. P.S: nice duck.
– ghx
Mar 15 at 13:05
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
I do not need a caption necessarily, I just want to have the image as large as possible, if that changes anything.
– ghx
Mar 15 at 13:06
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
@ghx but how do you want to reference it if there is no caption?!
– Skillmon
Mar 15 at 13:59
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
I don't know, I thought maybe by marking the area in the document before the inclusion of the file somehow and then link to the marker? That would be a workaround. I don't know if it is possible in Latex though
– ghx
Mar 15 at 14:39
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
If it should be just a hyper link that opens that page on clicking, it is possible. But how should that help in a document? You can't have any number of something like that in the text. Maybe placing a hyper target and saving the page number could help. Is that something you want?
– Skillmon
Mar 15 at 16:36
|
show 1 more comment
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479526%2finclude-landscape-figure-pdf-into-document%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The
figure
environment can't span several pages. Therefore you should use thecapt-of
package (orcaption
if you already use it for something else) and thecaptionof{figure}{<caption>}
command.– Skillmon
Mar 14 at 18:57
@Skillmon ah I see, thanks. So just use
captionof{figure}{<caption>}
, that's it? Maybe you could make a full example? I don't fully understand how to use the command. It throws errors atm when I am trying.– ghx
Mar 14 at 19:09
Did you use
usepackage{capt-of}
orusepackage{caption}
in the preamble?– Skillmon
Mar 14 at 21:16
I am using
usepackage{caption}
– ghx
Mar 14 at 23:03
includepdf
is not meant to produce something with a caption..– Skillmon
Mar 15 at 9:37