1

I was writing an equation with the code below

\newcommand{\uint}[4]{      
       \ensuremath{\underset{#3}{\int_{\!{#1}}^{#2}{#4}}}
       }

\def \integrando {\rho_{\mathrm{\mu c}}\frac{\dd p^{3N} \dd q^{3N}} {h^{3N}}}
\begin{document}
     $$\uint{}{}{\mathrm{PhaseSpace}}{\integrando}=1$$
\end{document}

enter image description here

How to remove the space before "PhaseSpace" and aligh the \int with "PhaceSpace"?

Albert
  • 37

2 Answers2

1

Maybe this is what you want?

\documentclass{article}

 \newcommand{\uint}[4]{
       \ensuremath{\underset{#3}{\int_{\!{#1}}^{#2}{#4}}}
       }
 \newcommand*{\dd}{\mathop{}\!\mathrm{d}}

\def \integrando {\rho_{\mu \mathrm{canonico}}\frac{\dd p^{3N} \dd q^{3N}} {h^{3N}}}

     \usepackage{mathtools}

\begin{document}

     \[ \int_{_\mathrm{\scriptstyle Ph\mathrlap{\mathrm{aseSpace}}}} {\integrando}=1 \]

\end{document}

enter image description here

Bernard
  • 271,350
  • Could you comment these lines of code in your comment? "\newcommand\eqmathbox[2][]{\eqmakebox[Eq#1]{\ensuremath{ \displaystyle#2}}}" and "\newcommand*{\dd}{\mathop{}!\mathrm{d}}" – Albert Nov 26 '17 at 20:06
  • 1
    Sorry for the \eqmathbox command: as you didn't post a full code, I took a preamble of mine. As to \dd, I use it for the differential symbol in integrals, to have it in roman with a correct spacing (borrowed from an egreg's code on this site). Remember I asked what the \other_expression command was. – Bernard Nov 26 '17 at 20:29
  • Ok! Anyway\other_expression was the final part of \integrando. I have just corrected the full definition of \integrando in the upper post. – Albert Nov 26 '17 at 20:51
  • 1
    The main difference with my code seems to be the order of $p$ and $q$ in the fraction. This being said, for spacing reasons (and save a bit of typing) you should use \dd (whatever name you give it). – Bernard Nov 26 '17 at 21:04
1

I suggest using \int\limits, which places the term "PhaseSpace" fully below the integral symbol; the \rlap directive allows for right-hand overlap with subsequent material.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for "\text" macro
\begin{document}

\[
\int\limits_{\rlap{\scriptsize PhaseSpace}}
  \ \rho^{}_{\mu\text{canonico}}\,
  \frac{\mathrm{d}q^{3N}\,\mathrm{d}p^{3N}}{h^{3N}}=1
\]

\end{document}
Mico
  • 506,678