[latexrefman-discuss] Discretionary multiplication sign

Johannes Böttcher johannesbottcher at domain.hid
Wed Jan 27 12:22:48 CET 2016


Hi

`latex.ltx' shows us the definition:
\def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}}

Looking up what discretionary means in `texbook.tex`:

\danger A discretionary break consists of three sequences of characters
called the {\sl pre-break}, {\sl post-break}, and {\sl no-break\/}
texts. The idea is that if a line break occurs here, the ^{pre-break text}
will appear at the end of the current line and the ^{post-break text} will
occur at the beginning of the next line; but if no break occurs, the
^{no-break text} will appear in the current line. Users can specify
^^|\discretionary|
discretionary breaks in complete generality by writing
\begindisplay
|\discretionary{|\<pre-break text>|}{|\<post-break text>|}{|\<no-break 
text>|}|
\enddisplay
where the three texts consist entirely of characters, boxes, and kerns.
For example, \TeX\ can hyphenate the word
`difficult' between the f's, even though this requires breaking the
`ffi' ligature into `f-' followed by an `fi' ligature, if the horizontal
list contains
\begintt
di\discretionary{f-}{fi}{ffi}cult.
\endtt
Fortunately you need not type such a mess yourself; \TeX's hyphenation 
algorithm
works behind the scenes, taking ^{ligatures} apart and putting them
into discretionary breaks when necessary.


\danger A ``^{discretionary multiplication sign}'' is allowed in formulas:
If you type `|$(x+y)\*(x-y)$|', \TeX\ will treat the ^|\*| something like
the way it treats \hbox{|\-|}; namely, a line break will be allowed at
that place, with the hyphenation penalty. However, instead of inserting a
hyphen, \TeX\ will insert a $\times$ sign in text size.



\documentclass{article}
\begin{document}
\( A \* B \)
\begin{tabular}{|p{1em}|}
\( A \* B \)
\end{tabular}
\end{document}


Wondering about the usefulness, David Carlisle gave another example:
 > pretty sure I have never used it, but basically if you are doing 
something like group theory with long strings of concatenated symbols 
for implied multiplication you (might, perhaps) want to allow line 
breaking but make the multiplication explicit in that case

Johannes


On 01/27/2016 10:34 AM, Vincent Belaïche wrote:
> Hello,
>
> In node « Math miscellany », it is mentioned that « \* » produces a
> « discretionary » multiplication symbol. I tried the following example
> to see what it looks like (between B and E at the very end of formula):
>
> --8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
> \documentclass{article}
>
> \begin{document}
> \[A \times B\times B\times B\times B\times B\times B\times B\times
> B\times B\times B\times B\times B\times B\times B\times B\times B\times
> B\times B\times B\times B\times B\times B\times B\times B\times B\times
> B\times B \* E \]
> \end{document}
> --8<----8<----8<----8<----8<--  end  -->8---->8---->8---->8---->8----
>
> but:
>
> - despite the overfull hbox there is not any line break
>
> - there is not any explicit multiplication symbol as such between B and
>    E.
>
> - not clear what « at which » means, is that immediately _before_ or
>    immediately _after_ the symbol that a line break is allowed
>
> Ok « discretionary » means that LaTeX is free to decide about something
> --- but it is not clear either exactly what is in the discretion of
> LaTeX, is that to produce or not an explicit symbol, or is that to make
> or not a line break. As far as I can understand, « discretionary symbol
> » would mean that the symbol is either produced or not...
>
> I made this other experiment:
>
> --8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
> \documentclass{article}
>
> \begin{document}
> \noindent\(A \times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B \* E \)
>
> \noindent\(A \times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B\times B \* E \)
> \end{document}
> --8<----8<----8<----8<----8<--  end  -->8---->8---->8---->8---->8----
>
> Here I am using in-line math, not display math, and between the first
> and the second paragraph there is only one more B factor. There is a
> line break only in the 2nd paragraph, but not between B and E, and still
> not any explicit symbol.
>
> Any clarification welcome --- impossible to translate something that you
> can't understand in the first place :-/
>
> VBR,
> 	Vincent
>
>




More information about the latexrefman mailing list