2

I want to write just one equation from left in a beamer documentclass, but it seems that \begin{flalign} doesn't work, and everything that I write will be centered. I don't want to use \usepackage[fleqn]{beamer} as it will make all the equations to start from left. This is my code:

\documentclass{beamer}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and
\usepackage{dsfont}
\usepackage{amsmath}
\begin{document}
\begin{frame}
\begin{flalign}
&\min\hspace{0.5cm}\sigma_{ASE}^2x^{-1}+\zeta_1x^2+\zeta_2z &&\\
&\text{s.t.}\hspace{0.5cm}&\mathds{1}^Tp=1 &&\\
& p\geq 0 &&\\
& a^Tp\leq P_t &&\\
& a^T p=x &&\\
& b^T p=z &&
\end{flalign}
\end{frame}
\end{document}

and this is my output:

There is a similar post here, but it does not give me any solution. Any help?

6
  • 1
    note that fl in the fleqn option stands for flush left but the fl in flalign stands for full length, it isn't designed to be flush left so much as take up the full width of the page so starting at the left edge... Apr 11, 2017 at 22:18
  • so is there anyway to handle it? I am trying to put that part here to run it
    – CLAUDE
    Apr 11, 2017 at 22:20
  • @DavidCarlisle I editted my post now
    – CLAUDE
    Apr 11, 2017 at 22:24
  • $\displaystyle 5+6=11$ on a line by itself.
    – egreg
    Apr 11, 2017 at 22:35
  • @egreg what about the new code?
    – CLAUDE
    Apr 11, 2017 at 22:40

1 Answer 1

2

Like all the ams alignments it isn't really designed for single line equations (and isn't designed to make flush left at all) but....

enter image description here

\documentclass{beamer}
\usepackage{amsmath}
\usepackage{dsfont}
\begin{document}
\begin{frame}
\begin{flalign*}
&5+6=11&&
\end{flalign*}
\end{frame}
\end{document}

enter image description here

\documentclass{beamer}
\usepackage{amsmath}
\usepackage{dsfont}
\begin{document}
\begin{frame}
\begin{flalign*}
\min\hspace{0.5cm}&\sigma_{ASE}^2x^{-1}+\zeta_1x^2+\zeta_2z &\\
\text{s.t.}\hspace{0.5cm}&\mathds{1}^Tp=1&\\
& p\geq 0 &\\
& a^Tp\leq P_t &\\
& a^T p=x &\\
& b^T p=z &
\end{flalign*}
\end{frame}
\end{document}
5
  • But for the original problem (which you can see it in the problem), I get centered output again :(
    – CLAUDE
    Apr 11, 2017 at 22:38
  • @CLAUDE added the expression you had originally, looks left aligned to me? Apr 11, 2017 at 22:46
  • It worked finally, I really appreciate your help David
    – CLAUDE
    Apr 11, 2017 at 22:51
  • can you explain how this works? What are you doing? Jun 9, 2022 at 16:48
  • @robertspierre I did nothing special at all, it's just demonstrating standard usage of flalign Jun 9, 2022 at 19:02

You must log in to answer this question.

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