Image fill rest of a page that already contains textHow to fit a large figure to pageInsert a full page...

How much RAM could one put in a typical 80386 setup?

Does an object always see its latest internal state irrespective of thread?

Roll the carpet

Did Shadowfax go to Valinor?

Java Casting: Java 11 throws LambdaConversionException while 1.8 does not

Unable to deploy metadata from Partner Developer scratch org because of extra fields

How much of data wrangling is a data scientist's job?

Is it possible to do 50 km distance without any previous training?

How does one intimidate enemies without having the capacity for violence?

dbcc cleantable batch size explanation

Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Maximum likelihood parameters deviate from posterior distributions

Could an aircraft fly or hover using only jets of compressed air?

Cross compiling for RPi - error while loading shared libraries

What doth I be?

What is a clear way to write a bar that has an extra beat?

Can you really stack all of this on an Opportunity Attack?

What's that red-plus icon near a text?

Do infinite dimensional systems make sense?

How is it possible to have an ability score that is less than 3?

Arrow those variables!

Convert two switches to a dual stack, and add outlet - possible here?

meaning of に in 本当に?



Image fill rest of a page that already contains text


How to fit a large figure to pageInsert a full page imagetwopagepicture package refiningIn memoir environment, the chapter heading placement gets messed up if a too big figure gets placed on next pageLargest image that doesn't get put on separate page?Memoir chapterstyle - add image before chapter numThe problem of empty page when starting new chapter with an image on first pageHow to include image path that contains a dollar signpackage {Rotating} jumbles up contentHow to keep section heading on the same page as a floating image in a landscape layout without getting kicked to the next page?Fill text with image?Fill page image













0















I found some solutions for full page images (here and here), but what I am trying to achieve is putting an image in a page that already has text (some headings, for example) and the image should fill all the remaining space (from the headings to the footer).



This page contains a proposed solution, but since there is no example, and what ever I tried gave me errors (Undefined control sequence. ...undbild). Here is what I tried:



newlength{textundbildtextheight}

