0

I installed texlive on Fedora 32 with all CTAN packages, I did not know it would be too big and I only wanted to have luatex, I already had latex but did a clean install.

Then created a CV document with luatex. But that system is not booting anymore, as I had the source on Github, cloned it to another system (Mac OS Mojave) and installed tex distribution with lualatex. But when I compiled that same document, \includegraphics showed strange behaviour. I had the figure setup like this

\begin{minipage}{0.22\textwidth}
    \frame{\includegraphics{my-pic.png}}
\end{minipage}

But the included picture took half of page's length and overflowed to right, previously when compiled on Fedora, it looked like a passport size photo as you would see on a CV on the top right corner of page.

I changed the scaling to \includegraphics[scale=0.235]{my-pic.png}} and it became the size of before but when I compared it with an older copy, there's a slight difference in them due to scaling but what I don't understand is why the behaviour changed when compiled to different OS?

And lualatex did not took into account the size of minipage that was available, I did not had to do this on Fedora and it considered the available size automatically.

I did not commit my picture to git and so I had to take it from an online site, where I uploaded it for profile purposes. But I am sure sizes are same as I used same picture in both places.

EDIT: Used texlive installation on both OS. EDIT2: texlive version 2020 on both OS. On Mac through MacTex package and on Fedora through dnf.

3
  • it is highly unlikely that the operating system makes any difference. The version of luatex might though, but you have given no information about that, nor a test file to reproduce the problem so it is hard to say anything. Commented Dec 8, 2020 at 20:45
  • the minipage will have no effect on the scaling of the graphic. Commented Dec 8, 2020 at 20:46
  • sorry for late reply, I'll update the question @DavidCarlisle
    – ateebahmed
    Commented Dec 11, 2020 at 10:52

1 Answer 1

1

It's almost certainly the case that the png file was modified when it was uploaded to the online site or during the download. Unless you did a direct file transfer. There is no reason that the OS would impact this.

A PNG file includes a resolution specification in the file and that's used, combined with the actual number of pixels, to determine the natural size of the image. I'm guessing that what happened is that when you uploaded to the profile site, that site modified the resolution (or erased it completely so that the default \pdfimageresolution of 72dpi is used).

What you probably want to do, rather than scaling by a scale is to specify the width to fit your space, e.g., something along the lines of:

\begin{minipage}{0.22\textwidth}
    \frame{\includegraphics[width=\textwidth]{my-pic.png}}
\end{minipage}
2
  • yes, it could be likely the resizing but I saw the sizes and they were same as much as I remember. I'll try your suggestion.
    – ateebahmed
    Commented Dec 11, 2020 at 10:56
  • 1
    It's not the visible size but an internal setting in the png file that determines the nominal resolution. On-screen the files will be indistinguishable.
    – Don Hosek
    Commented Dec 11, 2020 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .