Is there a (simple) way to allow hypheation a-n-y-w-h-e-r-e in any word?
With xelatex
this is easily done.
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{kantlipsum}
\usepackage{multicol}
\begin{document}\thispagestyle{empty}
% "texdoc xetex" for Xe(La)TeX reference manual
\XeTeXinterchartokenstate 1
\XeTeXinterchartoks 0 0 = {\-}
\begin{multicols}{5}
\kant[42]
\end{multicols}
\end{document}
In contrast the output without the use of \XeTeXinterchartoks
:
Perhaps you even don't want the -
's. Then the following can be used:
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{kantlipsum}
\usepackage{multicol}
\begin{document}\thispagestyle{empty}
% "texdoc xetex" for Xe(La)TeX reference manual
{% temporarily enable hyphenation everywhere at no cost
\XeTeXinterchartokenstate 1
\XeTeXinterchartoks 0 0 = {\discretionary{}{}{}}
\exhyphenpenalty 0
\begin{multicols}{5}
\kant[42]
\end{multicols}
}
% back to normal
\end{document}
Or possibly you prefer the -
to stick into the right margins:
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{kantlipsum}
\usepackage{multicol}
\begin{document}\thispagestyle{empty}
% "texdoc xetex" for Xe(La)TeX reference manual
{% temporarily enable breaking everywhere
\XeTeXinterchartokenstate 1
\XeTeXinterchartoks 0 0 = {\discretionary{\rlap{-}}{}{}}
\exhyphenpenalty 0
\hyphenpenalty 0
\begin{multicols}{5}
\kant[42]
\end{multicols}
}
% back to normal
\end{document}
-
Is it possible to do this while still respecting
\lefthyphenmin=2
and\righthyphenmin=3
? That is,an-ywhere
,any-where
,anyw-here
,anywh-ere
would all be allowed, but nota-nywhere
oranywhe-re
oranywher-e
(In particular, words shorter than 5 characters wouldn't be hyphenated)? – ShreevatsaR Jan 25 '17 at 21:12
\lefthyphenmin=1
and\righthyphenmin=1
in the preamble. Be forewarned: The typographic results are likely to be awful. – Mico Oct 27 '15 at 8:45\lefthyphenmin=1
and\righthyphenmin=1
wouldn't be enough, because the hyphenation patterns still wouldn't allow hyphenations likeanyw-here
oranywh-ere
AFAIK (which are consistent even with the TeX defaults of\lefthyphenmin=2
and\righthyphenmin=3
). – ShreevatsaR Jan 25 '17 at 21:14\lefthyphenmin
and\righthyphenmin
; put differently, hyphenation should in fact not literally be alloweda-n-y-w-h-e-r-e
in any word. I must confess that since the use case for the query was never particularly clear to me, I hadn't given it much additional thought. Do you think I should delete my comment? – Mico Jan 26 '17 at 0:16