Text Formatting ⇒ Inline underlined breaking URL
Inline underlined breaking URL
I've been searching everywhere and I can't find anything that does all 3.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Inline underlined breaking URL
I'll link what I've found out. There's the package hyperref which seems to be to make clickable URLs in Latex documents. It doesn't appear to do underlines (from what I can tell), but puts annoying boxes round them. The package url does wrapping URLs onto a new line but doesn't like being used in the middle of a line of text. However I found a workaround (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=setURL):
Code: Select all
\urldef\faqhome\url{http://www.tex.ac.uk/faq}
\paragraph{This is some text with an address \faqhome but no underline.}
The only thing I've been able to find on setting the style of a URL us here (http://www.kronto.org/thesis/tips/url-formatting.html) but it doesn't do underlines (and I have no idea what the code means). If someone could tell me how to do this for setting underlined text rather than changing the font:
Code: Select all
\usepackage{url}
%% Define a new 'leo' style for the package that will use a smaller font.
\makeatletter
\def\url@leostyle{%
\@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\makeatother
%% Now actually use the newly defined style.
\urlstyle{leo}
-
- Posts: 162
- Joined: Wed Jun 17, 2009 10:18 pm
Inline underlined breaking URL
The boxes around links are the default behaviour, but that can easily be changed, by adding eithermikey wrote:There's the package hyperref which seems to be to make clickable URLs in Latex documents. It doesn't appear to do underlines (from what I can tell), but puts annoying boxes round them.
Code: Select all
\hypersetup{pdfborder=false}
Code: Select all
\hypersetup{colorlinks=true}
With the latter option, you can specify the colour the various types of links will have -- see the hyperref manual.
By the way, why does the URLs need to be underlined?
Inline underlined breaking URL
Thanks for the reply. I'm experimenting with hyperref as a way to get it working but I'm not getting far with it either. The reason it has to be underlined is it's part of my dissertation and my university has an extremely stupid and rigidly enforced custom referencing system that demands underlined URLs.
I can get a line under the URL with hyperref using:
Code: Select all
\usepackage[pdftex, pdfborderstyle={/S/U/W 1}]{hyperref}
So still needing help.
-
- Posts: 162
- Joined: Wed Jun 17, 2009 10:18 pm
Inline underlined breaking URL
Code: Select all
\usepackage[pdftex,pdfborderstyle={/S/U/W 1},urlbordercolor={0 0 0}]{hyperref}
Code: Select all
This is some text with an address \url{http://www.tug.org/applications/hype} \url{rref/manual.html} and an underline.
Inline underlined breaking URL
The only kludge I can suggest in the meantime is to manually break the line yourself and use \href rather than \url, e.g.:
Code: Select all
\href{http://the.url/somewhere}{\underline{\texttt{http://the.url}}}\linebreak\href{http://the.url/somewhere}{\underline{\texttt{/somewhere}}}