Text FormattingDisplay hyphenation points

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Display hyphenation points

Post by Laurentius »

Is there a macro that takes a word as its argument and returns it with hyphens at every possible break point?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Display hyphenation points

Post by cgnieder »

Do you want them printed in the text or do you want the information for debugging? If it's the latter:

Code: Select all

\documentclass{article}
\begin{document}

\showhyphens{hyphenation}

\end{document}
The log says:

Code: Select all

[] \OT1/cmr/m/n/10 hy-phen-ation
Regards
site moderator & package author
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Display hyphenation points

Post by Laurentius »

Thanks! Is there no way of doing it from the command line? I mean: run xelatex and type something like \showhyphensnow{analysis} and have returned ana-ly-sis. I suppose one could write a script to do it.
Last edited by cgnieder on Sun Jul 12, 2015 4:05 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Display hyphenation points

Post by cgnieder »

Sure: you can use (Xe)TeX's interactive mode:
  1. type xetex and hit enter in the command line. You will get a ** prompt.
  2. type \relax and hit enter. You will get a * prompt.
  3. type \showhyphens{analysis} and hit enter. Watch TeX's response:

    Code: Select all

    [] \tenrm anal-y-sis
  4. type \bye and hit enter to leave.
Regards
site moderator & package author
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Re: Display hyphenation points

Post by Laurentius »

That simple; fantastic. Funny hyphenation of analysis though. Thanks!
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Display hyphenation points

Post by cgnieder »

Laurentius wrote:Funny hyphenation of analysis though.
Depends on the definition of funny, I guess: http://www.merriam-webster.com/dictionary/analysis :)

Regards
site moderator & package author
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Re: Display hyphenation points

Post by Laurentius »

I now see that this doesn't work after loading polyglossia …
Post Reply