## LaTeX forum ⇒ Math & Science ⇒ amsmath | Font Size of Fractions in the »cases« Environment Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Karlo
Posts: 2
Joined: Sun Jul 22, 2012 2:10 am

### amsmath | Font Size of Fractions in the »cases« Environment

Hello,

I am trying to write Bayes theorem, using cases environment in amsmath package.

My code is:
\begin{equation}  \pi(\boldsymbol{\theta}\!\mid\!\boldsymbol{x}) =     \begin{cases}      	  \frac{q(\boldsymbol{\theta}) r(\boldsymbol{x}\mid\boldsymbol{\theta})}{\int_{\Theta} q(\boldsymbol{\theta}) r(\boldsymbol{x}\mid\boldsymbol{\theta}) \: \emph{d} \lambda(\boldsymbol{\theta})}               & \text{if $\int_{\Theta} q(\boldsymbol{\theta}) r(\boldsymbol{x}\!\mid\!\boldsymbol{\theta}) \: \emph{d} \lambda(\boldsymbol{\theta}) \neq 0$} \\               0 & \text{else}       \end{cases}\end{equation}

I have a problem with the size of the fraction in it. It's too small, I'd like to give it more space so that the integral in the fraction is as big as the integral after if. Is there an easy way how to make it happen? Hope it's understandable from my description where my problem is:)

Thanks a lot,

K.

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
The cases environment of amsmath can be enhanced by several packages.

Let's take a look at a solution with mathtools because it offers the right stuff here.
\documentclass{scrartcl}\usepackage[T1]{fontenc}\usepackage{mathtools}  % loads »amsmath« \begin{document}   \begin{equation}     \pi(\boldsymbol{\theta}\!\mid\!\boldsymbol{x}) =     \begin{dcases}       \frac{q(\boldsymbol{\theta}) r(\boldsymbol{x}\mid\boldsymbol{\theta})}{\displaystyle\int_{\Theta} q(\boldsymbol{\theta}) r(\boldsymbol{x}\mid\boldsymbol{\theta}) \: \emph{d} \lambda(\boldsymbol{\theta})}       & \text{if $\int_{\Theta} q(\boldsymbol{\theta}) r(\boldsymbol{x}\!\mid\!\boldsymbol{\theta}) \: \emph{d} \lambda(\boldsymbol{\theta}) \neq 0$} \\       0 & \text{else}     \end{dcases}   \end{equation}\end{document}

What has been done here:

• The cases environment has been replaced by dcases. This activates \displaystyle in the whole environment and thus increases font size for fractions.
• In the denominator of the first fraction it is necessary to enable \displaystyle separately in order to let the integral symbol appear in the familiar size.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Karlo
Posts: 2
Joined: Sun Jul 22, 2012 2:10 am
Yeah,

that's it.

Thanks again for your help,

K.