beamer add tag
JeT
**My question**

I toggle elements between beamer and article (again...).
This time I'd like have a correspondence between a `marginnote` of just one `equation` in `article`, and a `frame` with the same equation, but scaled to `\textwidth`

**What I already read**

https://tex.stackexchange.com/questions/38352/resize-scale-equation-in-beamer

and

https://tex.stackexchange.com/questions/448654/automatically-resize-equations


based on the last one for MWE.

It works in `article`, not in `beamer` (missin $ inserted error :/)

![TAEquationsidenote.png](/image?hash=df460d2cd094a907f6e82d82e1e26066d5586bf5bedd0a42247c89647a29704c)


![TAEquationsidenote2.png](/image?hash=c500a85ed69c2cf58012bb2cee9735a950a9282d317cb9c190092b75667d52fe)

**MWE**

  ```
\documentclass{beamer}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{graphics}
\usepackage{mathtools}
\usepackage{comment}
\usepackage{lipsum}

\begin{comment}
 \usepackage{sidenotes}
 \usepackage{marginnote}
 \DeclareCaptionType[fileext=eqn]{equa}[Formule][Formules à retenir]

 \usepackage{geometry} 
    \geometry{
    a4paper,
    top=2cm,
    bottom=2cm,
    left=15.00mm,   
    textwidth=130mm, 
    marginparsep=8.2mm, 
    marginparwidth=50.0mm 
    }
\end{comment}

\newcommand{\hackEq}[2]{
 \mode<article>
 {%Sidenote with equation
  \marginpar{\captionof{equa}{#2} \[#1\] }  
 } 
 \mode<beamer>{%slide with one centered big equation
  \begin{frame}
  \frametitle{#2}%
   \begin{equation*}
    \resizebox{.9\textwidth}{!}{#1}
   \end{equation*}  
  \end{frame}
 }
}

\begin{document}

\begin{frame}
 \frametitle{Title}
 \lipsum[1]
\end{frame}

 \hackEq
 {%
  \displaystyle R=\frac{\sum_{i=1}^{m}\left(F_{i}+s\right) t_{i} D_{i}}{\sum_{i=1}^{m} \tau_{i} D_{i}}
 }%
 {Equation Name or very short sentence.}
  

\end{document}
 ```
Top Answer
samcarter
The problem is (besides a missing `{`) that the content of `\resizebox` is back in text mode, you can fix this by wrapping your argument in math mode. (the `equation*` environment around is then not really necessary any more, you could replace it with centering)

```
\documentclass{beamer}
%\documentclass{article}
%\usepackage{beamerarticle}

\usepackage{lipsum}
%\usepackage{sidenotes}
%\usepackage{marginnote}
%\DeclareCaptionType[fileext=eqn]{equa}[Formule][Formules à retenir]


  \geometry{
  a4paper,
  top=2cm,
  bottom=2cm,
  left=15.00mm,   
  textwidth=130mm, 
  marginparsep=8.2mm, 
  marginparwidth=50.0mm 
  }

\newcommand{\hackEq}[2]{
\mode<article>{%Sidenote with equation
\marginpar{\captionof{equa}{#2} \[#1\] }  
} 
\mode<beamer>{%slide with one centered big equation
\begin{frame}
\frametitle{#2}%
 \begin{equation*}
  \resizebox{.9\textwidth}{!}{$\displaystyle #1 $}
 \end{equation*}  
\end{frame}
}
}

\begin{document}

\begin{frame}
\frametitle{Title}
\lipsum[1]
\end{frame}

\hackEq
{%
\displaystyle R=\frac{\sum_{i=1}^{m}\left(F_{i}+s\right) t_{i} D_{i}}{\sum_{i=1}^{m} \tau_{i} D_{i}}
}%
{Equation Name or very short sentence.}


\end{document} 
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.