How to log scaling applied by includegraphics?
I'm currently working on a large-ish document that contains a lot of screenshots. These range from relatively small dialog boxes or details of the screen to some very large overview pictures. I currently use the option width=textwidth
for the larger screenshots to scale them down to fit the page (somewhat). I also need to apply some scaling to the other screenshots - some larger images need to be scaled down, some details need to be scaled up.
Now I would like to use a small set of scaling factors throughout the document. The screenshots are all taken from a single application, and I'd rather not have the font size and UI details change size from image to image. To achieve that, my current plan is to use only two or three fixed scaling factors throughout the document. I can apply these manually in the source code, but I need to determine the actual values first. For that, I was thinking about setting every image to width=textwidth
, recording the actual scaling applied and then classifying and adjusting the scaling factors.
As far as I can see, the original size and the requested size of each image file is contained in the log file, but on separate lines and in a syntax that is not very parser-friendly. Is there a better way to log the actual scaling factor that is applied to the image?
graphics scaling includegraphics
|
show 2 more comments
I'm currently working on a large-ish document that contains a lot of screenshots. These range from relatively small dialog boxes or details of the screen to some very large overview pictures. I currently use the option width=textwidth
for the larger screenshots to scale them down to fit the page (somewhat). I also need to apply some scaling to the other screenshots - some larger images need to be scaled down, some details need to be scaled up.
Now I would like to use a small set of scaling factors throughout the document. The screenshots are all taken from a single application, and I'd rather not have the font size and UI details change size from image to image. To achieve that, my current plan is to use only two or three fixed scaling factors throughout the document. I can apply these manually in the source code, but I need to determine the actual values first. For that, I was thinking about setting every image to width=textwidth
, recording the actual scaling applied and then classifying and adjusting the scaling factors.
As far as I can see, the original size and the requested size of each image file is contained in the log file, but on separate lines and in a syntax that is not very parser-friendly. Is there a better way to log the actual scaling factor that is applied to the image?
graphics scaling includegraphics
The termHow to log scaling
can be misunderstood aslogarithmic scaling
– Christian Hupfer
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first
– Christian Hupfer
1 hour ago
If you useadjustimage
from theadjustbox
package the previous width of the image is provided aswidth
dimension register which can be used withifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is whatadjustbox
acutally does).
– Martin Scharrer♦
1 hour ago
and then there are themin width
andmax width
keys provided byadjustbox
which only scale if needed. Something likeadjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.
– Martin Scharrer♦
1 hour ago
|
show 2 more comments
I'm currently working on a large-ish document that contains a lot of screenshots. These range from relatively small dialog boxes or details of the screen to some very large overview pictures. I currently use the option width=textwidth
for the larger screenshots to scale them down to fit the page (somewhat). I also need to apply some scaling to the other screenshots - some larger images need to be scaled down, some details need to be scaled up.
Now I would like to use a small set of scaling factors throughout the document. The screenshots are all taken from a single application, and I'd rather not have the font size and UI details change size from image to image. To achieve that, my current plan is to use only two or three fixed scaling factors throughout the document. I can apply these manually in the source code, but I need to determine the actual values first. For that, I was thinking about setting every image to width=textwidth
, recording the actual scaling applied and then classifying and adjusting the scaling factors.
As far as I can see, the original size and the requested size of each image file is contained in the log file, but on separate lines and in a syntax that is not very parser-friendly. Is there a better way to log the actual scaling factor that is applied to the image?
graphics scaling includegraphics
I'm currently working on a large-ish document that contains a lot of screenshots. These range from relatively small dialog boxes or details of the screen to some very large overview pictures. I currently use the option width=textwidth
for the larger screenshots to scale them down to fit the page (somewhat). I also need to apply some scaling to the other screenshots - some larger images need to be scaled down, some details need to be scaled up.
Now I would like to use a small set of scaling factors throughout the document. The screenshots are all taken from a single application, and I'd rather not have the font size and UI details change size from image to image. To achieve that, my current plan is to use only two or three fixed scaling factors throughout the document. I can apply these manually in the source code, but I need to determine the actual values first. For that, I was thinking about setting every image to width=textwidth
, recording the actual scaling applied and then classifying and adjusting the scaling factors.
As far as I can see, the original size and the requested size of each image file is contained in the log file, but on separate lines and in a syntax that is not very parser-friendly. Is there a better way to log the actual scaling factor that is applied to the image?
graphics scaling includegraphics
graphics scaling includegraphics
asked 1 hour ago
vwegert
1,27711131
1,27711131
The termHow to log scaling
can be misunderstood aslogarithmic scaling
– Christian Hupfer
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first
– Christian Hupfer
1 hour ago
If you useadjustimage
from theadjustbox
package the previous width of the image is provided aswidth
dimension register which can be used withifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is whatadjustbox
acutally does).
– Martin Scharrer♦
1 hour ago
and then there are themin width
andmax width
keys provided byadjustbox
which only scale if needed. Something likeadjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.
– Martin Scharrer♦
1 hour ago
|
show 2 more comments
The termHow to log scaling
can be misunderstood aslogarithmic scaling
– Christian Hupfer
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first
– Christian Hupfer
1 hour ago
If you useadjustimage
from theadjustbox
package the previous width of the image is provided aswidth
dimension register which can be used withifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is whatadjustbox
acutally does).
– Martin Scharrer♦
1 hour ago
and then there are themin width
andmax width
keys provided byadjustbox
which only scale if needed. Something likeadjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.
– Martin Scharrer♦
1 hour ago
The term
How to log scaling
can be misunderstood as logarithmic scaling
– Christian Hupfer
1 hour ago
The term
How to log scaling
can be misunderstood as logarithmic scaling
– Christian Hupfer
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first– Christian Hupfer
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first– Christian Hupfer
1 hour ago
If you use
adjustimage
from the adjustbox
package the previous width of the image is provided as width
dimension register which can be used with ifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is what adjustbox
acutally does).– Martin Scharrer♦
1 hour ago
If you use
adjustimage
from the adjustbox
package the previous width of the image is provided as width
dimension register which can be used with ifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is what adjustbox
acutally does).– Martin Scharrer♦
1 hour ago
and then there are the
min width
and max width
keys provided by adjustbox
which only scale if needed. Something like adjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.– Martin Scharrer♦
1 hour ago
and then there are the
min width
and max width
keys provided by adjustbox
which only scale if needed. Something like adjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.– Martin Scharrer♦
1 hour ago
|
show 2 more comments
1 Answer
1
active
oldest
votes
You could try this:
documentclass{article}
usepackage{graphicx}
usepackage{etoolbox}
makeatletter
apptoGPT@setup@scale{wlog{x-scale: Gin@scalex, y-scale: Gin@scaley}}
begin{document}
includegraphics[width=textwidth]{example-image-duck}
includegraphics[width=textwidth]{example-image-a}
end{document}
It will log
File: example-image-duck.pdf Graphic file (type pdf)
x-scale: 1.8696, y-scale: 1.8696
and
File: example-image-a.pdf Graphic file (type pdf)
x-scale: 1.07413, y-scale: 1.07413
add a 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%2f467890%2fhow-to-log-scaling-applied-by-includegraphics%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 try this:
documentclass{article}
usepackage{graphicx}
usepackage{etoolbox}
makeatletter
apptoGPT@setup@scale{wlog{x-scale: Gin@scalex, y-scale: Gin@scaley}}
begin{document}
includegraphics[width=textwidth]{example-image-duck}
includegraphics[width=textwidth]{example-image-a}
end{document}
It will log
File: example-image-duck.pdf Graphic file (type pdf)
x-scale: 1.8696, y-scale: 1.8696
and
File: example-image-a.pdf Graphic file (type pdf)
x-scale: 1.07413, y-scale: 1.07413
add a comment |
You could try this:
documentclass{article}
usepackage{graphicx}
usepackage{etoolbox}
makeatletter
apptoGPT@setup@scale{wlog{x-scale: Gin@scalex, y-scale: Gin@scaley}}
begin{document}
includegraphics[width=textwidth]{example-image-duck}
includegraphics[width=textwidth]{example-image-a}
end{document}
It will log
File: example-image-duck.pdf Graphic file (type pdf)
x-scale: 1.8696, y-scale: 1.8696
and
File: example-image-a.pdf Graphic file (type pdf)
x-scale: 1.07413, y-scale: 1.07413
add a comment |
You could try this:
documentclass{article}
usepackage{graphicx}
usepackage{etoolbox}
makeatletter
apptoGPT@setup@scale{wlog{x-scale: Gin@scalex, y-scale: Gin@scaley}}
begin{document}
includegraphics[width=textwidth]{example-image-duck}
includegraphics[width=textwidth]{example-image-a}
end{document}
It will log
File: example-image-duck.pdf Graphic file (type pdf)
x-scale: 1.8696, y-scale: 1.8696
and
File: example-image-a.pdf Graphic file (type pdf)
x-scale: 1.07413, y-scale: 1.07413
You could try this:
documentclass{article}
usepackage{graphicx}
usepackage{etoolbox}
makeatletter
apptoGPT@setup@scale{wlog{x-scale: Gin@scalex, y-scale: Gin@scaley}}
begin{document}
includegraphics[width=textwidth]{example-image-duck}
includegraphics[width=textwidth]{example-image-a}
end{document}
It will log
File: example-image-duck.pdf Graphic file (type pdf)
x-scale: 1.8696, y-scale: 1.8696
and
File: example-image-a.pdf Graphic file (type pdf)
x-scale: 1.07413, y-scale: 1.07413
answered 26 mins ago
Ulrike Fischer
186k7290669
186k7290669
add a comment |
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%2f467890%2fhow-to-log-scaling-applied-by-includegraphics%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 term
How to log scaling
can be misunderstood aslogarithmic scaling
– Christian Hupfer
1 hour ago
@ChristianHupfer I know that "science" is a verb now, but "to logarithmic" is a new one to me...
– vwegert
1 hour ago
to logarithmic
is of course no verb (as long as I am not errant), but given some usual laziness with titles here, the title can be misunderstood at first– Christian Hupfer
1 hour ago
If you use
adjustimage
from theadjustbox
package the previous width of the image is provided aswidth
dimension register which can be used withifdimwidth>somevalue
etc. You could also just store the image in a box and take the box size as indicator (which is whatadjustbox
acutally does).– Martin Scharrer♦
1 hour ago
and then there are the
min width
andmax width
keys provided byadjustbox
which only scale if needed. Something likeadjustimage{min width=0.5textwidth, max width=textwidth}{image file name}
will work to ensure that images are neither to small or to large.– Martin Scharrer♦
1 hour ago