I saw several questions like this one that request a solution for breaking apart URLs.
I wonder if it is possible to hyphenate the words in a URL as it happens in normal text (i.e., breaking apart words with the help of the hyphenation engine without adding hyphens but a special character instead), see example 1.
- Indicating line feed: To avoid a misleading interpretation of the hyphenated URL, I would like to see a special character such as the carriage return symbol at the hyphenation position.
- Hyphens vs. dashes: I do not want that the hyphenation engine inserts new hyphens which could be misinterpretated as being part of the URL.
If the hyphenation engine breaks the URL at the position of a dash (the dash is part of the URL), the special character must be inserted whatsoever, see example 2.
- If the hyphenation engine breaks the URL at the position of a slash (the slash is part of the URL), the special character must be inserted whatsoever, see example 3.
The desired hyphenation should work in paragraphs, footnotes and in the bibliography.
Examples:
(1) http://www.w3.org/hypertext-transport-protocol/secure/test/appli↩
cationformular.html
(2) http://www.w3.org/hypertext-transport-↩
protocol/secure/test/applicationformular.html
(3) http://www.w3.org/hypertext-transport-protocol/secure/↩
test/applicationformular.html
Related work:
- The solution posted by Peter Grill introduced a new command. I want to use the existing
\url
command. Also, his solution breaks words at every character, while I want to rely on the decision of the hyphenation engine using correct hyphenation.