Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I make a presentation using LaTeX. But I have a slide with picture and text and I want a text to be aligned to the right. How to do this?

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{block}{Подпрограма Solver}
\end{block}

\begin{itemize}
\item Изпълнява се n -- пъти; \\ 
\item $\overline{F}(\varphi) = -\varphi \, '' + \sin \varphi - \gamma$; \\
  \item $\varepsilon$ -- стоп--критерий. \\
\end{itemize}

\tikzstyle{my loop}=[->,to path={
.. controls +(300:1) and +(560:1) .. (\tikztotarget) \tikztonodes}]


\begin{tikzpicture}

\path (0, 0) node(a) [ellipse, draw] {$\varphi_0$};
\path (0, -1) node(b) [rectangle, draw] {$\varphi^n = \varphi^{n-1} + \tau_n \cdot     w^n$};
\path (0, -3) node(c) [diamond, draw] {$\| \overline{F}(\varphi^n) \| < \varepsilon$};
\path (6, -3) node(d) [rectangle, draw] {Продължаваме (получили сме решение)};

\draw[->] (a) to (b);
\draw[->] (b) to (c);
\draw[->] (c) to node[above] {да} (d);
\draw[->] (c) to (0, -5) node[right] {не} to (-2.5, -5) to (-2.5, 0) to (a);

\end{tikzpicture}
\end{frame}
\end{document}
share|improve this question

migrated from stackoverflow.com Feb 23 '12 at 22:14

This question came from our site for professional and enthusiast programmers.

    
I have attempted to fix your character encoding problem, but I do not read any language written with Cyrillic, so I can't tell if I did it right. –  Zack Feb 23 '12 at 22:02
1  
Also, please tell us which text should be right-aligned and currently isn't. –  Zack Feb 23 '12 at 22:03
    
I want the text in itemize area to be right-aligned. –  Владислав Найденов Feb 23 '12 at 22:09
    
@Владислав Найденов: Only the text or also the bullets? –  Martin Schröder Feb 23 '12 at 22:27
    
Do you want the whole itemize to be placed at the right part of the frame? So you could simply pack it into a minipage with 0.5\textwidth or similar and than place a \hfill before. –  ejoerns Feb 24 '12 at 4:51

2 Answers 2

For this purpose, the best thing to do is to use the columns environment.

For example:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\tikzstyle{my loop}=[->,to path={
 .. controls +(300:1) and +(560:1) .. (\tikztotarget) \tikztonodes}]
\begin{frame}

\begin{block}{Подпрограма Solver}
\end{block}

\begin{columns}[T]

\begin{column}{0.5\textwidth}
% first column: the image
\begin{tikzpicture}     
\path (0, 0) node(a) [ellipse, draw] {$\varphi_0$};
\path (0, -1) node(b) [rectangle, draw] {$\varphi^n = \varphi^{n-1} + \tau_n \cdot w^n$};
\path (0, -3) node(c) [diamond, draw] {$\| \overline{F}(\varphi^n) \| < \varepsilon$};
\path (6, -3) node(d) [rectangle, draw] {Continue (we received an answer)};

\draw[->] (a) to (b);
\draw[->] (b) to (c);
\draw[->] (c) to node[above] {if yes} (d);
\draw[->] (c) to (0, -5) node[right] {if not} to (-2.5, -5) to (-2.5, 0) to (a);
\end{tikzpicture}
\end{column}

\begin{column}{0.5\textwidth}
% second column: the text
\begin{itemize}
\item Runs n - times; \\ 
\item $\overline{F}(\varphi) = -\varphi \, '' + \sin \varphi - \gamma$; \\
\item $\varepsilon$ -- stop-test. \\
\end{itemize}
\end{column}

\end{columns}

\end{frame}
\end{document}

Actually I translated in english the labels: sorry if it is not precise.

The graphical result is:

enter image description here

share|improve this answer

You can try \hfill.

\hfill Right aligned text

should do what you want.

share|improve this answer
    
I already try this but it didn't work. –  Владислав Найденов Feb 23 '12 at 22:11
1  
instead of \` use \linebreak` and then \hfill should work. –  barbara beeton Feb 23 '12 at 22:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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