I found \[NonBreakingSpace] but I haven't found a non-breaking hyphen (I want to use them in text mode in notebooks). I must be missing something obvious.
2 Answers
Guess you can do
\[NoBreak]\[Hyphen]\[NoBreak] Those lines are the same except the first one has nobreaks:
You can directly input the unicode character for the non-breaking hyphen in a cell:
\:2011
You can also create an input alias to allow direct input of a unicode non-breaking hyphen.
SetOptions[EvaluationNotebook[],InputAliases ->Append[Options[EvaluationNotebook[], "InputAliases"][[1, 2]], {"nbh" -> "\:2011"}]] Mathematica (13.3.1 MacOS) respects the non-breaking hyphen.
I use InputAliases to access a lot of Unicode characters
{"%" -> "%", "(" -> "⟮", ")" -> "⟯", "{" -> "⟦", "}" -> "⟧","=?" -> "≟", "=def" -> "≝", "_a" -> "ₐ", "_e" -> "ₑ", "_o" -> "ₒ","_x" -> "ₓ", "_n" -> "ₑ", "_+" -> "₊", "_-" -> "₋", "_=" -> "₌","_(" -> "₍", "_)" -> "₎", "_1" -> "₁", "_2" -> "₂", "_3" -> "₃","_4" -> "₄", "_5" -> "₅", "_6" -> "₆", "_7" -> "₇", "_8" -> "₈","_9" -> "₉", "_0" -> "₀", "^+" -> "⁺", "^-" -> "⁻", "^=" -> "⁼","^(" -> "⁽", "^)" -> "⁾", "^1" -> "¹", "^2" -> "²", "^3" -> "³","^4" -> "⁴", "^5" -> "⁵", "^6" -> "⁶", "^7" -> "⁷", "^8" -> "⁸","^9" -> "⁹", "^0" -> "⁰", "^n" -> "ⁿ"} I find them very handy for formatting chemical symbols that I don't what interpreted as mathematical symbols e.g. Na⁺ or H₂O.


\[DiscretionaryHyphen]? $\endgroup$