latex (pdflatex) include png jpg … images


I always forget the package name to include, so here it is


Once included, the package provides the following term

\includegraphics[key_1 = . . . , key_2 = . . . ,  key_n=....]{filename}

Options (keys) include:

• scale = number — a magnification factor
• width = length — the width to which the figure should be scaled
• height = length — the height to which the figure should be scaled2
• totalheight = length — height plus depth of figure (to be used if figure  is rotated)
• keepaspectratio = true/false — maintains the height/width ratio
• angle = number — angle (in degrees) by which the figure is to be rotated  counter clockwise
• origin = location3 — the point about which rotation is to occur
• draft = true/false — prevents figure from being imported, but created   a named box with the dimensions of the figure (this option is used to speed  up processing)
• clip = true/false — excludes whatever is outside the bounding box
• bb = llx lly urx ury — enters the bounding box coordinates, which are   given by default in points (1/72 inch), manually (the bounding box might  be missing or you might want to alter it)
• viewport = llx lly urx ury — specifies bounding box w.r.t. bottom left of existing bounding box; used with clip to select a part of the image (or to  clear unwanted margins).
• trim = dllx dlly durx dury — reduces the bounding box by the amount  specified
• hiresbb = true/false — reads the bounding box information from the  line %%HiResBoundingBox in figure file

Detailed spec is here or a quickie can be found here


