LaTeX forum ⇒ Graphics, Figures & TablesHelp with insert figure into tabular Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
ciema7
Posts: 6
Joined: Sat Nov 10, 2018 2:31 am

Help with insert figure into tabular

Postby ciema7 » Sat Nov 10, 2018 2:49 am

Hello All, below You can see my code. I would like to create figure in the first 'record' (image in the first row and first column of table (tabularx) presented below. Could You help me ? I've just started my adventure with LATEX so sorry for possible mistakes.
I suppose that this code below does not work because of line & {\includegraphics[width=0.3\textwidth, height=60mm]{images/k.png}}, I have no idea how to replace that line with simple code and solve my problem. :|
  1. \documentclass{article}
  2. \usepackage{listings}
  3. \usepackage{inputenc}
  4. \usepackage{graphicx}
  5. \usepackage{polski}
  6. \usepackage{geometry}
  7. \usepackage{textcomp}
  8. \usepackage{gensymb}
  9. \usepackage{parskip}
  10. \usepackage{multirow}
  11. \usepackage{tabularx}
  12. \usepackage{enumitem}
  13. \usepackage{booktabs}
  14. \usepackage{array}
  15. \lstset{language=matlab,numbers=left,basicstyle=\footnotesize}
  16.  
  17. \begin{document}
  18.  
  19. \newgeometry{tmargin=2.5cm, bmargin=2.5cm, lmargin=3.5cm, rmargin=3.5cm}
  20.  
  21.  
  22. \begin{tabularx}
  23. {14,69 cm}{|c|c|c||}
  24. \hline
  25. &\multirow{-2}{12cm}{ \center \Large \textbf{Faculty}} \\
  26. & \multicolumn{1}{c|}{} \\
  27. \cline{2-2} & \\
  28. & \multicolumn{1}{c|}{\huge \underline {{MES and MEB }}} \\
  29. &\multirow{3}{12cm}{ \center \large REPORT} \\
  30. \cline{1-2}
  31. & \\
  32. &\multirow{1}{12cm}{ \center \textit {Frame Analysis}} \\
  33. Temat: & \\
  34. \hline
  35. & \\
  36. Grupa: I 05 & \multicolumn{1}{c|}{\large \textbf {XX, XXYZ}} \\
  37. \hline
  38. & {\includegraphics[width=0.3\textwidth, height=60mm]{images/k.png}}
  39.  
  40. \end{tabularx}

User avatar
Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Nov 10, 2018 8:59 am

Hi and welcome,

the code you presented works fine, if i replace the image with a dummy image and add \end{document}.
Your output looks a bit like a title page. Maybe you are interested in Customize the titlepage and Title Creation.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9164
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Nov 10, 2018 11:13 am

Indeed, the code is ok!

It seems that LaTeX just doesn't find the file images/k.png. Do you get an error message? Can you post the .log file here, as attachment? The Attachments link is below the text edit field, when writing a post here.

Look for this image file. Perhaps put it directly in the folder of your document and just write {\includegraphics[width=0.3\textwidth, height=60mm]{k}} in that table cell.

Also note, that for supporting png images you need to run pdfLaTeX, that is, compiling to PDF directly, not LaTeX in DVI mode.

Stefan
Site admin

ciema7
Posts: 6
Joined: Sat Nov 10, 2018 2:31 am

Postby ciema7 » Sat Nov 10, 2018 1:01 pm

Thank You very much it really works !
Last edited by ciema7 on Sat Nov 10, 2018 5:52 pm, edited 2 times in total.

User avatar
Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Nov 10, 2018 2:41 pm

Doesn't AGH provide a ready to use template?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Stefan Kottwitz and 6 guests