1

As you can see in the picture below, the diagram is shifted to the left. The code I am using to display this image is give below:

\begin{center}
\includegraphics[width=\textwidth]{"Law 2".png}
\end{center}

The name of the image file is "Law 2". How should I go about fixing this problem? I've also read answers to a related question, but, since I am a beginner in Latex, it's difficult for me to understand their logic. So, an ideal answer would be one that strictly deals with my case.
enter image description here

Update 1

After trying \fbox{\includegraphics{"Law 2".png}} I got, the following:

enter image description here

Update 2

After trying \fbox{\includegraphics[width=\textwidth]{"Law 2".png}} I got the following picture:

enter image description here

Student
  • 567
  • 2
    Perhaps, there's a lot of white space on the left boundary of the image? If this is the case, the center environment will use this white space too in order to provide the 'correctfilling. Use\fbox{\includegraphics{...}}` and you will see the amount of white space. –  Jun 16 '16 at 17:47
  • 3
    Probably, the bounding box of the graphics file is wider than what see. To check this point,, use \fbox{\includegraphics{Law_2.png} (note I replaced the blank space in the file name with an underscore). – Bernard Jun 16 '16 at 17:50
  • @ChristianHupfer, I did as you suggested. What should I do now? – Student Jun 16 '16 at 17:55
  • 2
    What happens if you try \fbox{\includegraphics[width=\textwidth]{"Law 2".png}}? Looks like much of the white space is part of the image, so maybe cropping it (either with an external program or latex) might help. – samcarter_is_at_topanswers.xyz Jun 16 '16 at 17:57
  • 4
    Do \includegraphics[trim=20 0 0 0,width=\textwidth]{Law2.png} (avoid spaces in file names, but the trick with quotes can work). Experiment with various values instead of 20 until you get a satisfying output (keep \fbox during the attempts). Or clip the image with some specialized software. – egreg Jun 16 '16 at 17:58
  • 1
    Offtopic: but are you sure that the image should not have a caption? – samcarter_is_at_topanswers.xyz Jun 16 '16 at 18:00
  • 1
    @ShreyAryan: See the other comments, they were apparently better than mine –  Jun 16 '16 at 18:00
  • @egreg What does the value "20" represent? Am I supposed to increase it or decrease it? Can I make it negative? And what about the zeroes after "20"? Are they of any relevance to solving my problem? – Student Jun 16 '16 at 18:07
  • @egreg Your technique worked! Thank you so much... – Student Jun 16 '16 at 18:09

0 Answers0