Skip to content

Commit

Permalink
Formatting fixes for URLs breaking over lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesray1 authored Jan 19, 2018
1 parent e491a3d commit e846114
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Paper.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,31 @@
\usepackage{afterpage}
\usepackage{tikz}


%Put after \PassOptionsToPackage PR
% info on the above command: <https://tex.stackexchange.com/posts/10419/revisions>. Note that the three preceding lines, as well as \PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} did not fix the error where if a URL breaks over a page, it shows a snippet in the header as shown here: <https://i.stack.imgur.com/tYUe2.png>.
\makeatletter
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\makeatother

%The following command did fix this error, however only because it happened to compact the text, preventing a URL from breaking over a page. If you force a URL to break over a page, the error still occurs.
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks% save the current one
\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\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}
% More info: <https://tex.stackexchange.com/questions/392832/how-to-ensure-that-a-url-break-over-a-page-doesnt-add-a-tiny-url-box-in-the-hea>.
% These don't appear to make a difference with the preceding use of the \hypens package and \expandafter:
%\sloppy
%\setlength{\emergencystretch}{2pt}
% https://tex.stackexchange.com/a/59131/143781
% <https://tex.stackexchange.com/questions/241343/what-is-the-meaning-of-fussy-sloppy-emergencystretch-tolerance-hbadness>

% You can use tables instead of this package, but it might be worthwhile considering.
%\usepackage{glossaries}

\input{Version.tex}

\newcommand{\hcancel}[1]{%
Expand Down

0 comments on commit e846114

Please sign in to comment.