描述中沒有 URL 換行符

描述中沒有 URL 換行符

有多種方法可以在 URL 中進行換行。但是有人知道如何破解這個範例中的 URL 嗎?謝謝,哈拉爾德

\documentclass[
    10pt,
    twoside,
    toc=listofnumbered,
    listof=flat,
    headinclude,
    footinclude,
    index=numbered
]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % HJELE: für Silbentrennung von Wörtern mit Umlauten via \hyphenation
\usepackage[ngerman]{babel}
\usepackage[hyphens]{url}
\usepackage{breakurl}
\usepackage[colorlinks,urlcolor=black,linkcolor=black,filecolor=black,citecolor=black]{hyperref}
\hypersetup{breaklinks=true}
\begin{document}
\begin{description}
\begin{sloppypar}
\item[\normalfont{Thaney, Kaitlin (2009):}] Laying out the Principles of Open Science. Vortrag am {\glqq}Open Science workshop :: PSB 2009{\grqq}, 5.1.2009, Big Island of Hawaii.\\
Online unter:\\
\url{https://de.slideshare.net/kaythaney/laying-out-the-principles-of-open-science-presentation}
\item[\url{https://www.springer.com/de/autoren-herausgeber/deutsche-publikationen/buchautoren/buchautoren-manuskript-richtlinien}:] Richtlinien zum Publizieren für Autoren und Herausgeber des Springer Verlags.
\end{sloppypar}
\end{description}
\end{document}

URL 中的換行符

答案1

不要載入breakurl包,替換\usepackage[hyphens]{url}\usepackage{xurl},並且不要在列表項的參數中包含 URL 字串description

您也可以替換urlcolor=black, linkcolor=black, filecolor=black, citecolor=blackallcolors=black.

在此輸入影像描述

\documentclass[
    10pt,
    twoside,
    toc=listofnumbered,
    listof=flat,
    headinclude,
    footinclude,
    index=numbered
]{scrbook}
%%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{xurl}
%%\usepackage[hyphens]{url}
%%\usepackage{breakurl}
\usepackage[colorlinks,allcolors=black]{hyperref}
%\hypersetup{breaklinks=true}

\begin{document}
\begin{description}

\item[]Thaney, Kaitlin (2009): Laying out the Principles of Open Science. 
   Vortrag am {\glqq}Open Science workshop :: PSB 2009{\grqq}, 5.1.2009, 
   Big Island of Hawaii.

Online unter:
\url{https://de.slideshare.net/kaythaney/laying-out-the-principles-of-open-science-presentation}

\item[]\url{https://www.springer.com/de/autoren-herausgeber/deutsche-publikationen/buchautoren/buchautoren-manuskript-richtlinien}: Richtlinien zum Publizieren für Autoren und Herausgeber des Springer Verlags.

\end{description}
\end{document}

相關內容