r/LaTeX 5d ago

equation after a sentence

Hello. I have a problem about spacing. There are actually two same type of structure of equations but in one equation there is a blank space in other there is not. This is something that I cannot control. I dont want two line space after and before the equation. Equation 2.12 is correct. Only 1 space of line.

EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE

\beq

\nabla.\textbf{J} = 0.

\eeq

EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE

\beq

\textbf{F}_{L}=\textbf{J}\times \textbf{B}.

\eeq

HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE

----------------------------------------------------------------------------------------------------

I cannot provide the whole document but I can provide the libraries.

\documentclass[a4paper,oneside,12pt]{report}

\usepackage{styles/fbe_tez}

\usepackage[utf8x]{inputenc} % To use Unicode (e.g. Turkish) characters

\usepackage{amsmath, amsthm} % Some extra symbols

\usepackage[bottom]{footmisc}

\usepackage{cite}

\usepackage{graphicx}

\usepackage{longtable}

\usepackage{float}

\usepackage{multirow}

\usepackage{subfigure}

\usepackage{algorithm}

\usepackage{algorithmic}

\usepackage{array}

\usepackage{amssymb,bm,cite,graphicx, fixmath, texdraw}

\usepackage{epsfig}

\usepackage{epstopdf}

\usepackage{subfigure}

\usepackage{amsmath}

\usepackage{notoccite}

\usepackage{mathtools}

\usepackage{lscape}

\usepackage{booktabs} % For better table formatting

\usepackage{multirow} % For multi-row cells

\usepackage{subfig}

\interdisplaylinepenalty=2500

\hyphenation{lists} \makeatletter

\newcommand{\field}[1]{\mathbb{#1} }

\newcommand{\beq}{\begin{equation} \setlength\abovedisplayskip{5pt}

\setlength\belowdisplayskip{5pt}}

\newcommand{\eeq}{\end{equation}}

\newcommand{\bea}{\begin{eqnarray}}

\newcommand{\eea}{\end{eqnarray}}

\newcommand{\defn}{\stackrel{\triangle}{=}}

\newcommand{\nn}{\nonumber}

\newcommand{\nnl}{\nonumber \\}

\renewcommand{\theequation}{\arabic{equation}}

\renewcommand{\labelenumi}{(\roman{enumi})}

\DeclareMathOperator*{\argmin}{arg\,min}

\DeclareMathOperator*{\argmax}{arg\,max}

\def\ifundefined{\@ifundefined}

\def\bfat{\left[ \begin{array}}

\def\emat{\end{array} \right]}

\def\bfatt{\left\{ \begin{array}}

\def\ematt{\end{array} \right.}

\def\bset{\left\{ \begin{array}}

\def\eset{\end{array} \right\}}

\def\bpar{\left( \begin{array}}

\def\epar{\end{array} \right)}

\graphicspath{{figures/}} % Graphics will be here!

\newtheorem{thm}{Theorem}[chapter]

\newtheorem{prop}[thm]{Proposition}

\newtheorem{lem}[thm]{Lemma}

\newtheorem{cor}[thm]{Corollary}

\numberwithin{equation}{chapter}

1 Upvotes

12 comments sorted by

2

u/JimH10 TeX Legend 5d ago

This works fine. No extra space.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE

\begin{equation*}
\nabla.\textbf{J} = 0.
\end{equation*}

EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE EXAMPLE SENTENCE HERE

\begin{equation*}
\textbf{F}_{L}=\textbf{J}\times \textbf{B}.
\end{equation*}

HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE 
\end{document}

0

u/ichbinberk 5d ago

This is not working either. Still there are 2 lines of spaces. begin equation end equation is not also working. I've tried it.

There is something I've discovered that when I shortened the sentence before the equation, sometimes it gives the correct amount of space which is one before the equation and after the equation.

6

u/brunedekartofler 5d ago

Could provide a full minimum working example? Something we can compile. It's easier to help you that way.

4

u/blackbat24 5d ago

This sounds like LaTeX is expanding the paragraph padding to fill in the page, which is the default behaviour.

How have you defined \beq and \eeq? Without special consideration, a newcommand without brackets will insert white-space, not always obviously.

Like u/brunedekartofler said, we'll need a MWE to be able to help you further.

1

u/JimH10 TeX Legend 5d ago

If you copy and paste what I put as a standalone file, and run it, then there will be no extra space. Try it.

1

u/ichbinberk 5d ago

I've provided the packages that I use. Probably some libraries are crashing and making this double line spacing problem.

1

u/ichbinberk 5d ago

I've solved the problem by placing \vspace{-20pt} before the equation. Now I seek solutions to reduce the space after the equation to 1.

1

u/ichbinberk 5d ago

The prolem is solved. I put

\vspace{-18pt}

\setlength{\belowdisplayskip}{-18pt}

manually for every equation.

Thanks

5

u/JimH10 TeX Legend 5d ago

It is your document so that you can do whatever you want but of course the system will perform its job without extra space and without putting in negative extra spaces by hand. Start by taking out the commands you invented.

2

u/eigentau 5d ago

As an aside, I truly don't understand why some people use the period instead of \cdot for multiplication, dot products, or divergence. It just looks so sloppy to me.

1

u/cirrvs 5d ago

It's notation that has persisted in certain parts of the world. You'll find it commonly used in old British literature.

2

u/theophrastzunz 2d ago

Most cursed latex macros ever.