0

I'm writing a long inline equation which contains text and citations in it by using the \textit{}, \text{} and \ref{} command.

The problem is that both inside the text environment and after a manually placed space using the \ command the equation doesn't break and continues over the margin of the page. Is there a way to be able to break any inline equation in the document by also maintaining the correct separation of syllables for the word that has to be broken?

I'm writing in Italian.

Here's a very very stupid and obviously nonsensical MWE:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}

\usepackage{mathtools}
\usepackage{amssymb, amsmath}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=black,
}
\urlstyle{same}

\title{Title}
\author{Author}
\date{Date}

\begin{document}

\maketitle

\begin{equation}
    y=x
    \label{example1}
\end{equation}

\begin{equation}
    y=x^2
    \label{example2}
\end{equation}

\begin{equation}
    y=x^3
    \label{example3}
\end{equation}

\begin{equation}
    y=x^4
    \label{example4}
\end{equation}

\begin{equation}
    y=x^5
    \label{example5}
\end{equation}

\begin{equation}
    y=x^6
    \label{example6}
\end{equation}

\begin{equation}
    y=x^7
    \label{example7}
\end{equation}

\begin{equation}
    y=x^8
    \label{example8}
\end{equation}

Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo.

In termini matematici risulta: $\because \textit{equazione}\ \text{\ref{example7};}\ \therefore \forall x\in X\exists y\in Y|\textit{rispetti l'equazione}\ \text{\ref{example6}}$, inoltre $\because \textit{le equazioni}\ \text{\ref{example5},}\ \text{\ref{example4},}\ \text{\ref{example3},}\ \text{\ref{example2};}\ \therefore \forall y\in Y\exists x.\in X|\textit{rispetti le equazioni}\ \text{\ref{example1},}\ \text{\ref{example6},}\ \text{\ref{example7},}\ \text{\ref{example8}}$.

Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo

\end{document}

Here is what it looks like: enter image description here

Thank you for your time!

  • 1
    Frankly, I do not see any reason for all this \textit stuff. Are you really sure you want to typeset it this way? Wouldn't it be better to use just ordinary equations, and ordinary inline equations only for the formulae? – user121799 Sep 13 '18 at 2:59
1

Note that \textit is not breakable in inline math mode.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}

\usepackage{mathtools}
\usepackage{amssymb, amsmath}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=black,
}
\urlstyle{same}

\title{Title}
\author{Author}
\date{Date}

\begin{document}

\maketitle

\begin{equation}
    y=x
    \label{example1}
\end{equation}

\begin{equation}
    y=x^2
    \label{example2}
\end{equation}

\begin{equation}
    y=x^3
    \label{example3}
\end{equation}

\begin{equation}
    y=x^4
    \label{example4}
\end{equation}

\begin{equation}
    y=x^5
    \label{example5}
\end{equation}

\begin{equation}
    y=x^6
    \label{example6}
\end{equation}

\begin{equation}
    y=x^7
    \label{example7}
\end{equation}

\begin{equation}
    y=x^8
    \label{example8}
\end{equation}

Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo.

\sloppy
In termini matematici risulta: $\because \textit{equazione}\space \text{\ref{example7};}\space \therefore \forall x\in X\exists y\in Y|$
\textit{rispetti l'equazione} \ref{example6}, inoltre $\because$ \textit{le equazioni} \ref{example5}, \ref{example4},
\ref{example3}, \ref{example2};$ \therefore \forall y\in Y\exists x.\in X|$ \textit{rispetti le equazioni} \ref{example1}, \ref{example6}, \ref{example7},
\ref{example8}.

Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo Testo

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.