2

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.

LaRiFaRi
  • 43,807
user87690
  • 1,009
  • 1
    Are http://tex.stackexchange.com/q/61074 and http://tex.stackexchange.com/q/140951 what you want? – LaRiFaRi Jul 03 '14 at 10:25
  • Is there an actual Czech typography rule for that or a convention among books? I'm really suspicious about that. – percusse Jul 03 '14 at 10:26
  • Are you sure it's a real Czech convention and that it wasn't introduced in the mid 20th century under the influence of Russian typography? – egreg Jul 03 '14 at 10:37
  • @percusse You may be right. The document homen.vsb.cz/~wih15/Publikace/RovniceSymboly.doc says it should be repeated, but cites http://csnonlinefirmy.unmz.cz/html_nahledy/01/53829/53829_nahled.htm which says otherwise. Also the repeating has similar logic as repeating of hyphen (for which there is similar problem in TeX). Even if the repetition of operators isn't rule in Czech typography, it should be possible to obtain the behavior using TeX in a systematic way. – user87690 Jul 03 '14 at 10:47
  • @egreg See my comment above. It's a pity you cannot respond to more people at once. – user87690 Jul 03 '14 at 10:48
  • @user87690 I find repeating characters or symbols uselessly confusing. People knows how to read, don't they? – egreg Jul 03 '14 at 10:51
  • @egreg Are you talking also about repeating of hyphen? Because then you may not be able to reconstruct the original word. Did it contain the hyphen or not before the hyphenation? And there may be semantical consequences. Also, the argument “people knows how to read, don't they?” may work for many typographical conventions. – user87690 Jul 03 '14 at 10:56
  • @user87690 Example? ;-) 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
  • 2
    @egreg In Czech the word „modro-zelený“, literally “blue-green” in English, means “having some parts which are blue and some parts which are green” whereas „modrozelený“ means “teal”. I think similar semantic difference is also in German. I agree that it is just detail and many speakers even don't think about it but there may be semantic difference. Of course there wouldn't be problem if hyphen wasn't used for two different purposes. Nevertheless even if I decide not to allow breaking at the hyphen, I have to tell TeX somehow and it seems that TeX is not flexible in specifying these rules. – user87690 Jul 03 '14 at 13:30
  • 1
    @user87690 It seems that you understand Czech. You can see "TeXbook naruby" (http:/petr.olsak.net/tbn.html), page 160, where is the instruction how to do this automatically by setting math-active characters. – wipet Oct 06 '14 at 15:03
  • 1
    @user87690 About repeated hyphen char: There are 5 different solutions of this problem mentioned in "TeXbook naruby" on pages 216--219. – wipet Oct 06 '14 at 16:06

1 Answers1

3

enter image description here

\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=10000 to stop it breaking before the discretionary, will add. – David Carlisle Oct 06 '14 at 15:41
  • Yes, \relpenalty=10000. The same I mentioned in my Czech book. – wipet Oct 06 '14 at 16:03