图片宽度问题

图片宽度问题

我需要在两栏纸上制作一栏宽度的图片,我写了\linewidth但不起作用,如下所示;它比宽度还小,而且非常小。我需要把它放大;有什么帮助吗?

我的照片

\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{Data/classoutput.eps}\label{pic10}
\caption{Caption}
\end{figure}

答案1

你的图片周围有很多空白。你可以用

\includegraphics[trim=20 20 20 20,clip]{...}

(选择正确的四个值,在我的例子中,四边都是 20pt)。

答案2

使用 PSTricks。

在此处输入图片描述

% filename is main.tex
% compile it with pdflatex -shell-escape main.tex

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{dummy.tex}
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks}
\usepackage{graphicx}
\newsavebox\IBox
\sbox\IBox{\includegraphics{example-image-a}}

\psset
{
    xunit=\dimexpr\wd\IBox/10,
    yunit=\dimexpr\ht\IBox/10,
}

\addtopsstyle{gridstyle}
{
    griddots=0,
    gridcolor=red,
    gridwidth=0.4pt,
    subgriddiv=5,
    subgridcolor=green!50,
    subgridwidth=0.1pt,
    gridlabels=5pt,
}

\begin{document}
\begin{pspicture}[showgrid=top](10,10)
    \rput[bl](0,0){\usebox\IBox}
\end{pspicture}

\begin{pspicture}[showgrid=false](5,5)(10,10)
\psclip{\psframe[dimen=middle,linestyle=none](5,5)(10,10)}
    \rput[bl](0,0){\usebox\IBox}
\endpsclip
\end{pspicture}
\end{document}
\end{filecontents*}

\immediate\write18{latex dummy}
\immediate\write18{dvips dummy}
\immediate\write18{ps2pdf dummy.ps}


\usepackage{graphicx}
\begin{document}
Karl's students do not care about dashing patterns.
\begin{figure}[hbtp]
\centering
\includegraphics[page=2,width=0.8\linewidth]{dummy}
\caption{The cropped image}
\label{fig:TheCroppedImage}
\end{figure}
Karl's students do not care about arrow tips. Karl's students, by the way, do not know what a transformation matrix is.
\end{document}

相关内容