Tag Info

Hot answers tagged

98

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, ...


57

(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.


38

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 ...


26

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% ...


23

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 ...


23

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 ...


23

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


22

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

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 ...


21

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


21

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 ...


20

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 ...


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.}, ...


19

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 = ...


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} ...


19

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://...}


18

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}. ...


17

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 ...


17

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}


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 ...


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

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

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

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 ...


15

Atention: the following code works only for simple URLs, that is, URLs that do not contain special characters, like %. For a complete solution, please refer to Heiko's answer. As Nicola mentioned in the comments, redefining \url might be an interesting idea, but some characters in the URL might cause problems. Sadly my TeX-fu isn't good enough to ...


15

It's in general a bad idea to footnote section titles. The footnote can go, if really necessary, to the first paragraph. In case you can't get without it, you have to use the optional argument: \section[Section title]{Section title\footnote{A footnote}} otherwise you'll footnote also the table of contents and the headers, which is wrong (and with a \url ...


15

Another approach is to define a new format that adds links. This can be used in any bibliography macro that applies the title format. In standard styles there are only two of these macros: title and periodical. You can revert to the original style with \DeclareFieldAlias{<new format name>}{default}. The url field is intended to hold only one URL, so ...



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