summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xurl/doc/xurl.tex
blob: 856b1f4f14897581178cb58c6503826f9975fe1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
%% $Id: xurl.tex 876 2018-12-23 10:26:11Z herbert $
%
\listfiles\setcounter{errorcontextlines}{100}
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{asdf,
  sortname={BSI},label={BSI},
  organization={BSI (Bundesamt für Sicherheit in der Informationstechnik)},
  title={Angaben des BSI für die Algorithmenkataloge der Vorjahre, Empfehlungen zur Wahl der Schlüssellängen},
  date={2016},
  url={https://www.bundesnetzagentur.de/DE/Service-Funktionen/ElektronischeVertrauensdienste/HinweiseEmpfehlungen/Empfehlungen/Empfehlungen_node.html},
}
\end{filecontents*}
\documentclass[paper=a4,fontsize=11pt,DIV=14,parskip=half-,
               captions=tableabove,twoside=on]{scrartcl}
\usepackage{fontspec}
%\usepackage[%usefilenames,
%            TT={Scale=0.88,FakeStretch=0.9},
%            SS={Scale=0.9},
%            RM={Scale=0.9},
%            DefaultFeatures={Ligatures=TeX}]{lucida-otf}  % support opentype math fonts
\setmainfont{AccanthisADFStdNo3}[
  UprightFont   =*-Regular,
  BoldFont      =*-Bold,
  ItalicFont    =*-Italic,
  BoldItalicFont=*-BoldItalic,
  RawFeature    = -rlig,
]
\setsansfont{GilliusADF}[
  UprightFont   =*-Regular,
  BoldFont      =*-Bold,
  ItalicFont    =*-Italic,
  BoldItalicFont=*-BoldItalic,
  RawFeature    = -rlig,
]
\setmonofont{Anonymous Pro}[Scale=MatchLowercase,FakeStretch=0.9]

\usepackage[english]{babel}
\usepackage{scrlayer-scrpage}
\automark[section]{section}
\automark*[subsection]{}
\pagestyle{scrheadings}

\usepackage{biblatex}
\addbibresource{\jobname.bib}

%\usepackage{selnolig}
%\nolig{oe}{o|e}

\usepackage{xurl}
\title{Package \texttt{xurl}}
\author{Herbert Voß\thanks{herbert@dante.de}}
\begin{document}
\maketitle

\section{How it works}
Package xurl loads package url by default and defines
possible url breaks for all alphanumerical characters
and \verb|= / . : * - ~ ' "| 

All arguments which are valid for url can be used.
It will be passed to package url. xurl itself has no 
special optional argument. For more information read
the documentation of package url.


\noindent
\frame{\begin{minipage}{0.5\linewidth}
\noindent
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} 
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419}
\end{minipage}}

\noindent
\frame{\begin{minipage}{0.75\linewidth}
\noindent
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} 
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419}
\end{minipage}}



\noindent
\frame{\begin{minipage}{\dimexpr\linewidth-2\fboxrule}
\noindent
some text \url{iszv://dsf.tqsdatmdtdls.ctm/cudfsdvqfqll-ocd/bdcbcfqlf-lcclldh/cbsntwgqke-esbptb-vvylhy/zkhqnqidf-obedbacpf-lzlal-pxaccqa-gwki.lfof/}
and another url: \url{koff://osb.ccdngagkkg.raa/qrkxzvi/dxfsiaa/xidf-lata-dgdqmhp-uoxdl-vst-vcsbhl-aisdsasih-skl-aezb-fhixvyy-qqlachd-achhfc-koe-xgfqp-iyplcu-1.696884}
\end{minipage}}

\section{Using \texttt{biblatex}}
Package \texttt{biblatex} has it's own url handling. If you want the the same behaviour as \texttt{xurl} has, you have to
set 

\begin{verbatim}
\setcounter{biburllcpenalty}{100}
\setcounter{biburlucpenalty}{200}
\setcounter{biburlnumpenalty}{100}
\end{verbatim}

However, if you load \texttt{xurl} \emph{after} \texttt{biblatex} then it is done
by default. Compare the following bibliographies. IF you do not want that \texttt{xurl}
should set these counters, then load the package \emph{before} \texttt{biblatex} or
use the optional argument \texttt{nobiblatex}:

\begin{verbatim}
\usepackage[...]{biblatex}
\usepackage[nobiblatex]{xurl}
\end{verbatim}

\nocite{*}

\printbibliography[title={With urlbreaks}]

\setcounter{biburllcpenalty}{0}
\setcounter{biburlucpenalty}{0}
\setcounter{biburlnumpenalty}{0}

\printbibliography[title={xurl with option nobiblatex}]

\end{document}