Questions tagged [discretionary]
{discretionary} is for questions about the TeX primitive \discretionary (or variants thereof, such as LaTeX's \- shortcut), used to typeset text conditionally in a line break or otherwise. Questions about {discretionary} may also use the {line-breaking} and/or {hyphenation} tags, if appropriate. Questions about discretionary ligatures should be tagged {ligatures} instead.
36 questions
2 votes
1 answer
93 views
Replacing \kern1em with $\hookrightarrow$ in macro using \discretionary gives ‘Improper discretionary list’ error. How to solve this problem?
I adapted Skillmon’s solution from my previous question for automatically breaking long Python module names at dots inside \texttt{…} in a table. His \newcolumntype uses \newcolumntype\pymod[1] {>...
0 votes
0 answers
25 views
how to make a dollar sign in a .pdf in emtex [duplicate]
For example using emtex to create a .tex file to got to a .pdf where i want a dollar sign to appear in the .pdf file. But since the $ is a special symbol then it seems that it would be impossible to ...
1 vote
0 answers
142 views
\babelhyphenation: why does rasing a penalty lead to a break?
Feeding \documentclass[ngerman]{article} \textwidth=104.2mm \usepackage{fontspec} \usepackage[ngerman]{babel} \babelprovide[hyphenrules=ngerman-x-latest]{ngerman}%%% according to the documentation of ...
2 votes
0 answers
118 views
Guideline on setting hyphenation preferences in German compounds
Let's say we wish to provide different priorities of hyphenation points in long compound words in German. Here is what we tried out for now: \documentclass[ngerman]{article} \usepackage{iftex} \...
0 votes
1 answer
136 views
Trying to assign priorities to different breaking points in a word. Discretionary broken?
I try to assign priorities to different breaking points in a word. To this end, I work around the bug Soft hyphens with priority don't change style with their environment but should do so and ...
2 votes
2 answers
305 views
Soft hyphens with priority don't change style with their environment but should do so
Feeding \documentclass{article} \pagestyle{empty} \usepackage[ngerman]{babel} %%% The following 3 lines may be uncommented; it doesn't really matter. %\hyphenpenalty=49% one less than the default ...
1 vote
1 answer
114 views
Combining internal hyphenation of words with \discretionary
I have been transcribing an old, public-domain novel and am attempting to typeset it using Latex as close as I can to the original formatting of the book. I've taken Memoir template and am modifying ...
5 votes
1 answer
239 views
the discretionary of the word `difficult'
Is the discretionary of the word difficult di\discretionary{f-}{fi}{ffi}cult equivalent to dif\-ficult (or dif\discretionary{-}{}{})?
2 votes
1 answer
70 views
How to find out if a break occurred at a manually inserted \discretionary?
How to find out if a break occurred at a manually inserted \discretionary? I can't do it by assignments within the arguments of \discretionary—assignments are finished before decision about breaking ...
1 vote
0 answers
100 views
LuaTeX, \discretionary, and tcolorbox
The following MWE renders differently in XeLaTeX and LuaLaTeX: XeLaTeX has a line break, but LuaLaTeX doesn't. pdfLaTeX produces the same result as XeLaTeX. \documentclass{article} \usepackage{...
0 votes
1 answer
80 views
Nested \discretionary-ies in (Xe)LaTex resulting an error
I want to set an automatic hyphenation for the Armenian word յանդգնել in XeLaTeX with \discretionary. The problem is, that there are four consonants in a row, and the Armenian language has very ...
1 vote
0 answers
360 views
LuaTeX: UTF-8 character extraction, is one way more accurate and/or preferable than another
While experimenting ways to extract UTF-8 character strings from TeX boxes, I found a post from user micahl-h21 here: UTF-8 text extraction. After looking at the way glyph data is stored in the ...
11 votes
2 answers
2k views
How does `\discretionary` work?
In poking around in someone else's package, I found the \discretionary command being used quite a lot. I wanted to hook into the code being used in one of its arguments, but found that my code got ...
5 votes
2 answers
247 views
Typesetting a comma unless before a line break
I'm trying to create a template (.sty file) that will typeset [value of macro 1], [value of macro 2] if this expression does not exceed the length of the line, and [value of macro 1] [value of macro ...
2 votes
1 answer
329 views
How to change color inside `\discretionary` with luacolor?
I'm working on applying the answer to my question about color and ligatures and have run into a problem when the color change is supposed to happen inside a discretionary. Boiled down to a MWE and it ...