Tag Info

Hot answers tagged

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


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


13

You can redefine the bibmacro doi+eprint+url so that the doi field is printed only if the url field is not defined, that is, add the following lines in the preamble: \renewbibmacro*{doi+eprint+url}{% \iftoggle{bbx:doi} {\iffieldundef{url}{\printfield{doi}}{}} {}% \newunit\newblock \iftoggle{bbx:eprint} {\usebibmacro{eprint}} {}% ...


12

Just type the URL: \documentclass{article} \usepackage{url} \begin{document} \url{http://foo.bar/orders{orderID}} \end{document} With hyperref it's the same, but the result is an invalid URL, I guess.


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

The syntax of \hyperref with the optional argument is: \hyperref[<label name>]{<text>} I assume, you do not have \label{This is a link to Google}. Then the text "http://www.google.com" appears without link to a non-existing label. I think you want somethink like: \href{https://www.google.com/}{This is a link to Google.} Then the text "This ...


10

The PDF format knows nested actions. hyperref supports this by option nextacrtionraw for \href in some rudimentary manner: \documentclass{article} \usepackage{hyperref} \begin{document} \href[% nextactionraw={% <<% /Type/Action% /S/URI% /URI(http://meta.tex.stackexchange.com/)% >>% }% ...


10

You can load the package url and redefine the command \url as follows: \DeclareUrlCommand\url{\color{magenta}\def\UrlLeft{http://}\urlstyle{tt}} Note that the xcolor package is required, too, if you want to give a color to the link. Now you can simply write \url{ipython.org} and http:// is added automatically. Complete example ...


10

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

If you want to include the email address as an image but don't want to loose quality, why not use a PostScript image? If Adobe Illustrator is available to you, it's easy to convert any font in a PDF to a vector path. I'm sure there are open source tools that can do the same. Create a New Illustrator Document File > Place... > Select the PDF with your CV ...


8

Here are two approaches. In the first, I use the actual @ character, but when I write it out, I overlay it with some really tiny white text. Thus, during the copy/paste of the PDF, you get the extra text as part of the copy: \documentclass{article} \usepackage{stackengine} \usepackage{graphicx} \usepackage{xcolor} ...


8

From the hyperref documentation (section 4 Additional user macros): If you need to make references to URLs, or write explicit links, the following low-level user macros are provided: \href[options]{URL}{text} The text is made a hyperlink to the URL; this must be a full URL (relative to the base URL, if that is defined). The special characters # ...


8

It's better to use a different command, so that its usage is clear: \documentclass{article} \usepackage{xcolor} \usepackage[ colorlinks, linkcolor=magenta ]{hyperref} \newcommand\rurl[1]{% \href{http://#1}{\nolinkurl{#1}}% } \begin{document} This is a link \rurl{ipython.org} written in abbreviated form. \end{document} Of course you lose the tricks ...


8

This works for me, but I don't know about your OS, so I'm not sure if it will work for you. Note that the command convert is part of ImageMagick. Compile with -shell-escape enabled. \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{bashful,graphicx} \begin{document} \bash echo "jon@jon.com" | convert label:@- email.png \END ...


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

You can do this via mapping of datasources. The \DeclareSourcemap command \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \step[fieldsource=url,final] \step[fieldset=doi,null] } } } processes any bibtex input data and for each item in the bibliograhpy file it executes a number of commands given by \step: the first step ...


7

With hyperref, for fun (egreg was tooooo fast with url ;)...) \documentclass{article} \usepackage{hyperref} \begin{document} \href{http://foo.bar/orders{orderID}}{\texttt{http://foo.bar/orders\{orderID\}}} \end{document}


7

You can set the \UrlFont including a sizing command: \documentclass{article} \usepackage{biblatex} \addbibresource{biblatex-examples.bib} \renewcommand{\UrlFont}{\small\tt} \begin{document} \cite{ctan,markey,kastenholz} \printbibliography \end{document} If you only want this to affect the bibliography, then place the command ...


6

With backref active, the entire bibliography record in the .bbl file is read as an argument, so the category code tricks made by \url don't work. However, the IEEEtran bib style provides the hook \BIBdecl that's executed at the start of the bibliography; use it to make % into a printable character. The produced .bbl file shouldn't have comments after ...


6

One way to proceed is to create a modified version of the file plainnat.bst, in which the functions that format and print fields such as doi and isbn are reduced to stubs that do nothing: Find the file plainnat.bst in your TeX distribution. Make a copy of this file and call it, say, myplainnat.bst. (Don't edit an original file of the TeX distribution ...


5

The bibliography style - ieeetr in your case - is responsible for choosing which fields to include in each entry of the bibliography. It seems that the howpublished field is not included for manuals. How about just putting the url in the note field, like this: @Manual{XXXX, title = {Title}, author = {Paul}, note = {Available at ...


5

You can prevent (or at least infinitely discourage) linebreaking in the footnote, which may or may not be suitable, depending. This produces a broken URL as you describe if you comment out the setting of \interfootnotelinepenalty. \documentclass{article} \setlength\textheight{3cm} \usepackage{hyperref} \def\a{One two three four. } \def\b{\a Five six seven ...


5

Donald Arseneau's relsize package allows for font size changes depending on the size of surrounding text. \smaller prints text smaller than the surrounding text, so we just have to use \renewcommand{\UrlFont}{\smaller} A more complicated solution is to use biblatex to detect whether we're in a footnote and use ...


5

pgfmath loads pgfplain-util.def that wants to emulate xcolor, without really being able to do it if the whole PGF isn't loaded. You can adapt my solution at Can \usepackage{color} and \input tikz work together in Plain TeX/eplain? by giving control of color back to the color package. \input eplain \beginpackages \usepackage{url} \usepackage{color} ...


5

Below an possible answer adapted to your usecase. For this solution I redefined \footnote and \href and used to if-statements. To really check if one is in a certain environment see this question. \documentclass{article} \usepackage{hyperref} \newif\ifprinted \printedtrue % for printet version % \printedfalse % for screen version \newif\iffoot \footfalse ...



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