# Using PlasTex, How can I control the size of my images using \includegraphics

I am running plasTex 1.0.0 and I cannot properly control my image size. Using the \includegraphics[width=10in]{path_to_image} command plasTex fails to resize the image at all, outputting the original size. If I use \scalebox or \resizebox I can begin to size my images, but they have an arbitrary upper size limit. I have checked my python packages for extra commands but I do not have any at my disposal. I have also tried just putting the image in a minipageenvironment but that outputs the original size image. Is there a way to size these images more effectively?

The Code:

\ifplastex
\begin{figure}[h!]
\scalebox{0.5}
{\includegraphics{1_gettingstarted/tutorial_images/1_interfaceLayout.png}}
\caption{test}
\label{fig:interfaceLayout}
\end{figure}
\else
\fi

• I should note that I am using plasTex to convert to html. – nsahlin Dec 6 '18 at 17:09
• Welcome to TeX.sx! With plasTeX 0.9.1 I have not this problem, in HTML format it add style="width:10in" and the image is displayed accordingly. It is not possible to say much more without more information (ideally a minimal working example (MWE) of your input and output). – Fran Dec 6 '18 at 17:42
• But the final size in the browser is not necessarily 10in, if that is the question. I guess that the zoon and monitor settings also matter. – Fran Dec 6 '18 at 17:53
• Beyond 8.1 inches of width the image is cut off to the right hand side. So, the largest image width I can have is 8.1 inches. Small than 8.1 inches works but I want the image to be about 11 inches which results in a large portion of the image being cut off on the right hand side (1.9 inches worth). – nsahlin Dec 6 '18 at 19:08
• Fran, Could you please provide me with your code? I have given my code above. Thanks – nsahlin Dec 6 '18 at 22:03

As requested by the OP, an example that not reproduce the issue, with a image of width 10in and 1in without/with a float, both not cropped and showing the correct size with JPG images:

The page was generated with plasTeX 0.9.1 in this way:

plastex file.tex


file.tex:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=10in]{example-image.jpg}
\begin{figure}[htp]
\centering
\includegraphics[width=1in]{example-image.jpg}
\caption{xxx}
\label{xxx}
\end{figure}
\end{document}


Compiled with pdflatex should produce this PDF:

Note 1: if the source is the PDF version of the image (example-image.pdf of the mwe package) plasTeX will produce an error.

Note 2: Work also with the PNG version, but note that the original example-image.png is a bit flattened with respect the PNG and PDF versions, so is not a fault of plasTeX: