Tag Info

9

Even if the urls are turned off at TOC, they may appear in other places like the headers. Hence it is better to use the optional argument of \section \documentclass{article} \usepackage[% unicode, colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue]% {hyperref} \begin{document} \tableofcontents \section[Google]{\href{www.google....

8

None of the answers helped me out. My long url was placed in a footnote. After searching around I found a working solution here. In my preamble: \usepackage{hyperref} \def\UrlBreaks{\do\/\do-} The last line instructs the url-package which is loaded with the hyperref-package to additionally break at the characters / and -. The option breaklinks=true in ...

7

As I hinted in a comment, even if Sharelatex allows to use lualatex as compiler for your documents, it does not allow network connections from luatex code. I performed the following test: Wrote the following testing file, which attempts a connection to Google Geocoding API to get a JSON containing geocoding information about the location "1600 Amphitheatre ...

6

A penalty of 10000 forbids breaks. Set the penalties to smaller values: \documentclass[fontsize=12pt,paper=a4,]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{biblatex} \addbibresource{bib.bib} \setcounter{biburlnumpenalty}{100} \setcounter{biburllcpenalty}{100} \setcounter{biburlucpenalty}{100} ...

6

\href can be redefined locally: \begingroup \renewcommand*{\href}[2]{#2} \tableofcontents \endgroup

6

A minimal example reproducing the error is: \documentclass{article} \usepackage{hyperref} \begin{document} \footnote{\href{http://whatever}} \end{document} The solution: hyperref's \href has two arguments: \href{URL}{text}. Either use both or use \url{URL}: \documentclass{article} \usepackage{hyperref} \begin{document} \footnote{\href{http://whatever}{...

5

I would recommend against trying to import data directly into LaTeX from a REST/JSON API. This would in any case require outside tools as LaTeX cannot open network connections. I'd suggest to use a language like Python or Ruby to query the API and to transform the JSON data into something that is easier to process with LaTeX. A great tool for transforming ...

5

The question is tagged with hyperref, then \nolinkurl is the counterpart of \url without link. If hyperref is not used, then the link is probably created by the PDF viewer, which uses a heuristics to detect links in text.

5

hyperref does a better job at managing line-breaks in URLs: \documentclass[11pt,letterpaper]{article} \usepackage{hyperref} \hypersetup{ hidelinks, % Remove visible links altogether %urlbordercolor = 1 1 1% Make URL link border white } \begin{document} \url{http://google.com} blah blah blah blah blah blah blah blah blah blah blah blah blah blah ...

4

You can achieve it by testing if doi is empty inside the function format.url. Replace your format.url by the following: FUNCTION {format.url} { doi empty${ url duplicate$ empty${ pop$ "" } { "\urlprefix\url{" swap$* "}" * } if$ } { "" } if} 4 \usepackage[hyphens]{url} should be ok. If it does not work, then go to (2). \RequirePackage[hyphens]{url} before \documentclass. \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% \do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t% \do\u\do\v\do\w\do\x\do\... 4 From the url documentation: You can allow some spacing around the breakable characters by assigning \Urlmuskip = 0mu plus 1mu (with mu units because of math mode). In your case it seems to don't suffice, so you can try with: \Urlmuskip=0mu plus 2mu MWE: \documentclass[a4paper,11pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}... 4 Because you gave no MWE I had to guess. I used paper=A6 to simulate your column. \documentclass[paper=A6]{scrartcl} \usepackage[hyphens]{url} \makeatletter \g@addto@macro{\UrlBreaks}{\UrlOrds\do\r\do\u\do\b\do\i} \makeatother \usepackage{showframe} % to show typing area and margins \begin{document} text \url{http://people.mech.kuleuven.be/~bruyninc/... 4 The macro \biburlsetup sets \Urlmuskip to 0mu plus 3mu, which is responsible for the space stretching. Here's a way for reverting the choice, but of course you'll get an underfull line. \documentclass{article} \usepackage[margin=1in,paperheight=3in]{geometry} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @Book{Example, author={Authorson, ... 4 You could --locally or generally -- add the colon to the nobreak list: \documentclass{beamer} \usepackage{etoolbox} \begin{document} \begin{frame} \frametitle{Weiterführende Informationen} \begin{itemize}\appto\UrlNoBreaks{\do\:}% \item \url{https://docs.oracle.com/javase/tutorial/collections/} \end{itemize} \end{frame} \end{document} 3 You can use escape character for the hash: \#. MWE \documentclass{standalone} \usepackage{todonotes} \usepackage{hyperref} \begin{document} \todo[inline, caption={}]{see this example url that works \url{http://rationalwiki.org/wiki/Francis_Crick}. And this one that does not \url{http://rationalwiki.org/wiki/Francis_Crick\#Quote_mine}. } \end{document} ... 3 \url comes from package url (loaded by hyperref). \urlstyle configures the font. The same font: \urlstyle{same} This means, no special font is set and the current font is used for the URL. Other pre-defined styles: \urlstyle{rm}: The font \rmfamily is used. \urlstyle{sf}: The font \sffamily is used. \urlstyle{tt}: This is the default: \ttfamily. See ... 3 This was done on a smaller scale for a map of Hawaii using a 20x20 grid. For the final version you set the opacity of the map to 1. I find using a checkerboard background helps when aligning links to the map. Using a \parbox instead of tikz \matrix is much faster. I stole the map from http://www.enchantedlearning.com/usa/states/hawaii/map.GIF and ... 3 This chrome extension I wrote sometime ago tries to address this. It creates a BibTeX entry from the active URL and copies it to clipboard automatically.There are three options to create a BibTeX entry from the active URL: either press the extension button in the browser right-click in the webpage and copy the bibtex to clipboard assign a keyboard shortcut ... 3 URL line breaking in bibliographies is notoriously hard and you will find many questions on this site about it. In your case the ad hoc \apptocmd{\biburlsetup}{\def\UrlBigBreaks{\do\:\do\-\do\/}}% does the trick, the standard is \def\UrlBigBreaks{\do\:\do\-}%, we just added the / character. The url package documentation says (p. 4) The result is ... 3 If you use \url from the url package it just enables line breaking without any links. 3 I propose a different strategy, because \url is not able to execute all the substitutions before printing the name and also for better efficiency. \documentclass[11pt]{article} \usepackage{luatextra} \usepackage[french]{babel} \usepackage{xstring} \usepackage{hyperref} \makeatletter \newcommand{\delaccent}[3][]{% #1=liste des substitutions \begingroup ... 3 The problem is that biblatex already loads the url package, but without the hyphens option. So if you try to load it (again) with this option afterwards, LaTeX gives the appropriate error message. Changing the order in which you load the two packages solves the problem: \documentclass[journal,twoside]{IEEEtran} \usepackage[hyphens]{url} \usepackage[style=... 3 tex4ht doesn't do anything with line breaks in URLs. It works for hyphens because browsers do that, but they don't break words with underscores. We need to insert zero-width space character after underscores to enable the linebreaking. Actions on certain characters may be defined using \g@addto@macro\UrlSpecials command, possibly in the .cfg file: \Preamble{... 3 The file url.sty defines \path as follows: \@ifundefined{path}{\DeclareUrlCommand\path{\urlstyle{tt}}}{} In constrast, your (re)definition of \path does not use the \DeclareUrlCommand machinery. That's why it gets hung up on the "\}" substring in \path{C:\Code\Pre-requisite-Setup\}. (Note also that \path -- as defined in the url package via \... 3 The plain bibliography style dates back to about 1994 and is thus not programmed to do anything with a field called url. (In the early 1990s, I don't think that too many people were facing the problem of citing electronically published documents that were available online. Recall that the first decent graphical browser, netscape, wasn't released until some ... 2 According to the documenation, BigBreaks is the way to go otherwise it breaks at the first character. \def\UrlBigBreaks{\do\/\do-\do:} See: http://texdoc.net/texmf-dist/doc/latex/url/url.pdf I had the problem that a line break was inserted always after http:, even when using \UrlBreaks, the documentation clarified that this is the intended behavior. 2 I find that many answers in this forum apply only to LaTeX and not necessarily plain TeX. We use plain TeX, so the answers sometimes simply don't work. But, I found a solution for displaying TeX's special characters that work for us, so I thought I'd share it. I have no idea if it will work for LaTeX, though it seems like it should. You can include a ... 2 If you have in your code \bibliographystyle{plainnat} then the "URL" text comes from the style. In the plainnat.bst file you can find the following code: FUNCTION {format.url} { url empty { "" } { new.block "URL \url{" url * "}" * } if\$ } The part "URL \url{" url * "}" * is responsible for your problem. You can delete URL at the start of it or ...

2

You can define a new interaction and style it differently. For example: \setupinteraction[state=start,style=normal] \defineinteraction[bold][state=start,style=bold] \starttext {\setinteraction[bold] \goto{Link 1}[url(http://www.example.com)]} \goto{Link 2}[url(http://www.example2.com)] \stoptext If you want the interaction to follow the style of the ...

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