Allow line breaks in URLs in PDFs

This commit is contained in:
RunasSudo 2021-02-11 20:48:16 +11:00
parent 3c8da64ecd
commit b54fa9e1f0
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 12 additions and 4 deletions

View File

@ -22,7 +22,7 @@ copyright = '2021 Lee Yingtong Li'
author = 'Lee Yingtong Li'
# The full version, including alpha/beta/rc tags
release = '0.2'
release = '0.2.1-dev'
version = release

View File

@ -1,3 +1,5 @@
\makeatletter
% Typographic improvements
\usepackage{microtype}
@ -9,6 +11,14 @@
\def\sphinxstyleindexentry#1{#1} % no monospaced index entries
\def\sphinxstyleindexextra#1{ (#1)} % no italics
% Allow line breaks in URLs
\usepackage{seqsplit}
\protected\def\sphinxurl#1{{%
\sphinxunactivateextrasandspace %
\endlinechar\m@ne\everyeof{}%
\scantokens{\href{#1}{\seqsplit{#1}}}%
}}
% Fonts
\setmainfont{EB Garamond}
%\setsansfont{IBM Plex Sans}[BoldFont={* Medium},BoldItalicFont={* Medium Italic}]
@ -32,14 +42,12 @@
\setlength{\footnotemargin}{0.4cm}
% Header/footer style
\makeatletter
\fancypagestyle{normal}{
\fancyhead[RO,LE]{}
\fancyfoot[RO]{{\footnotesize\py@HeaderFamily\nouppercase{\leftmark} | \thepage}}
\fancyfoot[LE]{{\footnotesize\py@HeaderFamily\thepage}}
%\renewcommand{\headrulewidth}{0.4pt}
}
\makeatother
% Back of title page content
\newcommand{\sphinxbackoftitlepage}{
@ -75,7 +83,6 @@
% Override Sphinx title page
\usepackage[iso]{isodate}
\makeatletter
\renewcommand{\sphinxmaketitle}{%
\let\sphinxrestorepageanchorsetting\relax
\ifHy@pageanchor\def\sphinxrestorepageanchorsetting{\Hy@pageanchortrue}\fi
@ -117,4 +124,5 @@
\if@openright\cleardoublepage\else\clearpage\fi
\sphinxrestorepageanchorsetting
}
\makeatother