Graphics, Figures & TablesPicture and Text side by side

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Widooo
Posts: 2
Joined: Sun Nov 06, 2011 2:18 pm

Picture and Text side by side

Post by Widooo »

The picture should be left and the text right, but as you can see it doesn´t work... :( So i have to ask for help.

Solution idea: Text --> minipage ; picture & minipage <-- Problem with headlines...

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[ngerman,naustrian]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{ulem}
\usepackage{here}
\usepackage[pdftex]{graphicx}
\usepackage{amsthm}
\usepackage{gensymb}
\usepackage{fancyhdr}
\usepackage[left=20mm,top=25mm,bottom=25mm,right=20mm,headheight=15mm,headsep=10mm,footskip=10mm]{geometry}
\usepackage{longtable}
\usepackage{hhline}
\usepackage[table]{xcolor}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathcomp}
\usepackage{tabularx}
\usepackage{multicol}

\begin{document}
\section{Einmassenschwinger}

\subsection{Implementieren Sie das System mit Integratorblöcken in MATLAB/Simulink.}
    \begin{tabular}{cc}
    \emph{MATLAB - Script} & \emph{MATLAB/Simulink-Modell:} \\
    \includegraphics[width=80mm]{Bild1} & 
    clear all; \\
    close all; \\
    clc; \\
    $m$ = 1; \\
    $k$ = 4; \\
    $d $= 0.1; \\
    $F_f $= 0; \\
    \end{tabular}
\end{document}
Question in short form: I want the pic left and the text right (Headlines in same line, pic and text should start also in same line)

THX for help
Attachments
matlab-simulink.jpg
matlab-simulink.jpg (20.18 KiB) Viewed 1936 times
Last edited by Widooo on Sun Nov 06, 2011 4:00 pm, edited 2 times in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Picture and Text side by side

Post by localghost »

The minipage environment works quite well here. It only needs an optional alignment parameter.

Code: Select all

\documentclass[12pt,a4paper,ngerman,naustrian]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[%
  hmargin=20mm,
  vmargin=25mm,
  headheight=15mm,
  headsep=10mm,
  footskip=10mm
]{geometry}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{ulem}
\begin{document}
\section{Einmassenschwinger}

\subsection{Implementieren Sie das System mit Integratorblöcken in MATLAB/Simulink}
    \begin{minipage}[t]{0.45\textwidth}
      \centering
      \emph{MATLAB"=Script}\\[1ex]
      \includegraphics[width=\linewidth]{Bild1}
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.45\textwidth}
      \centering
      \emph{MATLAB/Simulink-Modell:}\\[1ex]
      clear all;\\
      close all; \\
      clc; \\
      $m$ = 1; \\
      $k$ = 4; \\
      $d $= 0.1; \\
      $F_f $= 0; \\
    \end{minipage}
\end{document}

Best regards and welcome to the board
Thorsten
Widooo
Posts: 2
Joined: Sun Nov 06, 2011 2:18 pm

Re: Picture and Text side by side

Post by Widooo »

Thank you very very very much :idea:

Very interresting new commands. thx
Post Reply