On Lyx, if I type an equation like this
then I get this on pdf
I mean, there is a huge gap within the box above the equation.
But if I type a non-equation text like this
then it's normal on pdf.
How can I remove that gap when I type equation within the box?
And here is the tex code that I used to generate it.
\documentclass[english]{beamer}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{calc}
\usepackage{amsmath}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\setbeamerfont{footline}{series=\bfseries}
\setbeamertemplate{navigation symbols}{%
\insertslidenavigationsymbol \insertframenavigationsymbol
\insertsubsectionnavigationsymbol \insertsectionnavigationsymbol
\insertdocnavigationsymbol \insertbackfindforwardnavigationsymbol \hspace{1em}%
\usebeamerfont{footline} \insertframenumber/\inserttotalframenumber%
}
\makeatother
\usepackage{babel}
\begin{document}
\begin{frame}[t]{Title}
\begin{center}
{\small{}}%
\fbox{\begin{minipage}[t]{0.8\columnwidth}%
{\small{}
\begin{align*}
& equation
\end{align*}
}%
\end{minipage}}{\small\par}
\par\end{center}
\begin{itemize}
\item Content
\item Content
\end{itemize}
\end{frame}
\begin{frame}[t]{Title}
\begin{center}
{\small{}}%
\fbox{\begin{minipage}[t]{0.8\columnwidth}%
\begin{center}
non-equation text
\par\end{center}%
\end{minipage}}{\small\par}
\par\end{center}
\begin{itemize}
\item Content
\item Content
\end{itemize}
\end{frame}
\end{document}






alignenvironment at top of page/minipage– barbara beeton Mar 03 '20 at 17:54\pretocmd\start@alignin my code? Where should I put\if@minipage\kern-\topskip\kern-\abovedisplayskip\fi? And what are those{}{}? – user42459 Mar 07 '20 at 02:27\usepackage{etoolbox}would be placed in your preamble, exactly as it appears. This should be the equivalent of inserting this at the top of a minipage that begins with analign:\kern-\topskip\kern-\abovedisplayskip; but of course that would have to be put into every minipage that starts with analign. (This "direct" approach would be needed if the minipage begins withequationor a display that isn't based onalign.) – barbara beeton Mar 07 '20 at 03:25\kern-\topskip. You need only the\kern-\abovedisplayskip. – barbara beeton Mar 07 '20 at 20:52