0

I am trying to adjust the size and poisitioning of images on a beamer presenattion. For size readjustment, I am using the adjustbox package which works well. However I noe have a slide where I would like to shift a figure to the right because it fits much better with the line of the text. But I do not want a big gap between my lines of text (vertically), across the length of the figure (which is now to the right).

I have tried usign \hspace before the figure, but for some reason ti only shifted it slightly to the right (and slightly downwards too). It seems to have some kind of a limit to how much it can shift.

I would be very greatful for advice. I am new to using beamer, and making presentations in Latex.

\documentclass[aspectratio=169,xcolor=dvipsnames]{beamer}
\usetheme{Simple}

\usepackage{hyperref}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usepackage{adjustbox}
\usetikzlibrary{patterns}
\usepackage{stmaryrd}
\usepackage{xcolor}
\newcommand{\msc}[1]{\begin{center}MSC2000: #1.\end{center}}

\begin{document}

\begin{frame}{Proof of main result}
    \begin{enumerate}
    \setcounter{enumi}{1}
        \item Let $x,y,z \in V(G)$ and $G[\{x,y,z\}]$ be a triangle.
        
        Define for each colour $c$,
        $$\text{Net}_c(xyz,xy) = L_c(xz)+L_c(yz)-L_c(xy)$$
        
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{ffcctt}{rgb}{1,0.8,0.2}
\definecolor{uququq}{rgb}{0.25098039215686274,0.25098039215686274,0.25098039215686274}

\begin{adjustbox}{max totalsize={0.3\textwidth}{.3\textheight},center}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
%\clip(-2.82,-8.2) rectangle (10.86,6.02);
\draw [line width=2pt,color=ffcctt] (3.88,1.96)-- (2.96,-0.7);
\draw [line width=2pt,color=qqqqff] (4.94,-0.68)-- (3.88,1.96);
\draw [line width=2pt,color=qqqqff] (4.94,-0.68)-- (2.96,-0.7);
\begin{scriptsize}
\draw [fill=uququq] (3.88,1.96) circle (2pt);
\draw[color=uququq] (3.9,2.35) node {z};
\draw [fill=uququq] (2.96,-0.7) circle (2pt);
\draw[color=uququq] (2.76,-0.31) node {x};
\draw [fill=uququq] (4.94,-0.68) circle (2pt);
\draw[color=uququq] (5.14,-0.29) node {y};
\end{scriptsize}
\end{tikzpicture}
\end{adjustbox}
        
        \item Let $H$ be a Hamilton cycle in $G$. Assume $H$ is not $d$-unbalanced.
        
        Pick $v \in V(G)$. Write $H =(v, x_1, x_2, ...., x_{n-1})$.
        
        \item Let $X = \Gamma(v)$
        
        $X^+ = \{x_i \in v(G) | x_{i-1} \in \Gamma(v)$
        
        We have $|X|, |X^+| \geq (\frac{1}{2} + {1}{2r})n +6dr^2$
        
        The number of triangles $vxy$ such that $xy\in E(H)$ is $\geq |X\cap X^+|$.
        
        
    \end{enumerate}
\end{frame}

\end{document}

EDIT: Being a bit clueless with beamer, I completely didn;t realise that there are style files on the side needed for the code to compile. Here they are. There are three files.

%This file is named beamerthemeSimple.sty
\mode<presentation>
% Settings
\usetheme{Madrid}
\useinnertheme{circles}
% \useoutertheme{simpleinfo}
% \useoutertheme{miniframes} % Alternatively: miniframes, infolines, split
\usefonttheme{Simple}
\usecolortheme{DarkBlue}

% \setbeamertemplate{footline} % To remove the footer line in all slides uncomment this line
\setbeamertemplate{footline}[page number] % To replace the footer line in all slides with a simple slide count uncomment this line
\setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{enumerate items}[default]
% table of contents (overview)
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[default]

\mode<all>

The second one:

%This file is called beamerfontthemeSimple.sty
\mode<presentation>

%%%%%%%%%%%% fonts

\setbeamerfont{structure}{family=\sffamily,series=\mdseries}

\setbeamerfont{title}{size=\LARGE,parent=structure}
\setbeamerfont{subtitle}{size=\normalsize,parent=title}

\setbeamerfont{date}{size=\scriptsize,series=\mdseries,parent=structure}
\setbeamerfont{author}{size=\Large,series=\mdseries,parent=structure}
\setbeamerfont{institute}{size=\scriptsize,series=\mdseries,parent=structure}

\setbeamerfont{section in toc}{size=\Large,parent=structure}
\setbeamerfont{section in head/foot}{size=\tiny,parent=structure}
\setbeamerfont{subsection in toc}{size=\large,parent={section in toc}}

\setbeamerfont{frametitle}{parent=structure,size=\LARGE}
\setbeamerfont{framesubtitle}{parent=frametitle,size=\Large}

\setbeamerfont{caption}{size=\footnotesize}
\setbeamerfont{item}{parent=structure,series=\mdseries}
\setbeamerfont{block title}{size=\large,series=\mdseries,parent={structure,block body}}

\mode
<all>

The last one:

%This file is called beamercolorthemeDarkBlue.sty
\definecolor{InvisibleRed}{rgb}{0.92, 0.9, 0.9}
\definecolor{InvisibleGreen}{rgb}{0.9, 0.92, 0.9}
\definecolor{InvisibleBlue}{rgb}{0.9, 0.9, 0.92}

\definecolor{LightBlue}{rgb}{0.4, 0.55, 0.65}

\definecolor{MediumRed}{rgb}{0.92549, 0.34509, 0.34509}
\definecolor{MediumGreen}{rgb}{0.36862, 0.66666, 0.65882}
\definecolor{MediumBlue}{rgb}{0.01176, 0.31372, 0.43529}

\definecolor{DarkBlue}{rgb}{0.05, 0.15, 0.3} 

\usecolortheme[named=DarkBlue]{structure}

\setbeamercolor{palette primary}{bg=DarkBlue,fg=white}
\setbeamercolor{palette secondary}{bg=MediumBlue,fg=white}
\setbeamercolor{palette tertiary}{bg=LightBlue,fg=white}
\setbeamercolor{block title}{bg=MediumBlue}
\setbeamercolor{block body}{bg=InvisibleBlue}
\setbeamercolor{block title example}{bg=MediumGreen}
\setbeamercolor{block body example}{bg=InvisibleGreen}
\setbeamercolor{block title alerted}{bg=MediumRed}
\setbeamercolor{block body alerted}{bg=InvisibleRed}

EDIT: As requested here is a sketch of the kind of layout I am hoping for:

Sketch

4
  • Would you mind adding a sketch of the expected otuput to your question?
    – leandriis
    Feb 20, 2021 at 21:58
  • @leandriis I have done this now. Apologies for the poor quality photo.
    – Meep
    Feb 20, 2021 at 22:40
  • 1
    Please make your MWE compilable. We haven't your defined beamer's styles.
    – Zarko
    Feb 20, 2021 at 23:59
  • @Zarko many apologies I have only just noticed that there are side Latex files with default styles/settings! I am new to this But this is useful- I had been wondering how to change some of these styles. I am uploading the style latex files now :)
    – Meep
    Feb 21, 2021 at 0:14

1 Answer 1

6

If I correctly understood your question, then you after something like this:

enter image description here

I took the liberty and rewrite your picture code, from preamble remove packages which are loaded by beamer (xcolor, graphicx and hyperref) and not used package (booktabs, adjustbox). Use adjustbox for scaling of tikzpicture is not a good idea, the image is just fine without any scaling:

\documentclass[aspectratio=169,xcolor=dvipsnames]{beamer}
%\usetheme{Simple}

\midrule and \bottomrule in tables
\usepackage{pgf,tikz}
\usetikzlibrary{arrows,
                patterns,
                positioning}
\usepackage{stmaryrd}

\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{ffcctt}{rgb}{1,0.8,0.2}
\definecolor{uququq}{rgb}{0.25098039215686274,0.25098039215686274,0.25098039215686274}

\begin{document}
\begin{frame}[fragile]
\frametitle{Proof of main result}
\begin{columns}
\begin{column}{0.75\textwidth}
    \begin{enumerate}
\item   Let $x,y,z \in V(G)$ and $G[\{x,y,z\}]$ be a triangle.

        Define for each colour $c$,
    \[
\text{Net}_c(xyz,xy) = L_c(xz)+L_c(yz)-L_c(xy)
    \]
\item   Let $H$ be a Hamilton cycle in $G$. Assume $H$ is not $d$-unbalanced.

        Pick $v \in V(G)$. Write $H =(v, x_1, x_2, ...., x_{n-1})$.

\item   Let $X = \Gamma(v)$

        $X^+ = \{x_i \in v(G) | x_{i-1} \in \Gamma(v)$

        We have $|X|, |X^+| \geq (\frac{1}{2} + {1}{2r})n +6dr^2$

        The number of triangles $vxy$ such that $xy\in E(H)$ is $\geq |X\cap X^+|$.
    \end{enumerate}
\end{column}
\begin{column}{0.25\textwidth}
    \scriptsize
    \centering
    \begin{tikzpicture}[
  line cap = round, 
 line join = round,
line width = 2pt,
    dot/.style = {circle, fill, inner sep=1.5pt},
every label/.append style = {text=black}
                        ]
\draw [ffcctt] (0,0)-- (1,3);
\draw [qqqqff] (1,3) coordinate[label=$z$] (c) -- 
               (2,0) coordinate[label=right:$y$] (b) -- 
               (0,0) coordinate[label= left:$x$] (a);
\foreach \i in {a,b,c}{\node[dot] at (\i) {};}
    \end{tikzpicture}
    \end{column}
\end{columns}
\end{frame}
\end{document}

Addendum: You may liked the following small changes in frame design:

enter image description here

\documentclass[aspectratio=169,xcolor=dvipsnames]{beamer}
\setbeamertemplate{itemize subitem}[circle] \everymath=\expandafter{\the\everymath\color{blue!40!black}}

\usepackage{tikz}
\usetikzlibrary{arrows,
                patterns,
                positioning}
\usepackage{stmaryrd}

\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{ffcctt}{rgb}{1,0.8,0.2}
\definecolor{uququq}{rgb}{0.25098039215686274,0.25098039215686274,0.25098039215686274}

\begin{document}
\begin{frame}[fragile]
\frametitle{Proof of main result}
\begin{columns}
\begin{column}{0.75\textwidth}
    \begin{enumerate}
\item   Let $x,y,z \in V(G)$ and $G[\{x,y,z\}]$ be a triangle.

        Define for each colour $c$,
    \[
\text{Net}_c(xyz,xy) = L_c(xz)+L_c(yz)-L_c(xy)
    \]
\item   Let $H$ be a Hamilton cycle in $G$:
        \begin{itemize}
    \item   Assume $H$ is not $d$-unbalanced.
    \item   Pick $v \in V(G)$. 
    \item   Write $H =(v, x_1, x_2, ...., x_{n-1})$.
        \end{itemize}
\item   Let $X = \Gamma(v)$
    \[
X^+ = \{x_i \in v(G) | x_{i-1} \in \Gamma(v)
    \]
        We have $|X|, |X^+| \geq (\frac{1}{2} + {1}{2r})n +6dr^2$

        The number of triangles $vxy$ such that $xy\in E(H)$ is $\geq |X\cap X^+|$.
    \end{enumerate}
\end{column}
\begin{column}{0.25\textwidth}
    \centering
    \begin{tikzpicture}[
  line cap = round, 
 line join = round,
line width = 2pt,
    dot/.style = {circle, fill, inner sep=1.5pt},
every label/.append style = {text=black}
                        ]
\draw [ffcctt] (0,0)-- (1,3);
\draw [qqqqff] (1,3) coordinate[label=$z$] (c) -- 
               (2,0) coordinate[label=right:$y$] (b) -- 
               (0,0) coordinate[label= left:$x$] (a);
\foreach \i in {a,b,c}{\node[dot] at (\i) {};}
    \end{tikzpicture}
    \end{column}
\end{columns}
\end{frame}
\end{document}
4
  • +1! I corrected small typos, hope that's ok. Feb 21, 2021 at 0:53
  • 1
    @Dr.ManuelKuehner, thank you very much for corrections! Now the language is far better as before. I will add addendum with new frame formatting. Hopefully with less grammatical errors ;-).
    – Zarko
    Feb 21, 2021 at 0:58
  • Thank you so much Zarko! This is awesome! The colour change for the math equations is really great :D I see you used columns to arrange things. I learnt a lot from your answer! I was wondering- you said using adjustbox is not a good idea. Is that in general or just in this case? Does adjustbox cause any issues?
    – Meep
    Feb 21, 2021 at 10:59
  • 1
    @Meep, an adjustbox should be used with caution. It can make text in its content inconsistent with other text document (to small, to big ...). In your case it is not needed at all, you can simply draw image such, that it can be included in frame with its natural size.
    – Zarko
    Feb 21, 2021 at 12:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .