Use alternate scaling of the image if there is empty space available
up vote
5
down vote
favorite
I write a book with several chapters. Every chapter contains several (floating) images, usually photos in standard landscape-style, therefore they are scaled to the size of 0.4textheight so that at least two images fit to the page with the captions (to save space).
I use the following function "photo" for adding photos:
newcommand{photo}[3] {
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=0.4textheight]{#2}
end{center}
caption{#3}
label{foto:#1}
end{figure}
}
However, it often happens that on the very last page of the chapter only one (last) image is shown. As I'm using the scaling, it scales the image to the same 0.4-size, which in this case is not needed, as the remaining part of the page is left empty anyway (end of the chapter), and even scaling up to 0.9textheight would be possible.
The problem is that I don't know whether the photo is floated to the end of the paragraph or not. Or, is the photo positioned to the last page filled with some text also or with lots of free space available.
The book is actually generated by the program (it is a family tree book, automatically split into chapters), I don't want to edit this manually.
So, is there an option in Latex (LuaLaTex) to
- scale the images to the requested size normally, but
- scale the image up to fill the page in case there is empty space available anyway.
(In short, the scaling should depend on the position where the photo is placed after floating.)
graphics size
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
5
down vote
favorite
I write a book with several chapters. Every chapter contains several (floating) images, usually photos in standard landscape-style, therefore they are scaled to the size of 0.4textheight so that at least two images fit to the page with the captions (to save space).
I use the following function "photo" for adding photos:
newcommand{photo}[3] {
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=0.4textheight]{#2}
end{center}
caption{#3}
label{foto:#1}
end{figure}
}
However, it often happens that on the very last page of the chapter only one (last) image is shown. As I'm using the scaling, it scales the image to the same 0.4-size, which in this case is not needed, as the remaining part of the page is left empty anyway (end of the chapter), and even scaling up to 0.9textheight would be possible.
The problem is that I don't know whether the photo is floated to the end of the paragraph or not. Or, is the photo positioned to the last page filled with some text also or with lots of free space available.
The book is actually generated by the program (it is a family tree book, automatically split into chapters), I don't want to edit this manually.
So, is there an option in Latex (LuaLaTex) to
- scale the images to the requested size normally, but
- scale the image up to fill the page in case there is empty space available anyway.
(In short, the scaling should depend on the position where the photo is placed after floating.)
graphics size
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I write a book with several chapters. Every chapter contains several (floating) images, usually photos in standard landscape-style, therefore they are scaled to the size of 0.4textheight so that at least two images fit to the page with the captions (to save space).
I use the following function "photo" for adding photos:
newcommand{photo}[3] {
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=0.4textheight]{#2}
end{center}
caption{#3}
label{foto:#1}
end{figure}
}
However, it often happens that on the very last page of the chapter only one (last) image is shown. As I'm using the scaling, it scales the image to the same 0.4-size, which in this case is not needed, as the remaining part of the page is left empty anyway (end of the chapter), and even scaling up to 0.9textheight would be possible.
The problem is that I don't know whether the photo is floated to the end of the paragraph or not. Or, is the photo positioned to the last page filled with some text also or with lots of free space available.
The book is actually generated by the program (it is a family tree book, automatically split into chapters), I don't want to edit this manually.
So, is there an option in Latex (LuaLaTex) to
- scale the images to the requested size normally, but
- scale the image up to fill the page in case there is empty space available anyway.
(In short, the scaling should depend on the position where the photo is placed after floating.)
graphics size
I write a book with several chapters. Every chapter contains several (floating) images, usually photos in standard landscape-style, therefore they are scaled to the size of 0.4textheight so that at least two images fit to the page with the captions (to save space).
I use the following function "photo" for adding photos:
newcommand{photo}[3] {
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=0.4textheight]{#2}
end{center}
caption{#3}
label{foto:#1}
end{figure}
}
However, it often happens that on the very last page of the chapter only one (last) image is shown. As I'm using the scaling, it scales the image to the same 0.4-size, which in this case is not needed, as the remaining part of the page is left empty anyway (end of the chapter), and even scaling up to 0.9textheight would be possible.
The problem is that I don't know whether the photo is floated to the end of the paragraph or not. Or, is the photo positioned to the last page filled with some text also or with lots of free space available.
The book is actually generated by the program (it is a family tree book, automatically split into chapters), I don't want to edit this manually.
So, is there an option in Latex (LuaLaTex) to
- scale the images to the requested size normally, but
- scale the image up to fill the page in case there is empty space available anyway.
(In short, the scaling should depend on the position where the photo is placed after floating.)
graphics size
graphics size
edited Aug 10 '17 at 12:47
asked Aug 10 '17 at 9:40
Sulev Reisberg
262
262
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37
add a comment |
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I understand that you use photo
command to include images, then you know when there are two or only one image at end of chapter. So I think it's easier to change scaling factor by hand when you need it than writing an automatic way.
In any case, you can introduce a fourth (optional) parameter to your photo
command which is the scale factor (0.4 by default). When you want a full page image, just write photo[0.9]{label}{image-file}{caption}
newcommand{photo}[4][0.4]{
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=#1textheight]{#3}
end{center}
caption{#4}
label{foto:#2}
end{figure}
}
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I understand that you use photo
command to include images, then you know when there are two or only one image at end of chapter. So I think it's easier to change scaling factor by hand when you need it than writing an automatic way.
In any case, you can introduce a fourth (optional) parameter to your photo
command which is the scale factor (0.4 by default). When you want a full page image, just write photo[0.9]{label}{image-file}{caption}
newcommand{photo}[4][0.4]{
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=#1textheight]{#3}
end{center}
caption{#4}
label{foto:#2}
end{figure}
}
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
add a comment |
up vote
0
down vote
I understand that you use photo
command to include images, then you know when there are two or only one image at end of chapter. So I think it's easier to change scaling factor by hand when you need it than writing an automatic way.
In any case, you can introduce a fourth (optional) parameter to your photo
command which is the scale factor (0.4 by default). When you want a full page image, just write photo[0.9]{label}{image-file}{caption}
newcommand{photo}[4][0.4]{
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=#1textheight]{#3}
end{center}
caption{#4}
label{foto:#2}
end{figure}
}
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
add a comment |
up vote
0
down vote
up vote
0
down vote
I understand that you use photo
command to include images, then you know when there are two or only one image at end of chapter. So I think it's easier to change scaling factor by hand when you need it than writing an automatic way.
In any case, you can introduce a fourth (optional) parameter to your photo
command which is the scale factor (0.4 by default). When you want a full page image, just write photo[0.9]{label}{image-file}{caption}
newcommand{photo}[4][0.4]{
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=#1textheight]{#3}
end{center}
caption{#4}
label{foto:#2}
end{figure}
}
I understand that you use photo
command to include images, then you know when there are two or only one image at end of chapter. So I think it's easier to change scaling factor by hand when you need it than writing an automatic way.
In any case, you can introduce a fourth (optional) parameter to your photo
command which is the scale factor (0.4 by default). When you want a full page image, just write photo[0.9]{label}{image-file}{caption}
newcommand{photo}[4][0.4]{
begin{figure}[htbp]
begin{center}
leavevmode
includegraphics[height=#1textheight]{#3}
end{center}
caption{#4}
label{foto:#2}
end{figure}
}
answered Aug 10 '17 at 10:31
Ignasi
90.6k4164303
90.6k4164303
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
add a comment |
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
You are right. But the problem is that I don't know whether the photo is floated to the end of the paragraph or not. In addition, as the book is actually generated by program (it is a family tree book, automatically split into chapters), I don't want to edit this manually later on.
– Sulev Reisberg
Aug 10 '17 at 11:50
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
So, as far as I understand, the scaling should depend on the position where the photo is placed after floating.
– Sulev Reisberg
Aug 10 '17 at 12:07
1
1
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
I think all this information is important enough to be mentioned in the question. This way you will avoid answers like mine
– Ignasi
Aug 10 '17 at 12:36
add a 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f385690%2fuse-alternate-scaling-of-the-image-if-there-is-empty-space-available%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
As long as you use LaTeX's built-in float mechanism, you can't know where exactly LaTeX is going to place your figure. Also, while I don't know what your figures look like, I would think that scaling them up just to fill the space would result in a rather uneven appearance. I would try to keep the proportions, font size etc. consistent between figures.
– Michael Palmer
Sep 9 '17 at 13:37