6

I have a fraction whose denominator is a fraction again. I want to write the denominator in parantheses, but I have the feeling that the space is not really nice.

enter image description here

The lower term is nice from the spacing, but parantheses destroy it. I would love to see the whole fraction in the denominator a bit up. Is that possible? Here is my code:

\documentclass{article}
\usepackage[german, linesnumbered, boxruled]{algorithm2e}
\usepackage{algorithmic}

\begin{document}
\[
    \lim\limits_{x\to\infty} \frac{\pi(x)}{\left(\frac{x}{\log(x)}\right)} = 1. 
\]

\[
\lim\limits_{x\to\infty} \frac{\pi(x)}{\frac{x}{\log(x)}} = 1. 
\]
\end{document}
1
  • Why do you use \limits into \[...\]: is unnecessary? Use the package amsmath and \dfrac in \left(\frac{x}{\log(x)}\right).
    – Sebastiano
    Commented Mar 11 at 21:01

3 Answers 3

6

Don't use \left and \right to size the parentheses in the denominator term; use \bigl and \bigr instead. For that matter, does the denominator term really need parentheses? And do you need the parentheses in \log(x)?

Do also give some thought to replacing the \frac-format denominator term with an inline-fraction expression. That way, the terms in the numerator and denominator will all be rendered in \textstyle math mode.

Finally, there's no need for the \limits qualifiers.

enter image description here

\documentclass{article}
\begin{document}
\[
\lim_{x\to\infty} \frac{\pi(x)}{\bigl(\frac{x}{\log(x)}\bigr)} =
\lim_{x\to\infty} \frac{\pi(x)}{\frac{x}{\log x}} = 
\lim_{x\to\infty} \frac{\pi(x)}{x/\log x} = 1. 
\]
\end{document}
1
  • Why the downvote? Please enlighten me.
    – Mico
    Commented Mar 13 at 16:06
6

Three answers appeared in the time it took me to write this up but I'm posting it anyway. You can use the mathtools package and its \DeclarePairedDelimiter command to create paired delimiters that size correctly, using optional manual \big, \Big, etc.

% !TEX program = lualatexmk
% !TEX encoding = UTF-8 Unicode

\documentclass{article}
\usepackage[german, linesnumbered, boxruled]{algorithm2e}
\usepackage{algorithmic}
\usepackage{mathtools}

\DeclarePairedDelimiter{\ps}{(}{)}

\begin{document}
\[
    \lim_{x\to\infty} \frac{\pi(x)}{\left(\frac{x}{\log x}\right)} = 1. 
\]

\[
    \lim_{x\to\infty} \frac{\pi(x)}{\frac{x}{\log x}} = 1. 
\]

\[
    \lim_{x\to\infty} \frac{\pi(x)}{ \ps{\frac{x}{\log x}} } = 1. 
\]

\[
    \lim_{x\to\infty} \frac{\pi(x)}{ \ps[\big]{\frac{x}{\log x}} } = 1. 
\]

\[
    \lim_{x\to\infty} \frac{\pi(x)}{ \ps[\Big]{\frac{x}{\log x}} } = 1. 
\]
\end{document}

MWE result

0
5

Instead of \left and \right, which set automatically the delimiters sizes, you can choose it manually with (from smaller to bigger) :

\bigl ... \bigr
\Bigl ... \bigr
\biggl ... \biggr
\Biggl ... \Biggr 

For example, with \bigl and \bigr :

\documentclass{article}
\usepackage[german, linesnumbered, boxruled]{algorithm2e}
\usepackage{algorithmic}

\begin{document}
\[
  \lim_{x\to\infty} \frac{\pi(x)}{\bigl(\frac{x}{\log(x)}\bigr)} = 1.
\]

\[
  \lim\_{x\to\infty} \frac{\pi(x)}{\frac{x}{\log(x)}} = 1.
\]
\end{document}

enter image description here

2
  • +1. Into \[...\] \limits has not effect.
    – Sebastiano
    Commented Mar 11 at 21:10
  • 1
    @Sebastiano OK, I edited the answer to remove it. Thanks.
    – jlab
    Commented Mar 11 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .