2

i'm having issues with bracket formatting around fractions. For example, this code :

\documentclass{article}

\usepackage{mathtools}

\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\begin{document}
    \begin{equation*}
    Core = \floor*{\dfrac{\floor*{\dfrac{\floor*{\dfrac{2*Level}{5}+2}*EffectiveAttack}{EffectiveDefense}}}{50}}
    \end{equation*}
\end{document}

produces this output :

enter image description here

I like that this fraction isn't squished vertically (thanks to dfrac) but it doesn't require such a wide space around the denominator, so i would like the outer brackets bottom branches to stop slightly below the denominator.

I'd like a way to produce something like this (sorry for the bad edit):

enter image description here

Is there a way to achieve this ? Thanks in advance.

2 Answers 2

2

with enclose your expression in matrix environment:

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\begin{document}
    \[
\text{Core} = 
    \floor*{\begin{matrix}
            \dfrac{\floor*{\begin{matrix}
                            \dfrac{\floor*{\dfrac{2*\text{Level}}{5}+2}*\text{EffectiveAttack}}
                                  {\text{EffectiveDefense}}
                           \end{matrix}}}
                  {50}
              \end{matrix}}
    \]
\end{document}

enter image description here

1
  • Thank you a lot! Accepting your answer as it requires the least amount of modification from the writer's perspective. Feb 14, 2021 at 21:31
2

Some ad hoc functions, using the fact that you want to adjust fractions.

Below I also show a different rendering of the formula.

\documentclass{article}

\usepackage{mathtools,delarray}

\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand{\adjustedfloor}[1]{%
  \raisebox{\dimexpr\depth-\fontdimen22\textfont2-\fontcharht\font`0+0.4ex}{%
    $\begin{array}\lfloor{@{}c@{}}\rfloor #1 \end{array}$%
  }%
}

\begin{document}

\begin{equation*}
\mathrm{Core} = 
\adjustedfloor{
  \dfrac{
    \adjustedfloor{
      \dfrac{
        \floor*{\dfrac{2\cdot\mathrm{Level}}{5}+2}\cdot\mathrm{EffectiveAttack}
      }{
        \mathrm{EffectiveDefense}
      }% end of \dfrac
    }% end of \adjustedfloor
  }{50} % end of \dfrac
}% end of \adjustedfloor
\end{equation*}

\begin{equation*}
\mathrm{Core}=
\floor*{
  \frac{1}{50}
  \floor*{
    \dfrac{
      \floor{(2/5)\cdot\mathrm{Level}+2}\cdot\mathrm{EffectiveAttack}
    }{
      \mathrm{EffectiveDefense}
    }
  }
}
\end{equation*}

\end{document}

enter image description here

1

You must log in to answer this question.

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