How to have a figure touch the edge of the page?












9















How can I position a figure (picture) so that it:




  • is aligned on the left-hand side with the text (this is in two column page)

  • touches (or exceeds) the right-hand side of the page?


An example can be found here: http://library.fes.de/pdf-files/akademie/berlin/04801.pdf (go to any page with a picture and see how the picture is placed.)
Note: The example is not what I would call pretty; I think the design is hideous. None the less, I'd like to know how to accomplish this style design for pictures.










share|improve this question

























  • See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

    – Martin Scharrer
    May 13 '11 at 15:50













  • @Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

    – egreg
    May 13 '11 at 16:19











  • @egreg: Indeed, but the principle stands.

    – Martin Scharrer
    May 13 '11 at 16:25













  • Related but for centering: Centering a box independent of documents margin

    – Martin Scharrer
    Jan 9 at 7:58
















9















How can I position a figure (picture) so that it:




  • is aligned on the left-hand side with the text (this is in two column page)

  • touches (or exceeds) the right-hand side of the page?


An example can be found here: http://library.fes.de/pdf-files/akademie/berlin/04801.pdf (go to any page with a picture and see how the picture is placed.)
Note: The example is not what I would call pretty; I think the design is hideous. None the less, I'd like to know how to accomplish this style design for pictures.










share|improve this question

























  • See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

    – Martin Scharrer
    May 13 '11 at 15:50













  • @Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

    – egreg
    May 13 '11 at 16:19











  • @egreg: Indeed, but the principle stands.

    – Martin Scharrer
    May 13 '11 at 16:25













  • Related but for centering: Centering a box independent of documents margin

    – Martin Scharrer
    Jan 9 at 7:58














9












9








9


3






How can I position a figure (picture) so that it:




  • is aligned on the left-hand side with the text (this is in two column page)

  • touches (or exceeds) the right-hand side of the page?


An example can be found here: http://library.fes.de/pdf-files/akademie/berlin/04801.pdf (go to any page with a picture and see how the picture is placed.)
Note: The example is not what I would call pretty; I think the design is hideous. None the less, I'd like to know how to accomplish this style design for pictures.










share|improve this question
















How can I position a figure (picture) so that it:




  • is aligned on the left-hand side with the text (this is in two column page)

  • touches (or exceeds) the right-hand side of the page?


An example can be found here: http://library.fes.de/pdf-files/akademie/berlin/04801.pdf (go to any page with a picture and see how the picture is placed.)
Note: The example is not what I would call pretty; I think the design is hideous. None the less, I'd like to know how to accomplish this style design for pictures.







graphics horizontal-alignment margins






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 1 '12 at 18:03









lockstep

190k52586719




190k52586719










asked May 13 '11 at 15:42









UnapiedraUnapiedra

8132920




8132920













  • See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

    – Martin Scharrer
    May 13 '11 at 15:50













  • @Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

    – egreg
    May 13 '11 at 16:19











  • @egreg: Indeed, but the principle stands.

    – Martin Scharrer
    May 13 '11 at 16:25













  • Related but for centering: Centering a box independent of documents margin

    – Martin Scharrer
    Jan 9 at 7:58



















  • See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

    – Martin Scharrer
    May 13 '11 at 15:50













  • @Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

    – egreg
    May 13 '11 at 16:19











  • @egreg: Indeed, but the principle stands.

    – Martin Scharrer
    May 13 '11 at 16:25













  • Related but for centering: Centering a box independent of documents margin

    – Martin Scharrer
    Jan 9 at 7:58

















See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

– Martin Scharrer
May 13 '11 at 15:50







See Place figures side by side, spill into outer margin. You need to use makebox[columnwidth][r]{includegraphics[width=dimexprcolumnwidth+rightmarginrelax]{image}} in this case. I'm not sure about the margin length, though.

– Martin Scharrer
May 13 '11 at 15:50















@Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

– egreg
May 13 '11 at 16:19





@Martin: sorry, but rightmargin is definitely wrong; it's a parameter for lists.

– egreg
May 13 '11 at 16:19













@egreg: Indeed, but the principle stands.

– Martin Scharrer
May 13 '11 at 16:25







@egreg: Indeed, but the principle stands.

– Martin Scharrer
May 13 '11 at 16:25















Related but for centering: Centering a box independent of documents margin

– Martin Scharrer
Jan 9 at 7:58





Related but for centering: Centering a box independent of documents margin

– Martin Scharrer
Jan 9 at 7:58










1 Answer
1






active

oldest

votes


















5














documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}
newcommand{mydimright}{%
dimexprpaperwidth-1in-hoffset-oddsidemargin-
columnwidth-columnseprelax}
newcommand{mydimleft}{%
dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}

begin{document}
lipsum[1]
begin{flushleft}
makebox[columnwidth][r]{%
includegraphics[height=1cm,width=mydimleft]{try}}
end{flushleft}
lipsum[1-5]
begin{flushleft}
makebox[columnwidth][l]{%
includegraphics[height=1cm,width=mydimright]{try}}
end{flushleft}
end{document}


There is no immediate access to the right margin width, which has to be computed in an indirect way.



With the command layout of the layout package, one can look at the relevant lengths. I've put also hoffset, because some classes might change it.



Here try is the graphic file I always use for tests. I've used flushleft just in order to avoid LaTeX trying to be smart with figure placement.



-- Extended version for automatic placement in the figure environment --



Here it is, following Martin's suggestion; the command touchmarginincludegraphics works like its sibling includegraphics except, of course, that the keyword width should not be specified.



documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}

makeatletter
deftmig@r{dimexprpaperwidth-1in-hoffset-
oddsidemargin-columnwidth-columnseprelax}
deftmig@l{dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}
newcommand{touchmarginincludegraphics}[2]{%
begingroup
if@firstcolumn
deftmig@place{r}%
else
deftmig@place{l}%
fi
makebox[columnwidth][tmig@place]{%
includegraphics[#1,width=@nameuse{tmig@tmig@place}]{#2}}
endgroup}
makeatother

begin{document}
lipsum[1]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[1-4]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[2]
end{document}





share|improve this answer


























  • The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

    – Martin Scharrer
    May 13 '11 at 16:27











  • @Martin: I've added the code, thanks for suggesting if@firstcolumn.

    – egreg
    May 13 '11 at 17:05











  • Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

    – Unapiedra
    May 14 '11 at 15:09











  • @Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

    – egreg
    May 14 '11 at 16:56











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f18166%2fhow-to-have-a-figure-touch-the-edge-of-the-page%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









5














documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}
newcommand{mydimright}{%
dimexprpaperwidth-1in-hoffset-oddsidemargin-
columnwidth-columnseprelax}
newcommand{mydimleft}{%
dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}

begin{document}
lipsum[1]
begin{flushleft}
makebox[columnwidth][r]{%
includegraphics[height=1cm,width=mydimleft]{try}}
end{flushleft}
lipsum[1-5]
begin{flushleft}
makebox[columnwidth][l]{%
includegraphics[height=1cm,width=mydimright]{try}}
end{flushleft}
end{document}


There is no immediate access to the right margin width, which has to be computed in an indirect way.



With the command layout of the layout package, one can look at the relevant lengths. I've put also hoffset, because some classes might change it.



Here try is the graphic file I always use for tests. I've used flushleft just in order to avoid LaTeX trying to be smart with figure placement.



-- Extended version for automatic placement in the figure environment --



Here it is, following Martin's suggestion; the command touchmarginincludegraphics works like its sibling includegraphics except, of course, that the keyword width should not be specified.



documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}

