i use the \path{} command to print out a path to a directory in my *.tex File. I searched a lot around the internet to solve the problem to automatically linebreak the path-url.
I found some hints and maybe solutions, like \usepackage[hyphens]{url}
, \setlength{\emergencystretch}{2pt}
or
%\def\UrlBreaks{
%\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
%\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
%\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
%\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
%\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
%\do\Z\do\_}%
But non of them the solution i want. it work's with this solutions but sometimes i get to much space between the words before and after the path-url of the next line in text will not correctly break. The text gos over my defined textwidth. So i want a solution where the path-url breaks the word correctly to my selected babel language; for my work in german.
Here two example of some of my path-urls:
- HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\SystemCertificates\AuthRoot
- \%APPDATA\%\Microsoft\Crypto
Is there such a way? Or how can i get a superb, clean and good working url line break with using the path{} command? thanks!
/
and.
etc, for URLs, it could be configured to split on\
as in your example, but it doesn't normally break words, if you add the entire alphabet as in your code block then it will break anywhere without using any word patterns. Spacing and over/under full lines depend on paragraph settings and code you have not shown, whether the paragraph is set\raggedright
or\sloppy
fro example.