Tag Info

Hot answers tagged

4

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


3

As indicated in the name, ieeetr-fr is an adaptation of the IEEE style for use in French. As such, it hard-codes in an assumption that babel is loaded with the french option to define for example \fg. You will either need to load babel appropriately or use a different style (say the standard IEEE one).


3

There is an option pdfnewwindow for the command \href. This option does not work with the command \url, but \url{URL} is actually equivalent to \href{URL}{\nolinkurl{URL}}. This means that you can define a new command like this: \newcommand{\urlNewWindow}[1]{\href[pdfnewwindow=true]{#1}{\nolinkurl{#1}}} and then say \urlNewWindow{URL}


3

So long as your paths don't contain special characters, you can do with \documentclass{article} \usepackage{url} \newcommand{\rootDir}{\string$ROOTDIR} \newcommand{\myDir}{my/dir} \makeatletter \newcommand{\makeFilePaths}[3]{% \expandafter\@ifdefinable\csname dfile#1\endcsname{% \expandafter\edef\csname dfile#1\endcsname{\rootDir/#2/#3}% }% ...


3

In every case below, remove the extraneous braces: \def\WPpagequestion{\WPhomepagebase 201545} to prevent those braces from being included in the URL. Plain TeX A Plain TeX way for solving this would be: \def\href#1#2{% \begingroup\def\x{\endgroup\goto{#1}[url(}% \expandafter\x#2)]% } or the more drastic: \def\href#1#2{% ...


2

The answer to my question: hyperref doesn't have a feature to direct a web browser to open in a new tab from a PDF document. The Adobe PDF specs define a method for opening new browser tabs from a PDF document, but the example provided by Adobe is a Javascript implementation and doesn't apply to LaTeX. A subsidiary issue in the thread: creating a command - ...


2

The second argument of \href is arbitrary text. If the text should appear as in \url, then \nolinkurl can be used, that acts as \url without the link part, which is already provided by \href. The font can be changed via \urlstyle, see the documentation of package url Example: \documentclass{book} \usepackage{xcolor} \usepackage{hyperref} ...


1

See xstring manual, 3.4 Catcode and starred macros. You have to use the starred version of the test macro, if you want to use macros therein. \renewcommand{\url}[1]{ \StrBehind{#1}{:}[\tempa] \StrBefore{#1}{:}[\tempb] \IfBeginWith*{\tempb}{mailto} {\href{#1}{\nolinkurl{\tempa}}} {\oldUrl{#1}} }


1

Check out this solution: http://tex.stackexchange.com/a/201952/62165. It might solve your problem. It is based on \href but you could use it as a \url replacement by making the two input parameters the same, ie, \click{www.yahoo.com}{www.yahoo.com}. Aternatively you could modify the \click command to take only one parameter. It doesn't change the background ...


1

I've managed to produce a new chicago.bst file with url included thanks to this script that adds url support for any bst file. If you prefer you can download my chicago.bst file here



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