1

How can I respect the margins? as you can see from the figure the word "his" crosses the margin. how can I put all the words in right way??enter image description here

this is the code:

\documentclass[10pt]{beamer}
\usepackage{subfig}
\usepackage{grffile}
\usepackage{pdfpages}
\usepackage{epstopdf}
\usepackage{tikz}
\usepackage{textpos}
\usepackage{graphicx}
\usepackage{booktabs} 
\setbeamerfont{structure}{family=\rmfamily} 
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{hyperref}
\usepackage{xcolor}

\beamertemplatenavigationsymbolsempty
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{bibliography item}[text]
\setbeamertemplate{caption}[numbered]
\usetheme{default} 
\usecolortheme{seahorse}
\newcommand{\SMIT}{\mathfrak{P}}
\newcommand{\vc}[3]{\overset{#2}{\underset{#3}{#1}}}
\newcommand{\prob}[1]{\mathbb{P}\left[#1\right]}
\newcommand{\cprob}[2]{\mathbb{P}\left[#1 \;\middle\vert\; #2\right]}
\newcommand{\E}[1]{\mathbb{E}\left[#1\right]}
\newcommand{\Et}[1]{\mathbb{E}_{t}\left[#1\right]}
\newcommand{\Econd}[2]{\mathbb{E}_{#1}\left[#2\right]}
\newcommand{\VAR}[1]{\mathbb{V}\left[#1\right]}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\norma}[1]{\left\|#1\right\|}
\newcommand{\tonde}[1]{\left(#1\right)}
\newcommand{\quadre}[1]{\left[#1\right]}
\newcommand{\graffe}[1]{\left\{#1\right\}}
\newcommand{\Sm}[1]{\mathcal{S}\tonde{#1}}
\newcommand{\due}[2]{\left(\begin{array}{c}#1\\#2\end{array}\right)}
\newcommand{\duedue}[4]{\left(\begin{array}{ll}#1 & #2\\#3 & #4\end{array}\right)}
\newcommand{\tre}[3]{\left(\begin{array}{c}#1\\#2\\#3\end{array}\right)}
\newcommand{\quattro}[4]{\left(\begin{array}{c}#1\\#2\\#3\\#4\end{array}\right)}
\newcommand{\ra}{\rightarrow}
\newcommand{\I}[1]{\mathds{1}_{\left\{#1\right\}}}
\newcommand{\lra}{\longrightarrow}
\newcommand{\Ra}{\Rightarrow}
\newcommand{\bart}{\overline{t}}
\newcommand{\Rset}{\mathbb{R}}
\newcommand{\spei}{\mathrm{E}_{i-1}}
\newcommand{\ba}{\begin{eqnarray}}
\newcommand{\ea}{\end{eqnarray}}
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
\newcommand{\ben}{\begin{enumerate}}
\newcommand{\een}{\end{enumerate}}
\newcommand{\blem}{\begin{lem}}
\newcommand{\elem}{\end{lem}}
\newcommand{\bteo}{\begin{theorem}}
\newcommand{\eteo}{\end{theorem}}
\newcommand{\bcor}{\begin{corollary}}
\newcommand{\ecor}{\end{corollary}}
\newcommand{\brem}{\begin{rmk1}}
\newcommand{\erem}{\end{rmk1}}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\cond}{\;\middle\vert\;}
\newcommand{\accapo}{\nonumber\\}
\newcommand{\convp}{\overset{p}{\longrightarrow}}
\newcommand{\convlone}{\stackrel{L^1}{\longrightarrow}}
\newcommand*{\second}{^{\prime\prime}\mkern-1.2mu}
\newcommand*{\third}{^{\prime\prime\prime}\mkern-1.2mu}
\newcommand*{\fourth}{^{\prime\prime\prime\prime}\mkern-1.2mu}
\newcommand{\idlen}{\SIT_{n}}
\newcommand{\kidlen}{\SIT_{n,k}}
\newcommand{\bidlen}{\SIT_{n,1}}
\newcommand{\p}{\mathfrak{p}}
\newcommand{\plim}{\stackrel{p}{\longrightarrow}}
\newcommand{\dlim}{\stackrel{d}{\longrightarrow}}
\newcommand{\df}{\stackrel{\textrm{def}}{=}}
\newcommand\myeq{\mathrel{\stackrel{\makebox[0pt]{\mbox{\normalfont\tiny def}}}{=}}}
\newcommand{\dav}[1]{\color{red}\fbox{DAV}: #1\color{black} }
\newcommand{\Var}[1]{\mathbf{Var}\left[#1\right]}
\newcommand{\Cov}[1]{\mathbf{Cov}\left[#1\right]}
\newcommand{\EQ}[1]{\mathbf{E}^{\mathcal Q}\left[#1\right]}
\newcommand{\EP}[1]{\mathbf{E}^{\mathcal Q}\left[#1\right]}
\newcommand{\EC}[2]{\mathbf{E}\left[#1\left| #2 \right. \right]}
\newcommand{\SIT}{\mathfrak{S}}
\newcommand{\Ei}[2]{\mathbb{E}_{#1}\left[#2\right]}
\newcommand{\Op}[1]{O_p\left(#1\right)}
\newcommand{\op}[1]{o_p\left(#1\right)}
\newcommand{\matrice}[4]{\left( \begin{array}{cc} #1 & #2 \\ #3 & #4\end{array}\right)}
\newcommand{\vettoredue}[2]{\left( \begin{array}{c} #1 \\ #2 \end{array}\right)}
\newcommand{\de}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\dede}[2]{\frac{\partial^2 #1}{\partial #2^2}}
\newcommand{\stable}{\overset{L-st.}{\longrightarrow}}
\newcommand{\dsum}{\displaystyle\sum}
\newcommand{\dint}{\displaystyle\int}
\newtheorem{proposition}{Proposition}[section]
\newcommand{\ucp}{\vc{\longrightarrow}{\text{ucp}}{n\rightarrow\infty}}



\usetikzlibrary{shapes,arrows}

\tikzset{
    myarrow/.style={
        draw,
        fill=red,
        single arrow,
        minimum height=2.5ex,
        line width=1pt,
        single arrow head extend=0.1ex
    }
}
\newcommand{\arrowdown}{%
\tikz [baseline=-1ex]{\node [myarrow,rotate=-90,  yscale=.5, single arrow head extend=1mm] {};}
}
\newcommand{\arrowright}{%
\tikz [baseline=-0.5ex]{\node [myarrow,rotate=0,  yscale=.4, single arrow head extend=1mm] {};}
}

\begin{document}
    \begin{frame}
\frametitle{The Kelly Criterion - Gambling}
Since the probabilities and the payoffs are all the same in each bet, it seems likely that the gambler will always wager the same fraction \textit{f} of his bankroll. \\ Then, the quantity  $B_{i}$, called \textit{fixed fraction bet}, that he wagers in each bet is: $$B_{i}=f \smallskip W_{i-1},$$ where $0 \leq f \leq 1$. \\
Let \textit{S} and \textit{F} the number of successes and losses. \\Then, the capital  of the gambler after \textit{n} trials is: \\
$$W_{n} =W_{0}(1+f)^{S}(1-f)^{F}$$ 

\end{frame}
\end{document}

2 Answers2

3

Instead of having the default \raggedright you could temporarily justify the paragraph in question using the justify environment from the ragged2e package. The justify environment inserts vertical space afterwards to distinguish from other paragraphs. To remove this vertical space I use \unskip directly after \end{justify}.

\documentclass[10pt]{beamer}
\usepackage{amsthm}
\usepackage{ragged2e}

\begin{document}

\begin{frame}{The Kelly Criterion - Gambling}
  \begin{justify}
    Since the probabilities and the payoffs are all the same in each
    bet, it seems likely that the gambler will always wager the same
    fraction $f$ of his bankroll.
  \end{justify}
  \unskip
  Then, the quantity $B_{i}$, called \emph{fixed fraction bet}, that
  he wagers in each bet is:
  \begin{equation*}
    B_{i}=f \, W_{i-1},
  \end{equation*}
  where $0 \leq f \leq 1$.

  Let $S$ and $F$ the number of successes and losses.

  Then, the capital of the gambler after $n$ trials is:
  \begin{equation*}
    W_{n} =W_{0}(1+f)^{S}(1-f)^{F}
  \end{equation*}
\end{frame}

\end{document}

enter image description here

Henri Menke
  • 109,596
2

It doesn't actually exceed the margin, but I agree it is a bad break.

Just add a tie.

\documentclass[10pt]{beamer}

\setbeamerfont{structure}{family=\rmfamily}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{bibliography item}[text]
\setbeamertemplate{caption}[numbered]

\usetheme{default}
\usecolortheme{seahorse}

\begin{document}

\begin{frame}
\frametitle{The Kelly Criterion -- Gambling}

Since the probabilities and the payoffs are all the same in each bet,
it seems likely that the gambler will always wager the same fraction~$f$ of his~bankroll.

Then, the quantity  $B_{i}$, called \emph{fixed fraction bet}, that he wagers in each bet is
\[
B_{i}=f \, W_{i-1},
\]
where $0 \leq f \leq 1$.

Let $S$ and $F$ be the number of successes and losses.

Then, the capital  of the gambler after $n$ trials is
\[
W_{n} =W_{0}(1+f)^{S}(1-f)^{F}
\]

\end{frame}

\end{document}

I made a few fixes:

  • \textit{f} and similar should be $f$ (it is math);
  • I removed the colons before the displayed equations (bad style);
  • I changed $$...$$ to the proper \[...\];
  • I changed \smallskip into \, (the former doesn't do what you hope it would do);
  • \textit for emphasis should better be \emph.

There would be several remarks on your defined commands.

enter image description here

egreg
  • 1,121,712