You can crop your image with graphicx
.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
% Answer: [trim={left bottom right top},clip]
% Ex. 1: trim from left edge
\includegraphics[trim={5cm 0 0 0},clip]{example-image-a}
% Ex. 2: trim from right edge
\includegraphics[trim={0 0 5cm 0},clip]{example-image-a}
\end{document}
Use the trim
option, which takes four space separated values.
trim={<left> <lower> <right> <upper>}
If you don’t give a unit, the package assumes bp
i.e. big points to be the unit. After setting these values you must activate the cropping with clip=true
or just clip
.
If you combine trim
with height
or something similar the image will be cropped and then resized. That means that the crop values must fit the original size. If found no solution to say crop to 50 % width.
Update
As Martin said in the comments you can use adjustbox
to clip the image exactly by 50 %. Note that you must replace \includegraphics
by \adjincludegraphics
, to access the \width
.
\documentclass{article}
\usepackage[export]{adjustbox}
\begin{document}
\adjincludegraphics[height=5cm,trim={0 0 {.5\width} 0},clip]{example-image-a}
\end{document}
adjustbox
also provides \height
, \depth
and \totalheight
.
adjustbox
.graphicx
can crop images by itself, and the OP doesn't want any non-core package anyway.graphicx
notgraphicsx
and its a very old package and part of the required set of packages for LaTeX.