0

I am using Revtext 4.2 documents with 2 columns. I tried to add a picture by using the following line of code:

\begin{figure}[b]
    \includegraphics[width=\textwidth]{grad}
    \caption{Visualization of Gradient Descent}
    \label{fig:Gradient}
\end{figure}    

This blew up the size of the picture and was about half a page big. Here is a picture of what it looked like:

enter image description here

I have try to use the solution presented in this thread enter link description here

And rewrote my code as such:

\begin{figure}
    \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{grad}
    \caption{Visualization of Gradient Descent}
    \label{fig:Gradient}
\end{figure}    

which only made it worse: enter image description here

Full code with similar effect:

\documentclass[%
 reprint,
%superscriptaddress,
%groupedaddress,
%unsortedaddress,
%runinaddress,
%frontmatterverbose, 
%preprint,
%preprintnumbers,
%nofootinbib,
%nobibnotes,
%bibnotes,
 amsmath,amssymb,
 aps,
%pra,
%prb,
%rmp,
%prstab,
%prstper,
%floatfix,
]{revtex4-2}

\usepackage{graphicx}% Include figure files \usepackage{dcolumn}% Align table columns on decimal point \usepackage{bm}% bold math %\usepackage{hyperref}% add hypertext capabilities %\usepackage[mathlines]{lineno}% Enable numbering of text and display math %\linenumbers\relax % Commence numbering lines

%\usepackage[showframe,%Uncomment any one of the following lines to test %%scale=0.7, marginratio={1:1, 2:3}, ignoreall,% default settings %%text={7in,10in},centering, %%margin=1.5in, %%total={6.5in,8.75in}, top=1.2in, left=0.9in, includefoot, %%height=10in,a5paper,hmargin={3cm,0.8in}, %]{geometry}

\usepackage{physics} \usepackage{tikz} \usepackage{caption} \usetikzlibrary{quantikz}

\DeclareUnicodeCharacter{2212}{-} \begin{document}

\date{\today} \maketitle

\begin{figure} \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{grad} \caption{Visualization of Gradient Descent} \label{fig:Gradient} \end{figure}

\bibliographystyle{plain} \nocite{*} \bibliography{reference.bib} \end{document}

imnothere
  • 14,215
  • 5
    Definitely not "for no reason". width=\textwidth is making it as big as it needs to be to fill the page horizontally, and height=\textheight will make it as big as it needs to be to fill the page vertically.. If you don't want it that big, leave those out, or use width= something else, like \columnwidth maybe, or some fraction of \textwidth like 0.25\textwidth. You can also use scale= to set the size relative to the size of the original image instead. But it's you that's making it that big. – frabjous Mar 22 '22 at 00:56
  • 2
    latex will not scale the images at all unless you specify that they be scaled. You do not need to prevent anything. – David Carlisle Mar 22 '22 at 01:00

0 Answers0