3

https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO

I've tried href, hyperref, URL, or none at all, just \footnote{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}

or \footnote[1]{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}

Can't put the entire link without being clickable because latex things the "%" it's part of the code.

5
  • 1
    Can you show what you've tried with \url? Since, \footnote{\url{<URL>}} works out-of-the-box.
    – Werner
    Mar 26 at 15:18
  • @Werner Unless there is % sign in the address! That's when you need the \urldef command. Mar 26 at 17:56
  • @hair-splitter: Have you tried it? This works without problem: Code; Output
    – Werner
    Mar 26 at 18:55
  • @Werner It works because \% was written in the URL address instead of %! Without changing the address, it returns with an error! In addition, using url package instead of hyperref gives a bad result! Please read the url user guide! Mar 26 at 19:21
  • Hey guys, thank you very much. The asnwear by @hair-splitter below worked just fine, but it's good to know that I can just use "\%" to bypass the problem
    – Alexander
    Mar 26 at 19:50

2 Answers 2

1

The following code will return error:

\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
text\footnote{\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}}
\end{document}

In such a case, you can use the \urldef command. See the page 2 in url.pdf:

Take for example the email address “myself%node@gateway.net" which could not be given (using “\url” or “\verb”) in a caption or parbox due to the percent sign. This address can be predefined with \urldef{\myself}\url{myself%node@gateway.net} and then you may use “\myself” instead of “\url{myself%node@gateway.net}” in an argument, and even in a moving argument like a caption because a defined-url is robust.

For example:

\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
\urldef{\myurl}\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
text\footnote{\myurl}
\end{document}

enter image description here

3
  • 2
    This worked so damn fine. Thank you very much! The problem really was the "%" in the middle of the link.
    – Alexander
    Mar 26 at 19:45
  • @Alexander I am glad! Please accept my answer then. Mar 26 at 19:52
  • oh, sorry. didnt know about that. I'd upvoted if I could :D
    – Alexander
    Mar 26 at 20:02
3
\documentclass{article}
\usepackage{hyperref}
\usepackage{xurl}
\begin{document}
\footnote{\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:\%2F\%2Fwww4.bcb.gov.br\%2Fglossario.asp\%3FDefinicao\%3D1676\%26idioma\%3DP\%26idpai\%3DGLOSSARIO}}
\end{document}

enter image description here

2
  • I don't consider this to be an optimal answer, because you have to manipulate the URL, you have to type \% instead of the % sign. The \urldef command of the url package must be used for this! Mar 26 at 17:43
  • 1
    Hi, @Clara. Thank you very much for the answear!
    – Alexander
    Mar 26 at 19:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .