2

I get a wrong URL when I click the link in the bibliography of a PDF generated with Latex. I tried using both url and xurl packages but the error continues.

Here is the code:

@misc{understanding_encoder_resolution,
title={Understanding Encoder Resolution and Its 3 Forms},
author={US Digital},
howpublished={https://www.usdigital.com/blog/understanding-encoder-resolution-and-its-3-forms/},
year={2019},
note = {Accedido: 5-10-2022},
}

And here is the output:

result

This is the wrong URL I get when I click the link:

web page no found

I hope you can help me. Thanks in advance.

1 Answer 1

2

Loading the url or, better still, the xurl package won't do you any good unless you switch the field type from howpublished to url:

@misc{understanding_encoder_resolution,
  title={Understanding Encoder Resolution and Its 3 Forms},
  author={{US Digital}},
  url={https://www.usdigital.com/blog/understanding-encoder-resolution-and-its-3-forms/},
  year={2019},
  note = {Accedido: 5-10-2022},
}

Of course, this solution presupposes that you are employing a bibliography style that recognizes the url field type.

Incidentally, do also note that I've changed the author field to author={{US Digital}},, i.e., have employed an extra pair of curly braces. That way, you're telling BibTeX that it's dealing with a so-called "corporate" author here. This will prevent BibTeX from parsing the field as containing a given name "US" and a surname "Digital".


Addendum: A full MWE (minimum working example) and its output:

enter image description here

\documentclass{article} % choose a suitable document class

% create a bib file on the fly:
\begin{filecontents}[overwrite]{mybib.bib}
@misc{understanding_encoder_resolution,
  title={Understanding Encoder Resolution and Its 3 Forms},
  author={{US Digital}},
  url={https://www.usdigital.com/blog/understanding-encoder-resolution-and-its-3-forms/},
  year={2019},
  note = {Accedido: 5-10-2022},
}
\end{filecontents}

\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage[round,authoryear]{natbib} % choose a suitable citation management package
\bibliographystyle{plainnat} % choose a suitable bibliography style

\usepackage{xurl}
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional

\begin{document}

\nocite{*}
\bibliography{mybib}

\end{document}
1
  • 1
    Thanks for your help. I use natbib and LaTeX does not add in the bibliography what I write inside \url{}. But it does add what I write inside \howpublished{}. I could manage to avoid the error that appears when I click the url by writing the link inside \howpublished{\url{}}.
    – el_maxx
    Oct 17, 2022 at 10:18

You must log in to answer this question.

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