\documentclass[10pt]{book}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{pgf,pgfplots}
\usepackage[utf8]{inputenc}
\usepackage[romanian]{babel}
\usepackage[paperwidth=15.5cm, paperheight=23.5cm, margin=2cm]{geometry}
\usepackage{amsthm,amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{rmathbr}
\usepackage{float}
\usetikzlibrary{math,arrows,positioning,shapes,fit,calc}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usepackage{xcolor}
\usepackage{enumitem}
\binoppenalty=10000
\relpenalty=10000
\begin{document}
s\\
\textit{Demonstra\c tie.} Demonstr\u am doar prima egalitate, c\u aci a doua e analoag\u a. Cum $f:A\to B$ \c si $1_A:A\to A$ rezult\u a c\u a func\c tiile $f\circ 1_A$ \c si $f$ au acela\c si domeniu de defini\c tie $A$ \c si acela\c si codomeniu $B$. Pentru orice $x\in A$, $(f \circ 1_A)(x)=f(1_A(x))=f(x)$, deci func\c tiile $f \circ 1_A$ \c si $f$ au \c si aceea\c si lege de asociere. \^In concluzie, $f\circ 1_A=f$.
\end{document}
The code above generates a small paragraph included in a math LaTeX document I'm working on. The problem with it is that on the third line of the pdf generated, the math is broken into two different lines. As you can see, I included the \binoppenalty and \relpenalty and they don't work. Please help me stop these kinds of unecessary line breaking in inline math. Thanks in advance!
mbox
. In your case i would think about setting the equation in an equation or similar environment – user1146332 Apr 10 '20 at 9:28