makeatletter
deftmig@r{dimexprpaperwidth-1in-hoffset-
oddsidemargin-columnwidth-columnseprelax}
deftmig@l{dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}
newcommand{touchmarginincludegraphics}[2]{%
begingroup
if@firstcolumn
deftmig@place{r}%
else
deftmig@place{l}%
fi
makebox[columnwidth][tmig@place]{%
includegraphics[#1,width=@nameuse{tmig@tmig@place}]{#2}}
endgroup}
makeatother

begin{document}
lipsum[1]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[1-4]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[2]
end{document}





share|improve this answer


























  • The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

    – Martin Scharrer
    May 13 '11 at 16:27











  • @Martin: I've added the code, thanks for suggesting if@firstcolumn.

    – egreg
    May 13 '11 at 17:05











  • Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

    – Unapiedra
    May 14 '11 at 15:09











  • @Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

    – egreg
    May 14 '11 at 16:56
















5














documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}
newcommand{mydimright}{%
dimexprpaperwidth-1in-hoffset-oddsidemargin-
columnwidth-columnseprelax}
newcommand{mydimleft}{%
dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}

begin{document}
lipsum[1]
begin{flushleft}
makebox[columnwidth][r]{%
includegraphics[height=1cm,width=mydimleft]{try}}
end{flushleft}
lipsum[1-5]
begin{flushleft}
makebox[columnwidth][l]{%
includegraphics[height=1cm,width=mydimright]{try}}
end{flushleft}
end{document}


There is no immediate access to the right margin width, which has to be computed in an indirect way.



With the command layout of the layout package, one can look at the relevant lengths. I've put also hoffset, because some classes might change it.



Here try is the graphic file I always use for tests. I've used flushleft just in order to avoid LaTeX trying to be smart with figure placement.



-- Extended version for automatic placement in the figure environment --



Here it is, following Martin's suggestion; the command touchmarginincludegraphics works like its sibling includegraphics except, of course, that the keyword width should not be specified.



documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}

makeatletter
deftmig@r{dimexprpaperwidth-1in-hoffset-
oddsidemargin-columnwidth-columnseprelax}
deftmig@l{dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}
newcommand{touchmarginincludegraphics}[2]{%
begingroup
if@firstcolumn
deftmig@place{r}%
else
deftmig@place{l}%
fi
makebox[columnwidth][tmig@place]{%
includegraphics[#1,width=@nameuse{tmig@tmig@place}]{#2}}
endgroup}
makeatother

begin{document}
lipsum[1]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[1-4]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[2]
end{document}





share|improve this answer


























  • The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

    – Martin Scharrer
    May 13 '11 at 16:27











  • @Martin: I've added the code, thanks for suggesting if@firstcolumn.

    – egreg
    May 13 '11 at 17:05











  • Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

    – Unapiedra
    May 14 '11 at 15:09











  • @Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

    – egreg
    May 14 '11 at 16:56














5












5








5







documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}
newcommand{mydimright}{%
dimexprpaperwidth-1in-hoffset-oddsidemargin-
columnwidth-columnseprelax}
newcommand{mydimleft}{%
dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}

begin{document}
lipsum[1]
begin{flushleft}
makebox[columnwidth][r]{%
includegraphics[height=1cm,width=mydimleft]{try}}
end{flushleft}
lipsum[1-5]
begin{flushleft}
makebox[columnwidth][l]{%
includegraphics[height=1cm,width=mydimright]{try}}
end{flushleft}
end{document}


There is no immediate access to the right margin width, which has to be computed in an indirect way.



With the command layout of the layout package, one can look at the relevant lengths. I've put also hoffset, because some classes might change it.



Here try is the graphic file I always use for tests. I've used flushleft just in order to avoid LaTeX trying to be smart with figure placement.



-- Extended version for automatic placement in the figure environment --



Here it is, following Martin's suggestion; the command touchmarginincludegraphics works like its sibling includegraphics except, of course, that the keyword width should not be specified.



documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}

makeatletter
deftmig@r{dimexprpaperwidth-1in-hoffset-
oddsidemargin-columnwidth-columnseprelax}
deftmig@l{dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}
newcommand{touchmarginincludegraphics}[2]{%
begingroup
if@firstcolumn
deftmig@place{r}%
else
deftmig@place{l}%
fi
makebox[columnwidth][tmig@place]{%
includegraphics[#1,width=@nameuse{tmig@tmig@place}]{#2}}
endgroup}
makeatother

begin{document}
lipsum[1]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[1-4]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[2]
end{document}





share|improve this answer















documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}
newcommand{mydimright}{%
dimexprpaperwidth-1in-hoffset-oddsidemargin-
columnwidth-columnseprelax}
newcommand{mydimleft}{%
dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}

begin{document}
lipsum[1]
begin{flushleft}
makebox[columnwidth][r]{%
includegraphics[height=1cm,width=mydimleft]{try}}
end{flushleft}
lipsum[1-5]
begin{flushleft}
makebox[columnwidth][l]{%
includegraphics[height=1cm,width=mydimright]{try}}
end{flushleft}
end{document}


There is no immediate access to the right margin width, which has to be computed in an indirect way.



With the command layout of the layout package, one can look at the relevant lengths. I've put also hoffset, because some classes might change it.



Here try is the graphic file I always use for tests. I've used flushleft just in order to avoid LaTeX trying to be smart with figure placement.



-- Extended version for automatic placement in the figure environment --



Here it is, following Martin's suggestion; the command touchmarginincludegraphics works like its sibling includegraphics except, of course, that the keyword width should not be specified.



documentclass[a4paper,twocolumn]{article}
usepackage{lipsum,graphicx}

makeatletter
deftmig@r{dimexprpaperwidth-1in-hoffset-
oddsidemargin-columnwidth-columnseprelax}
deftmig@l{dimexpr1in+hoffset+oddsidemargin+columnwidthrelax}
newcommand{touchmarginincludegraphics}[2]{%
begingroup
if@firstcolumn
deftmig@place{r}%
else
deftmig@place{l}%
fi
makebox[columnwidth][tmig@place]{%
includegraphics[#1,width=@nameuse{tmig@tmig@place}]{#2}}
endgroup}
makeatother

begin{document}
lipsum[1]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[1-4]

begin{figure}[!h]
touchmarginincludegraphics[height=1cm]{try}
end{figure}

lipsum[2]
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited May 13 '11 at 17:02

























answered May 13 '11 at 16:17









egregegreg

712k8618933179




712k8618933179













  • The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

    – Martin Scharrer
    May 13 '11 at 16:27











  • @Martin: I've added the code, thanks for suggesting if@firstcolumn.

    – egreg
    May 13 '11 at 17:05











  • Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

    – Unapiedra
    May 14 '11 at 15:09











  • @Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

    – egreg
    May 14 '11 at 16:56



















  • The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

    – Martin Scharrer
    May 13 '11 at 16:27











  • @Martin: I've added the code, thanks for suggesting if@firstcolumn.

    – egreg
    May 13 '11 at 17:05











  • Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

    – Unapiedra
    May 14 '11 at 15:09











  • @Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

    – egreg
    May 14 '11 at 16:56

















The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

– Martin Scharrer
May 13 '11 at 16:27





The images in the linked PDF look like floats to me. You might want to update your code to insert begin{figure}[t] and use if@firstcolumn to select the direction.

– Martin Scharrer
May 13 '11 at 16:27













@Martin: I've added the code, thanks for suggesting if@firstcolumn.

– egreg
May 13 '11 at 17:05





@Martin: I've added the code, thanks for suggesting if@firstcolumn.

– egreg
May 13 '11 at 17:05













Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

– Unapiedra
May 14 '11 at 15:09





Thank you, that works! I removed the height=1cm option, that makes the aspect ratio stay.

– Unapiedra
May 14 '11 at 15:09













@Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

– egreg
May 14 '11 at 16:56





@Unapiedra: Yes, the height=1cm was there just to make a one page example with figures in both columns.

– egreg
May 14 '11 at 16:56


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f18166%2fhow-to-have-a-figure-touch-the-edge-of-the-page%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?