Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Png me!

  • 06-04-2010 4:14pm
    #1
    Closed Accounts Posts: 6,609 ✭✭✭


    Hi, I have been trying to place a graph on a page using Latex. I never imported a graphic before so I decided to follow the Wikibook manual but I ended up nowhere. I scoured the internet and found that I need to use epstopdf to convert my png file into pdf because my non-bitmap file has no bounding box.

    Okey-doke. I see that epstopdf is in the /bin folder. So, how do I get this old girl working?


    PS: I'm using pdftex.


Comments

  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Nahhhh, no need to go through that. Pdflatex can embed PNGs no problem.

    \documentclass{article}
    \usepackage{graphicx}
    \begin{document}
    \begin{figure}[h]
    \centering
    \caption{My milkshake brings all the boys to the yard}
    \includegraphics[width=5in,height=3in]{milkshake.png}
    \end{figure}
    \end{document}


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Nah, I still get the boundingbox error. The picture file is attached. It's a jpg now.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    \documentclass{article}
    \usepackage{graphicx}
    \begin{document}
    \begin{figure}[h]
    \centering
    \caption{My milkshake brings all the boys to the yard}
    \includegraphics[width=5in,height=3in]{FigureA.jpg}
    \end{figure}
    \end{document}

    Make sure you're pdflatex'ing it, because I got the attached.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    \documentclass{article}
    \usepackage{graphicx}
    \begin{document}
    \begin{figure}[h]
    \centering
    \caption{My milkshake brings all the boys to the yard}
    \includegraphics[width=5in,height=3in]{FigureA.jpg}
    \end{figure}
    \end{document}

    Make sure you're pdflatex'ing it, because I got the attached.

    Ok, I copied and pasted your exact post and complied using LaTeX=> PS => PDF. I have attached the outcome of it and the warnings are below. pdftex seems to run, according to the dialog box at the bottom, which says "this is pdftex version 3.234284, etc, etc. I get this:

    Latex error: Cannot determine size of graphic in FigureA.jpg (no BoundingBox)

    Warning: Overfull \hbox (16.44919pt too wide in paragraph at lines 7--8.

    So I changed the size to cm instead of inches, and ran again. This removed the warning, but the output is identical.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    LaTeX=> PS => PDF.

    I think here's your problem.

    I don't know about you and your fancy proTeXt solutions but I carve my TeX by hand you can also compile from the command line.
    1. Click on Start > Run, enter "cmd"
    2. cd "c:/users/Flamed Diving/thesis"
    3. pdflatex essay
    Pick the right folder obviously, and then replace "essay" with the name of your .tex file. No need to include any filetype, just the first bit of the filename is needed. That should work.


  • Advertisement
  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Yup, that worked. Thanks!


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    You're welcome :)


Advertisement