Math & Sciencebeamer | Adding Text to an Equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

beamer | Adding Text to an Equation

Post by latexhelp1 »

How do you add text to an equation?

For example. I want want write y = 2x + 3 where

I would normally write

Code: Select all

\begin{equation*}
y = 2x + 3
\end{equation*}
How can I add the word where after the 3 such that it is not not italicized like a variable?
Last edited by latexhelp1 on Tue Feb 07, 2012 10:52 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Adding Text to an Equation

Post by localghost »

The amsmath package is your friend.

Code: Select all

\documentclass[professionalfonts,smaller]{beamer}
\usepackage[T1]{fontenc}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{fix-cm}

\begin{document}
  \begin{frame}
    \begin{equation*}
      y=2x+3 \text{ where }
    \end{equation*}
  \end{frame}
\end{document}

Thorsten
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

beamer | Adding Text to an Equation

Post by latexhelp1 »

Thorston,

Thank you very much for this! It works very nicely. However, the text comes across relatively darker than the equation itself. Is there a way for it to blend in with the equation?

Perhaps it is the set of packages I'm using:

Code: Select all

    \documentclass[professionalfonts, smaller]{beamer} 
    \usetheme{CambridgeUS}
    \usepackage[latin1]{inputenc}
    \usefonttheme{professionalfonts}
    \usepackage{times}
    \usepackage{tikz}
    \usepackage{amsmath}
    \usepackage{verbatim}
    \usepackage[T1]{fontenc}
    \usepackage{mathtools}
    \usepackage{fix-cm}
    \usetikzlibrary{arrows,shapes}
    \DeclareMathOperator*{\Max}{Max}

    \begin{document}

    \tikzstyle{every picture}+=[remember picture]

    \everymath{\displaystyle}

    \begin{frame}
    \frametitle{Title of Frame}

    \begin{equation*}
     y=2x+3  \hspace{0.05cm} \text{ where }
     \end{equation*}

    \end{frame}
    \end{document}
localghost wrote:The amsmath package is your friend.

Code: Select all

\documentclass[professionalfonts,smaller]{beamer}
\usepackage[T1]{fontenc}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{fix-cm}

\begin{document}
  \begin{frame}
    \begin{equation*}
      y=2x+3 \text{ where }
    \end{equation*}
  \end{frame}
\end{document}

Thorsten
Last edited by latexhelp1 on Tue Feb 07, 2012 10:52 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Adding Text to an Equation

Post by localghost »

Just drop the obsolete times package. For presentations use font packages like cmbright or iwona. Sans serif fonts are more suitable for presentations. Then you also won't need the fix-cm package any more.
Post Reply