0

For some reason the graphics is rendered above the text. I'm using xelatex (with Chinese characters).

The relevant Chinese latex compiled using xelatex is on pastebin as for some reason stackexchange won't let me post some Chinese characters.

http://pastebin.com/21uAah13

It probably has something to do with the trimming being faulty. Any help would be much appreciated.

enter image description here

EDIT:

Removing all the other unnecessary packages, removing sections and substituting the Chinese characters with English:

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{graphicx}    

\begin{document}

AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
\begin{figure}[h!]
\includegraphics[trim={4cm 8cm 4cm 5.5cm},clip,height=8cm]{BotnetFamPie}
\end{figure}

\end{document}

Screenshot:

enter image description here

Without the trim and clip:

enter image description here

LaRiFaRi
  • 43,807
M. Shaw
  • 121
  • Welcome! A figure is a float. Floats are designed to float. That is, LaTeX moves them to where it thinks best. If you don't want that, don't use figure. Just say \includegraphics{}. You can get a caption using \captionof{figure}{} from the caption or capt-of packages. – cfr Aug 06 '15 at 02:21
  • @cfr I removed the figure and just used includegraphics{} but the graphic is still covering the text. – M. Shaw Aug 06 '15 at 02:31
  • Don't use \centerline. Use \centering within a group or the center environment. – cfr Aug 06 '15 at 03:20
  • @cfr I removed the \centerline and it's still covering up the text. – M. Shaw Aug 06 '15 at 03:20
  • @LaRiFaRi I really think it has something to do with the trimming. I've added the English version of the same report compiled with pdflatex instead of xelatex and the relevant latex. – M. Shaw Aug 06 '15 at 08:03
  • @LaRiFaRi Changed both Chinese and English versions to be compilable. The graphics I'm trying to include is a png file. – M. Shaw Aug 06 '15 at 08:23
  • @LaRiFaRi Added the minimal relevant code and screenshot. – M. Shaw Aug 06 '15 at 08:38
  • Much better. I will delete my previous comments as this is getting so long. Please delete hhline as well. Try, if you get the same problem with article, too. If yes, change it for the MWE. If you load \usepackage{showframe}, you will see that your geometry settings are not perfect. But that is another topic. – LaRiFaRi Aug 06 '15 at 08:59
  • @LaRiFaRi Changing the documentclass to article and adding the trim and clip back will still have the image cover the text. I am unable to test this with pdflatex as the .tex file is encoded in UTF-8 which I when I try to use pdflatex despite the lack of Chinese characters gives me a lot of Text line contains an invalid character. errors. – M. Shaw Aug 06 '15 at 09:04
  • Ok, the issue is about clipping images in XeLaTeX. You will have to use an adjustbox instead. Just see in the duplicate I will link to in a second. One tip for the future: when you are doing some clipping, you might want to do \fbox{\includegraphics...} first in order to see the actual borders of your figure. Good luck with your TeXing! – LaRiFaRi Aug 06 '15 at 09:11

0 Answers0