# equation environment and large fractions

Hello i am currently using the equation environment and trying to "prettily" write down the probability distribution function of the chi-distribution (https://en.wikipedia.org/wiki/Chi_distribution) This is my preamble:

\documentclass[11pt,a4paper,ngerman]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{scrlayer-scrpage}
\ofoot[\pagemark]{\pagemark}
\cfoot[]{}
\author{James Oliver Reppin}
\usepackage[onehalfspacing]{setspace}
\usepackage{tocloft}
\usepackage{amsmath}


My code snippet currently looks like this:

\begin{document}
\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\chapter{asd}
\section{asd1}
\subsection{Chi-distribution}
\begin{aligned} &f(x) = \dfrac{x^{k-1}e^{-\dfrac{x^{2}}{2}}}{2^{\dfrac{k}{2}} \Gamma\left(\dfrac{k}{2}\right)},\;\;x\in \left[0,\infty\right),\;\;k>0\\ &blabla
\end{document}


My problem is, the huge fraction with exponents and such is weirdly proportioned, especially the denominator, where the exponents are displayed bigger than the actual base. Is there a way to make it prettier, aka have it look more like on the wikipedia page?

• Please make your example into a simple piece of code that others can just copy and test as is. Sniplets like this are not particularly useful Sep 7 '20 at 14:46
• i edited the question, i think with the preamble and the snipped one should be able to recreate my problem, since i just left out the bibliography, titlepage and the table of content Sep 7 '20 at 14:51
• you are over-riding the normal styling and forcing display style fractions in a superscript which will look weird. also don't use aligned for single line equations Sep 7 '20 at 14:53
• you have posted two fragments but neither allows anyone to simply run the example. can you replace themby a single small but complete example Sep 7 '20 at 14:57
• yes there are rather few case where dfrac should be used Sep 7 '20 at 14:58

Use the slashed form for fractions in exponents; surely not \dfrac.

\begin{aligned} &f(x) = \dfrac{x^{k-1}e^{-x^2/2}}{2^{k/2}\Gamma(k/2)}, \qquad x\in [0,\infty),\quad k>0\\ &blabla \end{aligned}


The version with \frac is much less readable, in my opinion.

\begin{aligned} &f(x) = \dfrac{x^{k-1}e^{-\frac{x^2}{2}}}{2^{\frac{k}{2}}\Gamma\Bigl(\dfrac{k}{2}\Bigr)}, \qquad x\in [0,\infty),\quad k>0\\ &blabla \end{aligned}


• i like your first method using the slashed form the most, so i upvoted your answer as the solution! Sep 8 '20 at 12:10

The first thing to do is to not use \dfrac in exponents. I replaced this command with \tfrac (in the exponents) and with \mfrac (medium-sized fraction, from nccmath) for the argument of the Γ function. For a better spacing I also replaced a pair \left(...\right) with the pair \Bigl(...\Bigr) and improved the layout of the -\tfrac{x^2}{2} exponent:

\documentclass[11pt,a4paper,ngerman]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{scrlayer-scrpage}
\ofoot[\pagemark]{\pagemark}
\cfoot[]{}
\author{James Oliver Reppin}
\usepackage[onehalfspacing]{setspace}
\usepackage{nccmath, mathtools}
\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}

\begin{document}

\chapter{asd}
\section{asd1}
\subsection{Chi-distribution}

\begin{aligned} &f(x) = \dfrac{x^{k-1}e^{-\tfrac{\,x^{\mathrlap{2}}}{2}}}{2^{\tfrac{k}{2}}\, \Gamma\Bigl(\mfrac{k}{2}\Bigr)},\;\;x\in \left[0,\infty\right),\;\;k>0\\ &blabla \end{aligned}

\end{document}