15 Responses to “latex (pdflatex) include png jpg … images”

  1. Milena Says:

    I am trying to import a .png file (created originally with STATA and then converted to a .png file) and it is being imported as a black and white figure. Is there an option I can use to restore the colors? thanks

  2. Include picture in Texshop on mac latex | Brain Reset Says:

    […] You can adjust the options in the bracket [], a small documentation you can found from here. […]

  3. skizza Says:

    Milena umm are you sure that the file you are importing is not black and white? straight forward \includegraphics shouldn’t effect the colour.

    Brain Reset,
    can’t reply on your blog,
    > the myfig file need to be in the same path of the tex file;
    Not ness. for pdflatex – .. i often keep my figs under an image directory and use: \includegraphics[]{./image/foo.png}

    > no extension of the file should be appended, ex. png, jpg. I don’t know why, but if you add the extension, the texshop gave an fatal error. And the documentation of the texshop actually doesn’t have extension included either when it refers to include pdf and eps.
    pissy macs again i see !

    > If you get a missing bounding box error, please don’t go investigate bounding box, it’s not related as far as I see.

    this just means that the size of the figure of you are including is greater the space you have declared for it. so basically just resize it. to see the bounding box, use
    “\documentclass[draft]{}” this will show you the placeholder for the figures to be included.



  4. Zbigniew Says:


  5. Josiah Kiehl Says:

    Hey. When I add \usepackage[pdftex]{graphicx} to my document, it causes rubber to spin while compiling the document, and it never completes. It prints “Compiling ” over and over forever.

    Thoughts on why this is happening?

  6. Josiah Kiehl Says:

    I just tested in pdflatex, and it works fine.. I suppose I should go file a bug with the rubber team.

  7. rohit Says:

    when i write the following code in kile it gives me an error saying:
    File ‘chick’ not found. \includegraphics[scale=0.7]{chick}


    \title{Telecom Software Lab}
    \author{Rohit Kumar Srivastava}
    \date{May 31,2010}

    This is the first test in telecomm software lab.Topics are Unix Commands,Vi Editor Commands
    and Kile IDE

    \section{Contents\\ \\ \\ \\ \\ }
    1. Mathematics\hspace{100mm} 4\\
    2. QR Decomposition\hspace{91.5mm} 6\\
    3. Tables \hspace{110mm} 8\\
    4. Figures \hspace{108.5mm} 9\\
    5. List of Figures\hspace{98mm} 10\\

    \section{Chapter \\ \\Mathematics}
    \item (2 marks) the roots of the polynomial form \textsl{$x^3-3px-2q$} are given by
    formula\\ \textsl{$$\sqrt[3]{q+\sqrt{q^2-p^3}}+\sqrt[3]{q-\sqrt{q^2-p^3}}$$}
    where the values of the cube roots must are chosen so as to ensure that their product is equal to p.
    \item (1 Mark) The formula for finding Fourier Transform of \textbf{x(n)}
    is \textsl{$$X(e^(jw))=x(n)e^{-jwn} $$} W, in radians
    \item (1 Mark) Fundamental Principle in Trigonometry is
    \item (2 Marks)The \textsl{characteristic polynomial} $\chi(\lambda)$ of 3 X 3 matrix
    is given by the formula \\

    $\chi(\lambda)=$\begin{tabular}{|c c c|}
    $\lambda -a$&-b&-c\\
    -d&$\lambda -e$&-f\\
    -g&-h&$\lambda -i$

    \item (15 Marks) To calculate the pdf of a variable $Z_{max}=max(Z_1,Z_2,Z_3,Z_4)$ where\\
    $Z_1=f_1(textbf{X,Y})=|X_1+X_2+X_3|^2 + |Y_1+Y_2+Y_3|^2$ \\
    $Z_2=f_1(textbf{X,Y})=|X_1-X_2+X_3|^2 + |Y_1-Y_2+Y_3|^2$ \\
    $Z_3=f_1(textbf{X,Y})=|X_1+X_2-X_3|^2 + |Y_1+Y_2-Y_3|^2$ \\
    $Z_4=f_1(textbf{X,Y})=|X_1-X_2-X_3|^2 + |Y_1-Y_2-Y_3|^2$ \\
    You can write a symbolic solution to the PDF of any function Z=f(X) of a stochastis variable X as
    \\ \\
    $p(z)=\displaystyle\int p(x)\delta(z-f(x))\,dx$\\
    where $\displaystyle\delta(z)$ is a dirac delta function\\

    Thus, the PDF of $Z_{max} = max(Z_1,Z_2,Z_3,Z_4)$ can be written as \\
    $ p(z_{max}) = \displaystyle\int p(z)\displaystyle\delta (z_{max}-max(Z_1,Z_2,Z_3,Z_4))\,dz $\\
    where \\
    $ p(\textbf{z})=\displaystyle\int \displaystyle\int p(textbf{x,y}) \\prod_{k=1}^4 \displaystyle\delta(z_k-f_k(\textbf{x,y}))\,d\textbf{x}\,d\textbf{y} $\\

    and integration with respect to a vector\\
    $\displaystyle\int . \,dx\\$
    stands for integration over all components: \\
    $\displaystyle\int_{-\infty}^\infty \displaystyle\int_{-\infty}^\infty \displaystyle\int_{-\infty}^\infty \,dx_1\,dx_2\,dx_3$

    \section{Chapter \\ \\QR Decomposition}

    (15 Marks) Channel model is \\ \\
    $Y_i=H_i*X_i+N_i $\\ \\
    The QR Decomposition of matrix yields to \\ \\
    $H_{i,up}=Q_i*R_i$ \\ \\
    where $Q_{i}$ is Unitary matrix and $R_i$ is upper Triangular matrix and there L channels \\ \\
    $\tilde{Y}_i = Q^*_iY_i = R_i*X_i + \tilde{N}_i$\\ \\
    (\tilde{X}_i)_k = decode\displaystyle{\left[
    \frac{1}{r^i_{k,k}}(\hat{Y}_i)_k – \displaystyle\sum_{j=k+1}^L \frac{r^i_{k,j}}{r^i_{k,k}}(\tilde{X}_i)_j
    \\ \\
    $k=L,L-1,……,1$ \\ \\
    The detection of SNR of user k on the $i^{th}$ is \\ \\
    $$S N R^i_k = |r^i_{k,k}|^2 * \varepsilon^i_{k,up}$$ \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
    \qquad \qquad(2.3)\\ \\
    where $r^i_{k,j}$ is the $(k,j)$ element $R_i$ and $\epsilon ^i_{k,up}$ is the energy of ${(U_i)_k}$ \\
    The operations described above define the cancellor block corresponding to a \\
    single tone.\\
    The capacity can be found as\\
    $ R_{k,up} = \displaystyle\sum_{i\epsilon N_{up}} \frac{1}{2}\log_2(1+\frac{|r^i_{k,k}|^2 * \epsilon^i_{k,up}}{\Gamma})$ \\
    The above is general procedure for CR decomposition of Channel Matrix.\\ \\
    Now I am doing the QR decomposition of DM,DM-CM mode \\ \\
    \section{Chapter \\ \\Tables}

    \underline{{15 Marks}}\\ \\ \\
    \begin{tabular}{ | l | p{5cm} | p{3cm} | p{2.5cm} |}
    Year & Degree/Exam & Institution Name & Aggregate marks(\%)/GPA \\ \hline
    2008–2010 & M.Tech in telecommunication Technology and management & Indian Institute of Technology, Delhi & /10 \\
    2004–2008 & Bachelor of Technology in Electronics and Communications & N.S.I.T(Delhi University, Delhi) & 70\% \\
    2002–2004 & AISSCE, Delhi & Bharatiya Vidya Bhavan’s,Mehta Vidyalaya & 87.4\% \\
    2001–2002 & CBSE Board & Bharatiya Vidya Bhavan’s,Mehta Vidyalaya & 91.6\% \\



    \begin{tabular}{l p{3cm} p{3cm} *{7}{c}}

    \multicolumn{9}{c}{Table 3.1: Performance After Post Filtering} \\
    \hline \hline
    Audio & Audibility & Decision & \multicolumn {6}{c}{Sum of Extracted Bits} \\
    \multirow{2}{*}{Police}& Soft & 1 & -1 & 1 & 1 & -1 & -1 & 1 \\
    & & Hard & 2 & -4 & 4 & 4 & -2 & -4 & 4 \\

    \multirow{2}{*}{Beethoven}& Soft & 1 & -1 & 1 & 1 & -1 & -1 & 1 \\
    & & Hard & 8 & -8 & 2 & 8 & -8 & -8 & 6 \\

    \multirow{2}{*}{Metallica}& Soft & 1 & -1 & 1 & 1 & -1 & -1 & 1 \\
    & & Hard & 4 & -8 & 8 & 4 & -8 & -8 & 8 \\
    \section{Chapter \\ \\Figures}

    \title{4 Marks\\ \\ \\}



    \section{Chapter \\ \\List of Figures}

    $4.1 \;$ PSD of\textsl Common Mode Channel at (25,5Mhz,300)$ |h_{12}|^2 + |h_{13}|^2 + \ldots + |h_{125}|^2 + ……………..$


  8. rohit Says:

    please reply its

  9. Irina Says:


    I am quite new to latex environment. I am using TexShop on a Mac an recently had problems with inserting a figure:

    \includegraphics[width=16cm,draft=true]{//Users/PhD/LATEX THESIS/FIGURES THESIS/FIGURES THESIS CHAPTER 2//All data coverage SLP.pdf}
    \caption{Data coverage (\%) ICOADS SLP for four time periods}

    The figure is inserted, everything looks fine apart of the fact that on the top of the figure you can see the file name: //Users/PhD/LATEX THESIS/FIGURES THESIS/FIGURES THESIS CHAPTER 2//All data coverage SLP.pdf

    I really need to get rid of it somehow, but I did not manage.

    Thank you

  10. simon Says:

    @Irina: in my case this was due to the spaces in the filename, might want to check that

  11. Ever Says:

    how do I compute the bounding box for a PNG file ?

  12. free to use photos Says:

    free to use photos…

    […]latex (pdflatex) include png jpg … images « Look here first![…]…

  13. Papa Orgen Says:

    I want to import a png file into my latex thesis. Originally, it was in a pdf file before i copied it to paint. Unfortunately, latex is says it can’t find my file on that partiular line. I saved it as fig1.png. I typed that into the \includegraphics space. Somebody help me. I am using latex version 2.09

  14. cheap harlett Says:

    I like reading an article that can make men and
    women think. Also, thank you for permitting me to comment!

  15. Says:

    What if I mentioned there were a perfectly legitimate means to
    get free Nintendo Points. Family Guy relies heavily on the use of flashbacks and also moments of exaggerated and extended comedic moments.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: