Graphics, Figures & TablesPicture and program code side by side

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thepetas
Posts: 3
Joined: Sun May 17, 2015 2:23 pm

Picture and program code side by side

Post by thepetas »

Hello,
I am trying to find how to have the picture on the left side of sheet and the code (from {algorithmic}) on the right sheet. Do you know anybody how to? :-)
Thanks !

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

Re: Picture and program code side by side

Post by Johannes_B »

You can always use minipages to place stuff side by side. If you need captions, it gets a bit more tricky. Can you show us an example with an example algorithm, including all the packages needed to compile it? There are more than one algo package out there and they are a bit confusing.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
thepetas
Posts: 3
Joined: Sun May 17, 2015 2:23 pm

Picture and program code side by side

Post by thepetas »

Thank you very much. It work !
my code, maybe it will be better...

Code: Select all

\begin{minipage}[]{0.5\textwidth}
    \begin{flushleft}
        \includegraphics[scale=0.6]{obr1.pdf} 
    \end{flushleft}
\end{minipage}%
%
\begin{minipage}[]{0.5\textwidth}
    \begin{flushright}
        \begin{algorithmic}
  \STATE Zacatek
  \STATE \ \ \ Prikaz1
  \STATE \ \ \ Prikaz2
  \STATE Konec
  \end{algorithmic}
    \end{flushright}    
\end{minipage}
Post Reply