{"id":859,"date":"2012-05-10T16:41:02","date_gmt":"2012-05-10T20:41:02","guid":{"rendered":"http:\/\/hargaden.com\/enda\/?p=366"},"modified":"2012-05-10T16:41:02","modified_gmt":"2012-05-10T20:41:02","slug":"some-help-with-common-latex-problems","status":"publish","type":"post","link":"https:\/\/hargaden.com\/enda\/some-help-with-common-latex-problems\/","title":{"rendered":"Some help with common LaTeX problems"},"content":{"rendered":"<blockquote><p>What&#8217;s the easiest way to include a graphic (or graph, diagram, figure etc.) in my document?<\/p><\/blockquote>\n<p>[code]<br \/>\n\\documentclass{article}<br \/>\n\\usepackage{graphicx}<br \/>\n\\begin{document}<br \/>\n\\begin{figure}[h]<br \/>\n\\centering<br \/>\n\\caption{This is my picture}<br \/>\n\\includegraphics[width=5in,height=3in]{adamsmith.jpg}<br \/>\n\\end{figure}<br \/>\n\\end{document}<br \/>\n[\/code]<br \/>\nThen compile using <b>pdflatex<\/b>.<\/p>\n<blockquote><p>I&#8217;m getting a &#8220;no BoundingBox&#8221; error when I compile my document.<\/p><\/blockquote>\n<p>Have you tried compiling the document with pdflatex? In WinEdt, select PDFLaTeX from the dropdown menu that&#8217;s below &#8216;Accessories&#8217; on the menu bar, and to the right of the recycle bin icon. If you&#8217;re compiling from the command prompt and your document is named thesis.tex, type <tt>pdflatex thesis<\/tt>.<\/p>\n<blockquote><p>I&#8217;m trying to compile my document and I am using natbib to do the references, but the document won&#8217;t compile with PDFLaTeX.<\/p><\/blockquote>\n<p>It&#8217;s unfortunate that natbib (as far as I can see) relies on latex (not pdflatex) but latex gets confused if you have graphics in the document. My workaround for this is to temporarily place a % sign in front of any graphics to turn them into comments, rather than code. This means the graphics are initially excluded, and you can run latex\/bibtex and natbib will work. Once all the references are good and ready, you can remove the % signs (a quick Find > Replace All will do the trick) and compile using pdflatex.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What&#8217;s the easiest way to include a graphic (or graph, diagram, figure etc.) in my document? [code] \\documentclass{article} \\usepackage{graphicx} \\begin{document} \\begin{figure}[h] \\centering \\caption{This is my picture} \\includegraphics[width=5in,height=3in]{adamsmith.jpg} \\end{figure} \\end{document} [\/code] Then compile using pdflatex. I&#8217;m&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-859","post","type-post","status-publish","format-standard","hentry","category-latex"],"_links":{"self":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts\/859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/comments?post=859"}],"version-history":[{"count":0,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts\/859\/revisions"}],"wp:attachment":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/media?parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/categories?post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/tags?post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}