# Tag Info

90

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

49

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

32

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

32

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

25

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

21

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

21

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

21

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

20

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

20

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

19

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

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

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

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

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

17

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

16

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

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

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

15

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

14

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

14

You can use the UTF-8 (hex.) representation: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{hyperref} \begin{document} \href{http://www.something.com/cami\%C3\%B3n/ }{link} \end{document} A site with a table to look up characters: http://www.utf8-chartable.de/ As Heiko Oberdiek mentions in his comment, the browser might help to get ...

14

You can select the font used for URL using \urlstyle. However bold font isn't supported out-of-the-box. You need to patch the required style definitions as shown below. You need to use a font which supports a bold+text-typer style (expect you want to have the URLs in normal Roman style). You need to mark the parts of the URL which is different with a ...

14

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

14

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

14

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

13

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

13

\urlstyle{rm} or \urlstyle{same} (See Roey Angel's comment). The documentation of package url says: Style: 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 which all allow the same linebreaks but different fonts – the first three select a ...

13

Define a special behavior for the slash: \documentclass{article} \usepackage{url} \makeatletter \def\Url@twoslashes{\mathchar`\/\@ifnextchar/{\kern-.2em}{}} \g@addto@macro\UrlSpecials{\do\/{\Url@twoslashes}} \makeatother \begin{document} \urlstyle{sf}\url{http://tex.stackexchange.com/4427} \bigskip \urlstyle{rm}\url{http://tex.stackexchange.com} ...

13

You can use any linking command from hyperref to make links from beamer buttons. For example the following uses \href to link a button to this question: \documentclass{beamer} \begin{document} \begin{frame} \href{http://tex.stackexchange.com/q/20800/5701}{\beamergotobutton{Link}} \end{frame} \end{document}

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