# Tag Info

## Hot answers tagged urls

12

The most straightforward and flexible approach to typesetting URL strings is to use the \url macro that's provided by the url and hyperref packages. I use the word "flexible" in part because \url{...} can usually find good line breaks -- an important consideration when dealing with long URL strings (which occur quite frequently, right?). Outside of ...

11

There is a command \path{/usr/share/myspell/dicts/hyph_pl_PL.dic} you can use to write paths like that. That command is defined in the package url so you have to use \usepackage{url} in the preamble of the document.

9

A macro definition is not executed at the point of definition, you can go \newcommand\foo{\any old \rubbish } and as long as {} match up \foo is defined. You may get an error later if you try to use \foo, but you get no error at this point, and if \any and \rubbish are defined by the time you use \foo there is no error. Conversely a box is typeset as it ...

8

TeX assigns category code when an argument is grabbed and tokenized. As a result, inside your definition of \url, & has catcode 'tab alignment' (assuming normal rules apply). You can only \def an active char, so this step fails as you've observed. What you need to do is make sure that the definition of \url contains an active &: \begingroup ...

7

It is much better not to change catcodes mid document but instead change the mathcode (as then it works as much as possibe even in macro arguments) this is what url.sty does url.sty uses hardly any latex so works with plain tex with a bit of encouragement, or you could simply edit the file to remove the latex bits rather than defining stubs as here ...

7

