Graphics, Figures & TablesHelp with insert figure into tabular

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

Help with insert figure into tabular

Post by ciema7 »

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. :|

Code: Select all

\documentclass{article}
\usepackage{listings}
\usepackage{inputenc}
\usepackage{graphicx}
\usepackage{polski}
\usepackage{geometry} 
\usepackage{textcomp} 
\usepackage{gensymb}
\usepackage{parskip}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{array}
\lstset{language=matlab,numbers=left,basicstyle=\footnotesize}

\begin{document}

\newgeometry{tmargin=2.5cm, bmargin=2.5cm, lmargin=3.5cm, rmargin=3.5cm}  


\begin{tabularx}
{14,69 cm}{|c|c|c||}
\hline
&\multirow{-2}{12cm}{ \center \Large \textbf{Faculty}} \\
& \multicolumn{1}{c|}{} \\
 \cline{2-2} &  \\
& \multicolumn{1}{c|}{\huge \underline {{MES and MEB }}}  \\
 &\multirow{3}{12cm}{ \center \large REPORT}  \\  
\cline{1-2}  
& \\
&\multirow{1}{12cm}{ \center \textit {Frame Analysis}}  \\
 Temat: & \\
\hline
& \\
Grupa: I 05 & \multicolumn{1}{c|}{\large \textbf  {XX, XXYZ}}  \\
\hline
&   {\includegraphics[width=0.3\textwidth, height=60mm]{images/k.png}}

\end{tabularx}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Help with insert figure into tabular

Post by Johannes_B »

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Help with insert figure into tabular

Post by Stefan Kottwitz »

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
LaTeX.org admin
ciema7
Posts: 22
Joined: Sat Nov 10, 2018 2:31 am

Help with insert figure into tabular

Post by ciema7 »

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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Help with insert figure into tabular

Post by Johannes_B »

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.
Post Reply