newcommand{textundbild}[2]{
settototalheighttextundbildtextheight{vbox{#1}}
#1
vfill
begin{center}
includegraphics[width=textwidth,keepaspectratio=true,height=textheight-thetextundbildtextheight]{#2}
end{center}
vfill
}

begin{document}

chapter{Chapter 1}
section{Section X}
textundbild{1cm}{IMAGENAME}

...
end{document}









share|improve this question




















  • 1





    You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

    – Phelype Oleinik
    8 hours ago






  • 1





    the first argument is intended to be all the non-image text on the page.

    – David Carlisle
    7 hours ago
















0















I found some solutions for full page images (here and here), but what I am trying to achieve is putting an image in a page that already has text (some headings, for example) and the image should fill all the remaining space (from the headings to the footer).



This page contains a proposed solution, but since there is no example, and what ever I tried gave me errors (Undefined control sequence. ...undbild). Here is what I tried:



newlength{textundbildtextheight}

newcommand{textundbild}[2]{
settototalheighttextundbildtextheight{vbox{#1}}
#1
vfill
begin{center}
includegraphics[width=textwidth,keepaspectratio=true,height=textheight-thetextundbildtextheight]{#2}
end{center}
vfill
}

begin{document}

chapter{Chapter 1}
section{Section X}
textundbild{1cm}{IMAGENAME}

...
end{document}









share|improve this question




















  • 1





    You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

    – Phelype Oleinik
    8 hours ago






  • 1





    the first argument is intended to be all the non-image text on the page.

    – David Carlisle
    7 hours ago














0












0








0








I found some solutions for full page images (here and here), but what I am trying to achieve is putting an image in a page that already has text (some headings, for example) and the image should fill all the remaining space (from the headings to the footer).



This page contains a proposed solution, but since there is no example, and what ever I tried gave me errors (Undefined control sequence. ...undbild). Here is what I tried:



newlength{textundbildtextheight}

newcommand{textundbild}[2]{
settototalheighttextundbildtextheight{vbox{#1}}
#1
vfill
begin{center}
includegraphics[width=textwidth,keepaspectratio=true,height=textheight-thetextundbildtextheight]{#2}
end{center}
vfill
}

begin{document}

chapter{Chapter 1}
section{Section X}
textundbild{1cm}{IMAGENAME}

...
end{document}









share|improve this question
















I found some solutions for full page images (here and here), but what I am trying to achieve is putting an image in a page that already has text (some headings, for example) and the image should fill all the remaining space (from the headings to the footer).



This page contains a proposed solution, but since there is no example, and what ever I tried gave me errors (Undefined control sequence. ...undbild). Here is what I tried:



newlength{textundbildtextheight}

newcommand{textundbild}[2]{
settototalheighttextundbildtextheight{vbox{#1}}
#1
vfill
begin{center}
includegraphics[width=textwidth,keepaspectratio=true,height=textheight-thetextundbildtextheight]{#2}
end{center}
vfill
}

begin{document}

chapter{Chapter 1}
section{Section X}
textundbild{1cm}{IMAGENAME}

...
end{document}






graphics floats






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 7 hours ago









Phelype Oleinik

24.9k54690




24.9k54690










asked 8 hours ago









jiunjiun

1284




1284








  • 1





    You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

    – Phelype Oleinik
    8 hours ago






  • 1





    the first argument is intended to be all the non-image text on the page.

    – David Carlisle
    7 hours ago














  • 1





    You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

    – Phelype Oleinik
    8 hours ago






  • 1





    the first argument is intended to be all the non-image text on the page.

    – David Carlisle
    7 hours ago








1




1





You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

– Phelype Oleinik
8 hours ago





You have to load the calc package to use settototalheight and the graphicx package to use includegraphics.

– Phelype Oleinik
8 hours ago




1




1





the first argument is intended to be all the non-image text on the page.

– David Carlisle
7 hours ago





the first argument is intended to be all the non-image text on the page.

– David Carlisle
7 hours ago










1 Answer
1






active

oldest

votes


















1














This takes a couple of runs for the page locations to be recorded in the aux file.



enter image description here



documentclass{article}

usepackage{graphicx}

defposA{0}defposB{10}
defposC{0}defposD{10}
begin{document}


section{ZZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposA sp -posB sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}}
end{center}

clearpage

page 2


section{ZZZZ}
begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

section{ZZZZZZ}

subsection{ZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposC{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposC sp -posD sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposD{thepdflastypos}}
end{center}

clearpage

page 3
end{document}





share|improve this answer
























  • It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

    – jiun
    2 hours ago











  • @jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

    – David Carlisle
    2 hours ago













  • I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

    – jiun
    2 hours ago












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%2f483388%2fimage-fill-rest-of-a-page-that-already-contains-text%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









1














This takes a couple of runs for the page locations to be recorded in the aux file.



enter image description here



documentclass{article}

usepackage{graphicx}

defposA{0}defposB{10}
defposC{0}defposD{10}
begin{document}


section{ZZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposA sp -posB sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}}
end{center}

clearpage

page 2


section{ZZZZ}
begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

section{ZZZZZZ}

subsection{ZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposC{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposC sp -posD sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposD{thepdflastypos}}
end{center}

clearpage

page 3
end{document}





share|improve this answer
























  • It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

    – jiun
    2 hours ago











  • @jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

    – David Carlisle
    2 hours ago













  • I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

    – jiun
    2 hours ago
















1














This takes a couple of runs for the page locations to be recorded in the aux file.



enter image description here



documentclass{article}

usepackage{graphicx}

defposA{0}defposB{10}
defposC{0}defposD{10}
begin{document}


section{ZZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposA sp -posB sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}}
end{center}

clearpage

page 2


section{ZZZZ}
begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

section{ZZZZZZ}

subsection{ZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposC{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposC sp -posD sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposD{thepdflastypos}}
end{center}

clearpage

page 3
end{document}





share|improve this answer
























  • It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

    – jiun
    2 hours ago











  • @jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

    – David Carlisle
    2 hours ago













  • I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

    – jiun
    2 hours ago














1












1








1







This takes a couple of runs for the page locations to be recorded in the aux file.



enter image description here



documentclass{article}

usepackage{graphicx}

defposA{0}defposB{10}
defposC{0}defposD{10}
begin{document}


section{ZZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposA sp -posB sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}}
end{center}

clearpage

page 2


section{ZZZZ}
begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

section{ZZZZZZ}

subsection{ZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposC{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposC sp -posD sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposD{thepdflastypos}}
end{center}

clearpage

page 3
end{document}





share|improve this answer













This takes a couple of runs for the page locations to be recorded in the aux file.



enter image description here



documentclass{article}

usepackage{graphicx}

defposA{0}defposB{10}
defposC{0}defposD{10}
begin{document}


section{ZZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposA sp -posB sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}}
end{center}

clearpage

page 2


section{ZZZZ}
begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

section{ZZZZZZ}

subsection{ZZ}

begin{center}
begin{tabular}{|cc|}
1&2\
3&4\
5&6\
7&8\
end{tabular}
end{center}

zzzz zzzz z z zzzz

begin{center}

pdfsaveposwritecsname @auxoutendcsname{gdefstringposC{thepdflastypos}}
par
includegraphics[width=textwidth,height=dimexprposC sp -posD sp,keepaspectratio]{example-image-9x16}
vfill
pdfsaveposwritecsname @auxoutendcsname{gdefstringposD{thepdflastypos}}
end{center}

clearpage

page 3
end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









David CarlisleDavid Carlisle

497k4111441891




497k4111441891













  • It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

    – jiun
    2 hours ago











  • @jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

    – David Carlisle
    2 hours ago













  • I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

    – jiun
    2 hours ago



















  • It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

    – jiun
    2 hours ago











  • @jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

    – David Carlisle
    2 hours ago













  • I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

    – jiun
    2 hours ago

















It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

– jiun
2 hours ago





It works perfectly! Thanks. How about putting it inside a macro (command)? I tried the following but the result is not-resized at all: newcommand{fullpageimage}[2]{ begin{figure}[H] ifthenelse{equal{#2}{}}{}{caption{#2}} centering pdfsaveposwritecsname @auxoutendcsname{gdefstringposA{thepdflastypos}} par includegraphics[frame,height=dimexprposA sp -posB sp,keepaspectratio]{#1} vfill pdfsaveposwritecsname @auxoutendcsname{gdefstringposB{thepdflastypos}} end{figure} clearpage }

– jiun
2 hours ago













@jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

– David Carlisle
2 hours ago







@jiun yes sure you could put it in a macro but no point in using figure here as this can not be a floating figure, also the posA and posB macros need to be unique for each figure as they record the position for one figure.

– David Carlisle
2 hours ago















I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

– jiun
2 hours ago





I used figure since I want to add a caption. Moreover, I have no idea how to make posA and posB unique for each case (macro usage). I moved the definitions inside the newcommand environment, but it doesn't work.

– jiun
2 hours ago


















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%2f483388%2fimage-fill-rest-of-a-page-that-already-contains-text%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

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Castillo d'Acher Características Menú de navegación

Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...