Hello, thank you for your answers. As Marco stated, the first minimal example you gave didn't hyphenate URLs. I'd like to try a minimal example of your second email, Hans, but I can't figure out how to use those functions? Can you make another minimal example so that I can understand better how this works? Thank you, Stéphanie Le mar. 08 oct. 2013 21:27:22 CEST, Marco Patzer a écrit :
On 2013–10–08 Hans Hagen wrote:
On 10/8/2013 7:35 PM, Marco Patzer wrote:
On 2013–10–08 Hans Hagen wrote:
\hyphenateurl{} works only when setupalign[] is set to hyphenated.
Is there a way to hyphenate only URLs?
You need to provide a few more options to \setupalign:
Why?
\appendtoks\tttf\to\everyhyphenatedurl % maybe we need a proper setup
Isn't that what \url is for? It has a setup command and uses \hyphenatedurl.
sure, but it forces one to use \url which is not always an option (if there are thousands embedded in the text)
Valid point.
I don't see a single hyphenated URL in your result. The OP failing to provide a minimal example, let me provide my interpretation of the problem:
This is more visible
\appendtoks\tttf\to\everyhyphenatedurl \lefthyphenmin=100 \righthyphenmin=100
You URLs still don't hyphenate. Maybe we're misunderstanding each other here.
maybe this is s better definition of nohyphens:
\unexpanded\def\nohyphens {\ifx\dohyphens\relax \unexpanded\edef\dohyphens {\lefthyphenmin\the\lefthyphenmin \righthyphenmin\the\righthyphenmin \relax}% \fi \lefthyphenmin\maxdimen \righthyphenmin\maxdimen}
[…]
needs a bit it tinkering, maybe this is nicer:
\unprotect
\unexpanded\def\nohyphens {\ifx\dohyphens\relax \unexpanded\edef\dohyphens {\hyphenminoffset\the\hyphenminoffset\relax \lang_basics_synchronize_min_max}% \fi \hyphenminoffset\plusthousand \lang_basics_synchronize_min_max}
\protect
as it syncs nicely with languages too (characters carry left and right values so inline changes are possible)
That looks good. The OP should test it on his document.
However, it has the implication that URLs are always hyphenated, as far as I can tell. But it is in fact a practical solution which is certainly what the user wants in almost all of the cases. I never had a document where URLs protruding into the margin was desired.
Marco
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ -- École Supérieure d'Art et Design, www.esad-gv.fr — 25 rue Lesdiguières, 38 000 •Grenoble ; Tél. +33 (0)4 76 86 61 30, Fax +33 (0)4 76 85 28 18, Mél. grenoble@ esad-gv.fr — Place des Beaux-Arts, CS 40 074, 26 903 •Valence cedex 9 ; Tél. +33 (0)4 75 79 24 00, Fax +33 (0)4 75 79 24 40, Mél. valence@ esad-gv.fr •Inge Linder-Gaillard, responsable des études et de la recherche, T^él. +33 (0)4 76 86 61 34, M^ob. +33 (0)6 98 08 43 86, M^él. inge.linder-gaillard@esad-gv.fr