Use eplain: \input eplain \beginpackages \usepackage{url} \endpackages \rightskip=10em minus 8em % avoid overfull box \url{http://tex.stackexchange.com/some/long/path/and?someBizarreLong=param&andYetAnotherSuchBizarreLong=param} \bye Your (simplistic) definition can be corrected with \begingroup \catcode`\&=\active % we want an active & ...

7

\documentclass{article} \usepackage{url} \begin{document} \edef\URL{http://example.org/abc?param=\string}} \expandafter\url\expandafter{\URL} \end{document}

7

You should change the anything to do with the bibliography immediately before the bibliography, otherwise it would affect everything following the preamble as in your case. \documentclass[11pt,a4paper]{moderncv} % moderncv themes \moderncvtheme[blue]{classic} % character encoding \usepackage[utf8]{inputenc} \usepackage{bbding} % ...

7

It's your PDF viewer's fault: Mac OS X Preview (at least v7.0) recognises URLs and makes them clickable, whether they be typeset with a special package (hyperref, url) or not. To convince yourself, try compiling the following example and open the output in Preview; the URL will be clickable. So there's really nothing you can do about it on the author's ...

7

\documentclass{article} \usepackage{hyperref} \newcommand\rurl[1]{\xurl#1\empty\empty\empty\empty\empty\xurl} \def\xurl#1#2#3#4#5#6\xurl{% \def\tmp{#1#2#3#4#5}% \href{\ifx\tmp\xurlhttp \else http://\fi#1#2#3#4#5#6}% {\nolinkurl{#1#2#3#4#5#6}}% } \def\xurlhttp{http:} \begin{document} \rurl{ipython.org}\\ \rurl{http://ipython.org} \end{document}

6

csplain is (by default) sensitive to non UTF-8 codes in input. It uses encTeX for this in pdftex engine. The url.sty manipulates with non UTF-8 codes, encTeX is sensive to this more than we need and this yields this error. You can write \input utf8off at beginning of the document. After this, the pdftex treats its input normally as 8bit. If you are using ...

6

EDIT: Added Title clickable (1. just the title cickable and 2. the whole reference clickable) 1. Just the Title reference clickable You can redefine the title macro and add the \href to the title using the DeclareFieldFormat. I edited the default definitions in the biblatex.def file. \DeclareFieldFormat{title}{\myhref{\mkbibemph{#1}}} \DeclareFieldFormat ...

5

url changes the font but you can set it to default to serif to match \href: \documentclass{book} \usepackage{xcolor} \usepackage{hyperref} \hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue} \urlstyle{rm} \begin{document} url: \url{www.yahoo.com} href: \href{http://www.yahoo.com}{www.yahoo.com} \end{document} Note that \urlstyle{} is from url ...

5

The \url command can be redefined the same way as hyperref. The following example first defines url command \guilurl, which uses single guillemots as angle brackets. Then \url is redefined using \guilurl: \documentclass{article} \usepackage[T1]{fontenc}% \guilsinglleft and \guilsinglright \usepackage{lmodern} \usepackage{amstext} \usepackage{hyperref} ...

5

I think you are trying to print the paths. If so, you may need this: \documentclass{article} \usepackage[obeyspaces]{url} \begin{document} \path{\\server\folder\folder} \path{\\server\my folder\folder} \end{document}

5

\UrlLeft and \UrlRight can be used for the purpose of adding angle brackets, see section "6 Yet more flexibility" url's documentation. Example: \documentclass{article} \usepackage{url} \DeclareUrlCommand\url{% \def\UrlLeft{\langle}% \def\UrlRight{\rangle}% } \begin{document} \url{http://www.example.org/} \end{document} Remarks: \langle and ...

4

A generic (reference manager independent) solution: Create a new bookmark in the bookmark panel of your browser. Name it ("Export -> BibLaTeX" or whatever). URL: (Insert Content from this file). Load the page you want to cite. Click on the new bookmark button. Copy the selected text to clipboard and press [ENTER]. Paste the BibLaTeX entry into your .bib ...

4

The cause of the problem is the % character -- which has a "special" meaning in TeX -- in the field url = {http://www.micro.feld.cvut.cz/home/X34SES/prednasky/08%20Akcelerometry.pdf}, "Escaping" the % symbol, i.e., writing it as \%, might at first blush seem to provide a fix. However, it introduces a new problem: A backslash character is now printed in ...

4

Too long for a comment and needed markup Compile the following code (saved as myfile.tex) with pdflatex myfile bibtex myfile pdflatex myfile pdflatex myfile Contents of myfile.tex: \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{mybib1.bib} @misc{bworld, author = {Ingo Lütkebohle}, title = {{BWorld Robot Control Software}}, ...

4

If the urls are typeset with the url package, then you can load it as \usepackage[hyphens]{url} to allow breaks at hyphens. This is not the default, since these breaks can be confusing for the reader who doesn't know if the hyphen is actually part of the url or not. (With strings like implementing-operators-for-your-class.html that shouldn't be a ...

4

Package hypgotoe add support for embedded go-to actions (GoToE) to \href. This action type only works from and to PDF files. The package only supports destination names as link targets. For example they can be set via \hypertarget or extracted by package zref-xr or xr-hyper. More arbitrary bookmarks can be generated via package bookmark. Currently it does ...

4

Without hyperref no hyperlink is created by LaTeX; however, PDF previewers on Mac OS X have heuristics that try finding URL's (or, more generally, URI's) in the PDF files. Such heuristics often try being too smart and fail. :-( So it's not a LaTeX problem, but of the Apple library PDF viewers are based on (Preview, Skim and others). Since Adobe Reader is ...

4

The above answer by mhp may not provide a solution when PDFLaTeX complains with "Option clash for package url." The cause of this may be because of the package hyperref, which also loads the package. If hyperref is loaded before the url package it gives this error, because the url package is then loaded twice with different options: one without and one with ...

4

How about ps. I do not think it is a good idea to post such a long url in the document. Use a small name and use that for the link. But if this is what you want: \documentclass[10pt,letterpaper]{article} \usepackage{hyperref} \usepackage{longtable} ...

4

First of all I recommend you to use biblatex since it is very adaptable and processes information greatly! In the biblatex manual, they are defined as follows: howpublished: A publication notice for unusual publications which do not fit into any of the common categories url: The URL of an online publication. Thus, I recommend you in general to ...

4

One way would be to use the background package: Code: \documentclass[10pt,a4paper]{article} \usepackage[all]{background} \usepackage{url} \usepackage{lipsum} \SetBgContents{\url{http://tex.stackexchange.com/}}% Set contents \SetBgPosition{0.25cm,-5.0cm}% Select location \SetBgOpacity{1.0}% Select opacity \SetBgAngle{90.0}% Select rotation of logo ...

4

I usually use a combination of eso-pic, graphicx and rotating as it is easy to adjust in terms of location, angle and size. \documentclass[12pt]{scrartcl} \usepackage{blindtext} \usepackage{eso-pic, rotating, graphicx} \AddToShipoutPicture{\put(30,200){\rotatebox{90}{\scalebox{3}{Examiners copy}}}} \begin{document} \blindtext[4] \end{document}

4

There is no need to escape a dollar symbol in a url. \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage{hyperref} \begin{document} \url{test$test} \end{document} 4 LaTeX will refuse to break a 'word' if it contains, among a few other characters, a /. This has very solid reasoning that's outside the scope of this answer, but the url LaTeX package will handle these things very cleanly. Instead of typing in the file path directly, use Insert -> URL. This will (presumably) wrap the argument in \url{<my text ... 3 Install curl (assuming you use apt-get to install packages) : sudo apt-get install curl and do the following for pdf files: cat document.pdf | grep -ao '[a-zA-Z]\+://[a-zA-Z.-]*[^)]\+' | while read LINE; do curl -o /dev/null --silent --head --write-out '%{http_code}' "$LINE"; echo " \$LINE"; done and do the following for tex files : cat myfile.tex ...

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