2

I hope someone can help me how can take a picture next to a table (at \parbox there is a fault).

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{pgfarrows}
\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc}
\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{dcolumn}
\usepackage{float}
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,includefoot,nohead}
\begin{document}
...
\begin{table}[h!]
\caption{Az alábbi táblázat az összetartozó reakcióidő és konverzió (x) adatokat tartalmazza.}
\begin{center}
\begin{tabular}{c|c}
\parbox{6cm}{
\multicolumn{1}{c|}{t/min} & \multicolumn{1}{c}{x/\%}\\
\hline
1 & 25,6\\
2 & 31,4\\
3 & 36,2\\
4 & 39,1\\
5 & 41,2\\
6 & 44,1\\
7 & 47,6\\
8 & 51,7\\
9 & 55,9\\
10 & 56,9\\
15 & 61,8\\
20 & 63,4\\
25 & 64,1\\
30 & 64,8\\
35 & 65,2\\
40 & 65,3\\
45 & 65,7\\
50 & 66,0\\
55 & 66,3\\
60 & 66,2\\
\end{tabular}
\end{center}
\label{tab:xt}
\end{table} }
\parbox{6cm}{
\begin{figure}[h!]
\begin{center}
\includegraphics[width=6cm,clip]{konverzio_par_adat.pdf}
\def\baselinestretch{1}
\caption{A fenti ábrán az összes mérési pontból kapott nyomás-hőmérséklet adatpárokból számolt konverziós értékek láthatók.}
\label{fig:konvpar}
\end{center}
\end{figure}}
\end{document}
2

enter image description here

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{pgfarrows}
\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc}
\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{dcolumn}
\usepackage{float,caption}
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,includefoot,nohead}
\begin{document}
...
\begin{table}[ht!]
\begin{minipage}{.5\textwidth}
\centering
\caption{Az alábbi táblázat az összetartozó reakcióidő és konverzió (x) adatokat tartalmazza.}

\begin{tabular}{c|c}
t/min & x/\%\\
\hline
1 & 25,6\\
2 & 31,4\\
3 & 36,2\\
4 & 39,1\\
5 & 41,2\\
6 & 44,1\\
7 & 47,6\\
8 & 51,7\\
9 & 55,9\\
10 & 56,9\\
15 & 61,8\\
20 & 63,4\\
25 & 64,1\\
30 & 64,8\\
35 & 65,2\\
40 & 65,3\\
45 & 65,7\\
50 & 66,0\\
55 & 66,3\\
60 & 66,2\\
\end{tabular}

\label{tab:xt}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
%\includegraphics[width=6cm,clip]{konverzio_par_adat.pdf}
\rule{6cm}{1cm}% in place of the image
\def\baselinestretch{1}
\captionof{figure}{A fenti ábrán az összes mérési pontból kapott nyomás-hőmérséklet adatpárokból számolt konverziós értékek láthatók.}
\label{fig:konvpar}
\end{minipage}
\end{table}
\end{document}
1

Here is your code adapted to adding an image to the right hand side:

enter image description here

Notes:

  • The [showframe] option was applied to the geometry package was just to show the page margins.
  • I tried to leave you code as comments so you could see the changes.
  • This is similar to David Carlisle's answer but uses a parbox instead of minipage.

Code:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{pgfarrows}
\usepackage{array}
\usepackage{dcolumn}
\usepackage{float}
\usepackage{caption}
\geometry{showframe,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,includefoot,nohead}
\begin{document}
\begin{table}[h!]
%\begin{center}
\parbox{\dimexpr\linewidth-6cm\relax}{\centering%
\captionof{table}{My table caption.}
\begin{tabular}{c|c}
\multicolumn{1}{c|}{t/min} & \multicolumn{1}{c}{x/\%}\\
\hline
1 & 25,6\\
2 & 31,4\\
3 & 36,2\\
4 & 39,1\\
5 & 41,2\\
6 & 44,1\\
7 & 47,6\\
8 & 51,7\\
9 & 55,9\\
10 & 56,9\\
15 & 61,8\\
20 & 63,4\\
25 & 64,1\\
30 & 64,8\\
35 & 65,2\\
40 & 65,3\\
45 & 65,7\\
50 & 66,0\\
55 & 66,3\\
60 & 66,2\\
\end{tabular}
%\end{center}
\label{tab:xt}}%
%\end{table}%
%
\parbox{6cm}{%
%\begin{figure}[h!]
%\begin{center}
\includegraphics[width=6cm,clip]{../images/EiffelTall}
%\def\baselinestretch{1}
\captionof{figure}{My figure caption.}
\label{fig:konvpar}
%\end{center}
%\end{figure}%
}
\end{table}%
\end{document}
  • \parbox and minipage share about 99% of their code:-) – David Carlisle Nov 4 '14 at 21:04
  • Thank you very much, as well.It works but you deleted some usepackage which are important in our language. Thank you the ideas, but use of'showframe' makes the xyz.pdf ugly. – user65622 Nov 4 '14 at 21:49
  • But it's not problem if it is deleted when the file is in the final version. – user65622 Nov 4 '14 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.