[Tex/LaTex] How to add border for an image


I use \includegraphics command to insert image to the document. But how can I add a border around this image w/o any margin between border lines and image?
It seems to be very easy, but I can't find it in the documentation.

Best Answer

You can add a frame around it by placing it inside a \fbox{...} command.


The distance can be set by changing the \fboxsep length and the line width with the \fboxrule length, e.g. to draw a tight 1pt thick rule around the image use:


Using a recent version of my adjustbox package you can use:

% ...
\includegraphics[<your options>,frame]{image}% tight frame
% or 
\includegraphics[<your options>,fbox]{image}% Like normal \fbox

There is also cframe and cfbox for colored frames. All of these allow for multiple optional values, e.g. frame=<rule width>. See the manual for more information.

Related Question