In certain typographical conventions, it is customary to duplicate symbols of binary mathematical operators when a line break occurs. For instance, if a + b = c
is broken at +
, the result would be a +
on the first line, and + b = c
on the second line. Duplication also occurs for logical connectives (\Longrightarrow
), and relation symbols which are binary (=
), and several arrows (xrightarrow
).
The exception to this would be the binary minus sign, –
. As example, a – b = c
would become a +
on the first line, and – b = c
on the second line.
Question: Is there a way to do such breaking globally but for inline math only in an automatic way?
Here's an MWE that might be tested to work properly should you choose to answer this question.
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{titlesec}
\usepackage[pdftex]{graphicx}
\usepackage{parskip}
\usepackage[a4paper]{geometry}
%Solution code might go here%
\begin{document}
$a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a$
$b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b$
$c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c=c==c=c=c=c=c=c=c=c=c=c=c=c=c$
$d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d\Longrightarrow d$
$e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e\xrightarrow{n\to\infty} e$
\end{document}
Note: $$
-s are used on purpose. Also: I'm using pdfLaTeX if this is important. (The loaded packages are not really important, however do serve as some kind of a selection. If the proposed solution does not interfere with common packages, that would be ideal).
A previous question looked at doing this only for =
and \leq
. Is there a more general way without having to specify each symbol separately?
This is also related but less so.
\documentclass
)rmathbr
package\xrightarrow
: only single symbols can get repeated.rmathbr
seems to be a goodie indeed for me! A few points. I could do\newcommand{\goesto}{\xrightarrow{n\to\infty}}
and then\SetBreakableRel{\goesto}
which does work. However, I could not understand how to (1) have–
break up as+–
; (2) if I instead defined\newcommand{\gotoarg}[2]{\xrightarrow{#1\to #2}}, how should one send this to
\SetBreakableRel` for arbitrary arguments? Any ideas? Feel free to post everything as an answer, even if it's (almost) just the package itself.