Text FormattingExtra space after intext equation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Extra space after intext equation

Post by Cham »

I'm getting an extra space after many small equations and I don't know why. Is this normal ?

Here's a compilable example showing the issue (sorry, the text is in French, but this is irrelevent here) :

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{tensor}

\begin{document}
Les équations inhomogènes de Maxwell peuvent être démontrées sans faire une référence explicite à des champs de matière particuliers.  Selon la décomposition, la densité lagrangienne $\tensor{\mathscr{L}}{_{\rm mat}}$ est associée aux champs de matière \emph{libres} et ne dépend pas du champ électromagnétique.  La densité lagrangienne de celui-ci est définie par une expression quadratique dépendante de $\tensor{\partial}{_{\mu}} \, \tensor{A}{_{\nu}}$ ; mais pas des composantes $\tensor{A}{_{\nu}}$ elles-mêmes :

Par hypothèse, la densité lagrangienne d'interaction $\tensor{\mathscr{L}}{_{\rm int}}$ dépend des composantes $\tensor{A}{_{\mu}}$ mais pas de leurs dérivées partielles $\tensor{\partial}{_{\mu}} \, \tensor{A}{_{\nu}}$.  On procède à une variation arbitraire $\delta \tensor{A}{_{\mu}}$ des composantes du quadri-potentiel électromagnétique, tandis que tous les autres champs restent fixés ; $\delta \tensor{\phi}{_k} = 0$.  Ceci induit une variation de l'action \emph{totale} :

Selon la définition, le premier terme de cette intégrale fait intervenir les composantes $\displaystyle{\tensor{J}{^{\nu}}}$ de la densité de courant électrique associée à la matière chargée :

Le dernier terme est une divergence pure.  Son intégration peut donc être convertie en intégrale d'hypersurface grâce au théorème de Gauss, et être éliminée pour les variations $\delta \tensor{A}{_{\mu}}$ devant s'annuler sur le bord du domaine $\Omega$.
\end{document}
Any idea why the extra space ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Extra space after intext equation

Post by Stefan Kottwitz »

It seems it's caused by \tensor. To see this, replace

Code: Select all

$\tensor{\mathscr{L}}{_{\rm mat}}$
by

Code: Select all

$\mathscr{L}_{\mathrm{mat}}$
Btw. \rm is an obsolete command and should not be used, even if it's partially supported because of compatibility reasons.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Extra space after intext equation

Post by Cham »

Stefan,

the problem with your suggestion is that the index isn't at the right height compared with what the tensor package is doing. This is important because when I write tensors, all the indices should be properly placed. See this example :

Code: Select all

$x_{\mu} \, y_{\mu}^{\lambda}$
The first \mu index isn't at the same height as the second \mu index. The tensor command solves this :

Code: Select all

$\tensor{x}{_{\mu}} \, y_{\mu}^{\lambda}$
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Extra space after intext equation

Post by Cham »

Is there a solution for the extra space, even when using the tensor command ?
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Extra space after intext equation

Post by cgnieder »

This seems to be some strange interaction between \tensor (or \indices from the same package) and \mathscr:

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{tensor}

\begin{document}

$\tensor{\mathscr{A}}{_{\mathrm{b}}}$text

$\tensor{A}{_{\mathrm{b}}}$text

$\mathscr{A}\indices{_{\mathrm{b}}}$text

$A\indices{_{\mathrm{b}}}$text

$\mathscr{A}_{\mathrm{b}}$text

\end{document}
I was unable to determine why that happens, though.

Regards
site moderator & package author
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Extra space after intext equation

Post by Cham »

Yep, it appears to be related to \mathscr. Very strange.
Post Reply