0

I am writing to you because I have a small problem with latex. I would like to ensure that the citations in the text of my documents are hypertext links (in blue) leading to the bibliography. The entire citation should be a link, namely the name, date and author's name. I managed to do this by using a topic previously opened on this site for the /cite command. However, I can't seem to do this for the /textcite command, can you help me or explain me why it does not work ?

Here is my code :

\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[top = 2cm, bottom = 2cm, left = 2cm, right = 2cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[edges]{forest}
\usetikzlibrary{fit}
\usepackage{amsmath}
\usepackage{color}
\color{black}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}
\hypersetup{colorlinks, breaklinks, citecolor=blue, linkcolor=blue, urlcolor=blue}
\usepackage{graphicx}
\pagenumbering{arabic}
\usepackage[english]{babel}
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage{csquotes}
\usepackage{lscape}
\usepackage{subcaption}
\usepackage{moresize}
\usepackage{setspace}
\usepackage{indentfirst}
\hypersetup{colorlinks, breaklinks, citecolor=blue, linkcolor=blue, urlcolor=blue}
\usepackage[
   backend=biber,        
   sorting=nyt,          
   citestyle=authoryear, 
   style=apa,
   isbn=false,url=false,
   ibidtracker=false
]{biblatex}
\addbibresource{articles.bib}
\AtEveryBibitem{\clearfield{month}}
\AtEveryBibitem{\clearfield{day}}

\DeclareCiteCommand{\cite} %Command for /cite {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \printtext[bibhyperref]{\usebibmacro{cite}}} {\multicitedelim} {\usebibmacro{postnote}}

\DeclareCiteCommand{\textcite} %Command for /textcite {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \printtext[bibhyperref]{\usebibmacro{textcite}}} {\multicitedelim} {\usebibmacro{postnote}}

\begin{document}

bla bla bla \cite{tokui_economic_2017} bla bla bla \textcite{yule_longterm_2000}

\renewcommand{\bibfont}{\scriptsize} %\nocite{} \printbibliography \end{document}

With the "article.bib" file with :

@article{tokui_economic_2017,
    title = {The economic impact of supply chain disruptions from the Great East-Japan earthquake},
    volume = {41},
    issn = {09221425},
    url = {https://linkinghub.elsevier.com/retrieve/pii/S0922142516300883},
    doi = {10.1016/j.japwor.2016.12.005},
    pages = {59--70},
    journaltitle = {Japan and the World Economy},
    shortjournal = {Japan and the World Economy},
    author = {Tokui, Joji and Kawasaki, Kazuyasu and Miyagawa, Tsutomu},
    urldate = {2022-10-05},
    date = {2017-03},
    langid = {english},
    file = {Version soumise:C\:\\Users\\wendl\\Zotero\\storage\\XPJTTN4G\\Tokui et al. - 2017 - The economic impact of supply chain disruptions fr.pdf:application/pdf},
}

@article{yule_longterm_2000, title = {The Long‐term Psychological Effects of a Disaster Experienced in Adolescence: I: The Incidence and Course of {PTSD}}, volume = {41}, issn = {0021-9630, 1469-7610}, url = {https://onlinelibrary.wiley.com/doi/10.1111/1469-7610.00635}, doi = {10.1111/1469-7610.00635}, shorttitle = {The Long‐term Psychological Effects of a Disaster Experienced in Adolescence}, pages = {503--511}, number = {4}, journaltitle = {Journal of Child Psychology and Psychiatry}, shortjournal = {Journal of Child Psychology and Psychiatry}, author = {Yule, William and Bolton, Derek and Udwin, Orlee and Boyle, Stephanie and O'Ryan, Dominic and Nurrish, Julie}, urldate = {2022-10-05}, date = {2000-05}, langid = {english}, }

As you can see, on the second citation with \textcite, the second parenthesis is missing (and it does weirder stuff if I input an second \textcite after the first one). But the \cite command is working perfectly !

Thank you in advance for your help !

  • Welcome to TeX.SE! – Mensch Jan 17 '23 at 11:20
  • I'd just accept that the link targets are smaller. But if you absolutely want larger link targets the best solution for style=authoryear, (the solution will depend on the style a lot) in my opinion is https://tex.stackexchange.com/q/15951/35864. – moewe Jan 17 '23 at 12:03

0 Answers0