Tag Info

Hot answers tagged

114

The last time I cited an URL, I used a BibTeX entry of the following form: @misc{bworld, author = {Ingo Lütkebohle}, title = {{BWorld Robot Control Software}}, howpublished = "\url{http://aiweb.techfak.uni-bielefeld.de/content/bworld-robot-control-software/}", year = {2008}, note = "[Online; accessed 19-July-2008]" } If that does not show up, ...


59

(converting a previous comment to an answer) A quick google search (alas, too quick) reveals one solution. Use the [hyphens] option with the url package: \PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} Some recommendations also include inserting \sloppy in case latex is trying too hard to align things.


44

Assuming you are using standard styles, use options doi=false,isbn=false,url=false. The manual describes these as 'style-specific' options, as they do depend on the bibliography style in use.


35

I thought this was a duplicate but I think I was thinking of email addresses. URLs are simple: \usepackage{hyperref} ... \url{http://google.com} Colours can be changed by setting up hyperref as desired: \hypersetup{ colorlinks, linkcolor=red } If you're not using hyperref then load the url package: \usepackage{url} ... \url{http://google.com} but ...


33

The following example uses hyperref (the question has mentioned "hyperlinking") and hooks into \hyper@linkurl to get the URLs. The catched URLs are written into an index file \jobname-url.idx: \urlentry{<hex coded URL>}{<page number>} The URL are hex encoded to avoid trouble with special characters. Package filecontents helps to create a ...


27

You should use the hyperref package (which uses url internally but improves on it). It will not only format the link but also place a real hyperlink into the PDF. With url alone the link is only normal text, but is probably recognized as hyperlink by your PDF viewer, but with the wrong code for ~. LaTeX tends to substitute the code of these special ...


27

I carefully read the documentation of the url package (I'm using PDFLaTeX) and found the following to work quite nice to let LaTeX add line breaks after every normal alphabetic character: \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% ...


27

The package url defines the command \def\UrlOrds{\do\*\do\-\do\~\do\'\do\"\do\-}% which can be added to the default url break characters at which a line can be broken: \documentclass{article} \textwidth=8cm \parindent=0pt \usepackage{url} \makeatletter \g@addto@macro{\UrlBreaks}{\UrlOrds} \makeatother \begin{document} \rule{\linewidth}{1pt} foo bar baz ...


24

Just use \href from hyperref: \href{tel:15555555555}{+1 555 555 5555}


24

One possibility is to extend Herbert's bibmacro to several nested conditions. (The following example contains only placeholder links for the ISBN/ISSN fields because I don't know how this links must be formatted.) With regard to your further issues: I'm not sure if the url field allows to specify several URLs separated by white spaces; if it does, I don't ...


23

The default was chosen by the package author, according to the common way of setting URLs. Using a monospaced font helps distinguishing them, and this is the main reason. However the font can be changed with \urlstyle that accepts one argument among tt rm sf same The default is equivalent to \urlstyle{tt}; with \urlstyle{rm} and \urlstyle{sf} the font ...


22

The following solution does not (anymore) use ImageMagick's convert command as this would always create raster images, which will stand out from the text. Instead, it uses Ghostscript to vectorise the letters so that they appear like normal text but are in fact an uncopyable image. Note that you also have to run pdflatex with the --shell-escape switch ...


22

try it this way (without breakurl \begingroup \raggedright \sloppy \printbibliography \endgroup or without \raggedright:


22

Because "line-breaking in the bibliography is often more difficult than in the body text" (biblatex manual, p. 91), LaTeX typesets the bibliography using the \sloppy macro which relaxes some of TeX's parameters/penalties for line-breaking. However, \sloppy (maybe for some good reason!) does not touch \hbadness which is (among other things) responsible for ...


21

The line number in the error message is the line of the .bbl file that is generated by bibtex, it is not the line of the .bib file. Therefore the question quotes the wrong lines. The line in the error message contains: pp. 225--236, 10.1007/978-0-387-68772-8_18. [Online]. Therefore I think the entry in the .bib file contains doi = ...


21

Depends what BibTeX style you're using. In the ordinary ones I usually use note={\url{http://...}} in biblatex (and natbib too, I think), you can just write url={http://...}


20

\documentclass{article} \usepackage{biblatex} \AtEveryBibitem{% \ifentrytype{manual}{% }{% \clearfield{url}% \clearfield{urldate}% }% } \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @manual{A01, author = {Author, A.}, year = {2001}, title = {Alpha}, url = {tex.stackexchange.com}, } @misc{B02, author = {Buthor, B.}, ...


20

Internally \url uses \UrlFont. You can change it with \urlstyle (see the documentation of url in url.sty) or by redefining \UrlFont: \documentclass{memoir} \usepackage{hyperref,xcolor} \begin{document} Lala \url{www.example.com}. \urlstyle{sf} Lala \url{www.example.com}. \renewcommand\UrlFont{\color{red}\rmfamily\itshape} Lala \url{www.example.com}. ...


19

Add the following load order to your preamble: \usepackage[obeyspaces]{url}% http://ctan.org/pkg/url \usepackage{hyperref}% http://ctan.org/pkg/hyperref See the UK TeX FAQ entry Typesetting URLs. Or, since hyperref loads url by default, perhaps with other package options, use: \PassOptionsToPackage{obeyspaces}{url}% ~ \usepackage[...,obeyspaces]{url} ...


18

The style chicago provides the following entries: address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year You see there is no entry url. To use one you can use the entry ...


18

For URLs in footnotes or inside other macro arguments use \urldef to define it first as a macro: \documentclass{article} \usepackage{url} \urldef\myurl\url{foo%.com} \begin{document} text\footnote{WWW: \myurl} \end{document}


17

Hacking \UrlBreaks is not needed for \url inside the bibliography of biblatex. Package biblatex uses \biburlsetup and has already added lots of characters. The breaking at some character classes is controlled by counters. From the documentation of biblatex, "4.10.3 User-definable Lengths and Counters": biburlnumpenalty: If this counter is set to a value ...


17

Load the url package explicitly with the hyphens option: \usepackage[hyphens]{url} \usepackage{hyperref} By default, the url package does not consider hyphens as legal break points.


16

The original question is about a standard BibTeX style, but inspired by lockstep I've worked out a biblatex solution as a complement to my other answer. The method here is to add the appropriate prefix to the raw DOI, then test this for equivalence to the URL. The prefix needs to be processed with \detokenize as this is how the URL field is formatted. ...


16

tex/xelatex/xetexurl/url.sty The old url.sty had used 8-bit characters that break with XeTeX's expectations of input encoded with UTF-8. Thus the file in tex/xelatex/xetexurl/url.sty is a patched version: % url.sty ver 3.1 15-Mar-2004 Donald Arseneau ... ... % Byte codes >= 0x80 replaced by ^^xx sequences - JK, 2006-04-07 Since version 3.3 ...


16

According to the README, you can switch the style of printing using \urlstyle{tt}, where tt can be any defined style. The pre-defined styles are tt, rm, sf, and same, all of which produce the same linebreaks but use different fonts—the first three select a specific font and the ‘same’ style uses the current text font. You can also ...


16

Moving argument entries may require protection. In this case, use \protect\url{...}: \documentclass{article} \usepackage{url}% http://ctan.org/pkg/url \begin{document} \begin{figure}[ht] \centering\rule{150pt}{100pt} \caption{This is the foobar graphic. Source: \protect\url{http://foo.bar/baz} \label{fig:foobar}} \end{figure} \end{document}


16

Edited 7/17/12 to add a workaround for XeLaTeX's lack of \pdfliteral Edited 8/1/12 to consistently handle XeLaTeX's different location of the origin I've been working on an alternate approach to ocgcolorlinks that doesn't prevent line breaks in the set text. And it also doesn't have to do any trickery to redefine macros, change catcodes, or even typeset ...


16

Answers to the question linked in domwass's comment mention the package url. This package is already loaded by biblatex. It is configured with the command \biburlsetup defined in biblatex.def. URLs are broken at the set of characters specified in \UrlBreaks, \UrlBigBreaks and \UrlSpecials. \UrlBigBreaks will prevent breaks from occurring between repeating ...



Only top voted, non community-wiki answers of a minimum length are eligible