| 1 |
%% $Id: xurl.tex 400 2022-01-09 13:12:20Z herbert $ |
| 2 |
% |
| 3 |
\listfiles\setcounter{errorcontextlines}{100} |
| 4 |
\RequirePackage{filecontents} |
| 5 |
\begin{filecontents*}{\jobname.bib} |
| 6 |
@online{asdf, |
| 7 |
sortname={BSI},label={BSI}, |
| 8 |
organization={BSI (Bundesamt für Sicherheit in der Informationstechnik)}, |
| 9 |
title={Angaben des BSI für die Algorithmenkataloge der Vorjahre, Empfehlungen zur Wahl der Schlüssellängen}, |
| 10 |
date={2016}, |
| 11 |
url={https://www.bundesnetzagentur.de/DE/Service-Funktionen/ElektronischeVertrauensdienste/HinweiseEmpfehlungen/Empfehlungen/Empfehlungen_node.html}, |
| 12 |
} |
| 13 |
\end{filecontents*} |
| 14 |
\documentclass[paper=a4,fontsize=11pt,DIV=14,parskip=half-, |
| 15 |
captions=tableabove,twoside=on]{scrartcl} |
| 16 |
\usepackage{fontspec} |
| 17 |
%\usepackage[%usefilenames, |
| 18 |
% TT={Scale=0.88,FakeStretch=0.9}, |
| 19 |
% SS={Scale=0.9}, |
| 20 |
% RM={Scale=0.9}, |
| 21 |
% DefaultFeatures={Ligatures=TeX}]{lucida-otf} % support opentype math fonts |
| 22 |
\setmainfont{AccanthisADFStdNo3}[ |
| 23 |
UprightFont =*-Regular, |
| 24 |
BoldFont =*-Bold, |
| 25 |
ItalicFont =*-Italic, |
| 26 |
BoldItalicFont=*-BoldItalic, |
| 27 |
RawFeature = -rlig, |
| 28 |
] |
| 29 |
\setsansfont{GilliusADF}[ |
| 30 |
UprightFont =*-Regular, |
| 31 |
BoldFont =*-Bold, |
| 32 |
ItalicFont =*-Italic, |
| 33 |
BoldItalicFont=*-BoldItalic, |
| 34 |
RawFeature = -rlig, |
| 35 |
] |
| 36 |
\setmonofont{Anonymous Pro}[Scale=MatchLowercase,FakeStretch=0.9] |
| 37 |
|
| 38 |
\usepackage[english]{babel} |
| 39 |
\usepackage{scrlayer-scrpage} |
| 40 |
\automark[section]{section} |
| 41 |
\automark*[subsection]{} |
| 42 |
\pagestyle{scrheadings} |
| 43 |
|
| 44 |
\usepackage{biblatex} |
| 45 |
\addbibresource{\jobname.bib} |
| 46 |
|
| 47 |
%\usepackage{selnolig} |
| 48 |
%\nolig{oe}{o|e} |
| 49 |
|
| 50 |
\usepackage{xurl} |
| 51 |
\title{Package \texttt{xurl}} |
| 52 |
\author{Herbert Voß\thanks{\texttt{[email protected]}\newline Thanks to Robert Alessi; Ulrike Fischer}} |
| 53 |
\begin{document} |
| 54 |
\maketitle |
| 55 |
|
| 56 |
\section{How it works} |
| 57 |
Package xurl loads package url by default and defines |
| 58 |
possible url breaks for all alphanumerical characters |
| 59 |
and \verb|= / . : * - ~ ' "| |
| 60 |
|
| 61 |
All arguments which are valid for url can be used. |
| 62 |
It will be passed to package url. xurl itself has no |
| 63 |
special optional argument. For more information read |
| 64 |
the documentation of package url. |
| 65 |
|
| 66 |
\section{With the original setting from package url} |
| 67 |
|
| 68 |
The original behaviour of package \texttt{url} can be obtained |
| 69 |
by using the macro \texttt{\textbackslash useOriginalUrlSetting} |
| 70 |
which should be used inside a group: |
| 71 |
|
| 72 |
\begingroup |
| 73 |
\useOriginalUrlSetting |
| 74 |
\noindent |
| 75 |
\frame{\begin{minipage}{0.5\linewidth} |
| 76 |
\noindent |
| 77 |
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} |
| 78 |
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419} |
| 79 |
\end{minipage}} |
| 80 |
|
| 81 |
\noindent |
| 82 |
\frame{\begin{minipage}{0.75\linewidth} |
| 83 |
\noindent |
| 84 |
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} |
| 85 |
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419} |
| 86 |
\end{minipage}} |
| 87 |
|
| 88 |
\noindent |
| 89 |
\frame{\begin{minipage}{\dimexpr\linewidth-2\fboxrule} |
| 90 |
\noindent |
| 91 |
some text \url{iszv://dsf.tqsdatmdtdls.ctm/cudfsdvqfqll-ocd/bdcbcfqlf-lcclldh/cbsntwgqke-esbptb-vvylhy/zkhqnqidf-obedbacpf-lzlal-pxaccqa-gwki.lfof/} |
| 92 |
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} |
| 93 |
\end{minipage}} |
| 94 |
\endgroup |
| 95 |
|
| 96 |
|
| 97 |
\section{With the setting from package xurl} |
| 98 |
|
| 99 |
|
| 100 |
\noindent |
| 101 |
\frame{\begin{minipage}{0.5\linewidth} |
| 102 |
\noindent |
| 103 |
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} |
| 104 |
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419} |
| 105 |
\end{minipage}} |
| 106 |
|
| 107 |
\noindent |
| 108 |
\frame{\begin{minipage}{0.75\linewidth} |
| 109 |
\noindent |
| 110 |
some text \url{very-long-url-very-long-url-very-long-url-very-long-url-very-long-url-} |
| 111 |
and another url: \url{https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419?noredirect=1#comment1021887_10419} |
| 112 |
\end{minipage}} |
| 113 |
|
| 114 |
\noindent |
| 115 |
\frame{\begin{minipage}{\dimexpr\linewidth-2\fboxrule} |
| 116 |
\noindent |
| 117 |
some text \url{iszv://dsf.tqsdatmdtdls.ctm/cudfsdvqfqll-ocd/bdcbcfqlf-lcclldh/cbsntwgqke-esbptb-vvylhy/zkhqnqidf-obedbacpf-lzlal-pxaccqa-gwki.lfof/} |
| 118 |
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} |
| 119 |
\end{minipage}} |
| 120 |
|
| 121 |
\section{Using \texttt{biblatex}} |
| 122 |
Package \texttt{biblatex} has it's own url handling. If you want the the same behaviour as \texttt{xurl} has, you have to |
| 123 |
set |
| 124 |
|
| 125 |
\begin{verbatim} |
| 126 |
\setcounter{biburllcpenalty}{100} |
| 127 |
\setcounter{biburlucpenalty}{200} |
| 128 |
\setcounter{biburlnumpenalty}{100} |
| 129 |
\end{verbatim} |
| 130 |
|
| 131 |
However, if you load \texttt{xurl} \emph{after} \texttt{biblatex} then it is done |
| 132 |
by default. Compare the following bibliographies. IF you do not want that \texttt{xurl} |
| 133 |
should set these counters, then load the package \emph{before} \texttt{biblatex} or |
| 134 |
use the optional argument \texttt{nobiblatex}: |
| 135 |
|
| 136 |
\begin{verbatim} |
| 137 |
\usepackage[...]{biblatex} |
| 138 |
\usepackage[nobiblatex]{xurl} |
| 139 |
\end{verbatim} |
| 140 |
|
| 141 |
\nocite{*} |
| 142 |
|
| 143 |
|
| 144 |
\printbibliography[title={With urlbreaks}] |
| 145 |
|
| 146 |
\setcounter{biburllcpenalty}{0} |
| 147 |
\setcounter{biburlucpenalty}{0} |
| 148 |
\setcounter{biburlnumpenalty}{0} |
| 149 |
|
| 150 |
\printbibliography[title={xurl with option nobiblatex}] |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
\end{document} |
| 157 |
|
| 158 |
|
| 159 |
|