Under default settings a line can be broken in math mode after binary operator with \binoppenalty or after relation with \relpenalty. I'd like to preserve this behavior but alter the result so the operator or relation is repeated on the next line as should be in Czech typography. Just putting \discretionary{\subseteq}{\subseteq}{\subseteq} instead of \subseteq raises an error.
Asked
Active
Viewed 281 times
2
1 Answers
3

\documentclass{article}
\setlength\textwidth{4cm}
%\newcommand\dup[1]{\;{#1}\discretionary{}{\hbox{$#1$}}{}\;}
\relpenalty=10000
\newcommand\dup[1]{#1\discretionary{}{\hbox{$#1$}}{}}% improved version from wipet
\begin{document}
\noindent X\dotfill X
$
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A \dup\subset
A
$
\end{document}
David Carlisle
- 757,742
-
The definition
\def\dup#1{#1\discretionary{}{\hbox{$#1$}}{}}is sufficient. The spacing around math-rel is inserted after other material (i.e. after\discretionary), so space after relation is properly inserted in broken line too. – wipet Oct 06 '14 at 14:58 -
@wipet but then I think it needs
\relpenalty=10000to stop it breaking before the discretionary, will add. – David Carlisle Oct 06 '14 at 15:41 -
;-)I consider starting a line with a hyphen as a pedantic oddity. If there are semantic consequences, don't allow breaking at the hyphen. – egreg Jul 03 '14 at 12:07