0

I am able to use Biblatex with the APA style and hyperref and it generally works quite nicely with the code below, with \textcite and \parencite commands renewed via help taken from these pages over the years to correct the links to include the author names, and the closing parenthesis for \textcite. Overall the finish is nice but it is not quite perfect for what I want in my PhD thesis, so:

Problem 1 - these renewed commands have solved the link issues but have messed with the APA style author grouping by same first author as in the examples of the output. Any ideas on how I can correct the renewed \textcite and \parencite commands to restore the APA behaviours of the citations, but also retain the changes I have made to the link formatting?

Problem 2 - The new Mendeley reference manager has messed with ISBN numbers, and this results in the bib files having lots of unusual entries for the ISBN field. ISBN=false doesn't resolve the error either. An example error is

ISBN '1471-0048' in entry 'Bullmore2009' is invalid - run biber with '--validate_datamodel' for details.

Any ideas on how to suppress the data model validation within Overleaf would be very helpful, otherwise I will need to go and correct the ISBN field manually in every entry, and when my thesis contains

Thank you in advance for any help you can provide on either problem, it's been puzzling me for days...

Summary of the various combinations of authors, years and authors in the same year


\documentclass{article}
\usepackage[english]{babel}
\usepackage[letterpaper,top=1cm,bottom=1cm,left=1cm,right=1cm,marginparwidth=1.75cm]{geometry}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa , hyperref=true, uniquename=false, uniquelist=false, date=year, doi=false, eprint=false, url=false, isbn=false, maxcitenames=3, maxbibnames=99]{biblatex}
\addbibresource{MWE-Friston.bib}
        \setlength\bibitemsep{0.5\baselineskip}
                    \AtEveryBibitem{%
                      \ifentrytype{misc}{}{%
                        \clearfield{url}%
                        \clearfield{urldate}%
                      }%
                    }
        \DeclareFieldFormat{bibhyperrefnonest}{%
          \DeclareFieldFormat{bibhyperref}{##1}%
          \bibhyperref{#1}}
        
        \DeclareCiteCommand{\parencite}[\mkbibparens]
          {\usebibmacro{cite:init}%
           \usebibmacro{prenote}}
          {\usebibmacro{citeindex}%
           \printtext[bibhyperrefnonest]{\usebibmacro{cite}}}
          {}
          {\usebibmacro{postnote}%
           \usebibmacro{cite:post}}
        
        \DeclareCiteCommand{\textcite}
        {\usebibmacro{cite:init}%
            \usebibmacro{prenote}}
        {\usebibmacro{citeindex}%
            \printtext[bibhyperref]{\usebibmacro{textcite}}}
        {}
        {\printtext[bibhyperref]{\usebibmacro{textcite:postnote}}%
            \usebibmacro{cite:post}}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{parskip}            

\begin{document}
\noindent 

\#1 Textcite first author \textcite{Friston1993} - great!\\ 
\#2 Textcite same first author two years \textcite{Friston1993,Friston1996} - this should be Friston et al (1993,1996) with name+year1 as 1 hyperlink and year 2 as another hyperlink as per \#3 \\
\#3 Textcite same first author two works in the same year \textcite{Penny2004a,Penny2004b} - great!\\

\noindent 
\#4 Parencite first author \parencite{Friston1993} - great!\\
\#5 Parencite same first author two years \parencite{Friston1993,Friston1996} - this should be (Friston et al 1993,1996) with name+year1 as 1 hyperlink and year 2 as another as per \#7 \\
\#6 Parencite same first author two years, plus another author with two in the same year \parencite{Friston1993,Friston1996,Penny2004a,Penny2004b} - this should be (Friston et al., 1993,1996; Penny et al, 2004a,2004b) \\
\#7 Parencite same first author, two works in the same year \parencite{Penny2004a,Penny2004b} - great!\\

Other \\
\#8 Parencite 2 author paper \parencite{Bullmore2009} - great! \\
\#9 Parencite 3 author paper \parencite{Friston2003} - great!\\

\printbibliography
\end{document}

And here is my .bib file as prepared by Mendeley:

Automatically generated by Mendeley Desktop 1.19.8
Any changes to this file will be lost if it is regenerated by Mendeley.

BibTeX export options can be customized via Preferences -> BibTeX in Mendeley Desktop

@article{Morris1998a,
abstract = {Localized amygdalar lesions in humans produce deficits in the recognition of fearful facial expressions. We used functional neuroimaging to test two hypotheses: (i) that the amygdala and some of its functionally connected structures mediate specific neural responses to fearful expressions; (ii) that the early visual processing of emotional faces can be influenced by amygdalar activity. Normal subjects were scanned using PET while they performed a gender discrimination task involving static grey-scale images of faces expressing varying degrees of fear or happiness. In support of the first hypothesis, enhanced activity in the left amygdala, left pulvinar; left anterior insula and bilateral anterior cingulate gyri was observed during the processing of fearful faces. Evidence consistent with the second hypothesis was obtained by a demonstration that amygdalar responses predict expression specific neural activity in extrastriate cortex.},
author = {Morris, J. S. and Friston, K. J. and B{\"{u}}chel, C. and Frith, C. D. and Young, A. W. and Calder, A. J. and Dolan, R. J.},
doi = {10.1093/brain/121.1.47},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Morris et al/Morris et al. - 1998 - A neuromodulatory role for the human amygdala in processing emotional facial expressions - Brain.pdf:pdf;:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Morris et al/Morris et al. - 1998 - A neuromodulatory role for the human amygdala in processing emotional facial expressions - Brain.pdf:pdf;:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Morris et al/Morris et al. - 1998 - A neuromodulatory role for the human amygdala in processing emotional facial expressions - Brain(2).pdf:pdf},
isbn = {1460-2156$\backslash$n0006-8950},
issn = {00068950},
journal = {Brain},
keywords = {Adult,Amygdala,Discrimination (Psychology),Emission-Computed,Emotion,Emotions,Facial Expression,Facial expression,Fear,Female,Humans,Male,Pattern Recognition,Regression Analysis,Sex,Tomography,Visual},
month = {jan},
number = {1},
pages = {47--57},
pmid = {9549487},
publisher = {Oxford Academic},
title = {{A neuromodulatory role for the human amygdala in processing emotional facial expressions}},
url = {https://academic.oup.com/brain/article/121/1/47/335267 http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmed{\&}DbFrom=pubmed{\&}Cmd=Link{\&}LinkName=pubmed{\_}pubmed{\&}LinkReadableName=Related Articles{\&}IdsFromResult=9549487{\&}ordinalpos=3{\&}itool=EntrezSystem2.PEntrez.Pubmed},
volume = {121},
year = {1998}
}
@article{Friston1996,
abstract = {In this paper we present a critique of pure insertion. Pure insertion represents an implicit assumption behind many (but not all) studies that employ cognitive subtraction. The main contention is that pure insertion is not valid in relation to the neuronal instantiation of cognitive processes. Pure insertion asserts that there are no interactions among the cognitive components of a task. It is possible to evaluate and refute this assumption by testing explicitly for interactions using factorial experimental designs. It is proposed that factorial designs are more powerful than subtraction designs in characterizing cognitive neuroanatomy, precisely because they allow for interactions and eschew notions like pure insertion. In particular we suggest that the effect of a cognitive component (i.e., an effect that is independent of other components) is best captured by the main (activation) effect of that component and that the integration among components (i.e., the expression of one cognitive process in the context of another) can be assessed with the interaction terms. In this framework a complete characterization of cognitive neuroanatomy includes both regionally specific activations and regionally specific interactions. To illustrate our point we have used a factorial experimental design to show that inferotemporal activations, due to object recognition, are profoundly modulated by phonological retrieval of the object's name. This interaction implicates the inferotemporal regions in phonological retrieval, during object naming, despite the fact that phonological retrieval does not, by itself, activate this region.},
author = {Friston, K J and Price, C J and Fletcher, P and Moore, C and Frackowiak, R. S.J. and Dolan, R J},
doi = {10.1006/nimg.1996.0033},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Friston et al/Friston et al. - 1996 - The trouble with cognitive subtraction - NeuroImage.pdf:pdf},
issn = {10538119},
journal = {NeuroImage},
number = {2},
pages = {97--104},
pmid = {9345501},
title = {{The trouble with cognitive subtraction}},
volume = {4},
year = {1996}
}
@article{Bullmore2009,
abstract = {Recent developments in the quantitative analysis of complex networks, based largely on graph theory, have been rapidly translated to studies of brain network organization. The brain's structural and functional systems have features of complex networks--such as small-world topology, highly connected hubs and modularity--both at the whole-brain scale of human neuroimaging and at a cellular scale in non-human animals. In this article, we review studies investigating complex brain networks in diverse experimental modalities (including structural and functional MRI, diffusion tensor imaging, magnetoencephalography and electroencephalography in humans) and provide an accessible introduction to the basic principles of graph theory. We also highlight some of the technical challenges and key questions to be addressed by future developments in this rapidly moving field.},
author = {Bullmore, Ed and Sporns, Olaf},
doi = {10.1038/nrn2575},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Bullmore, Sporns/Bullmore, Sporns - 2009 - Complex brain networks graph theoretical analysis of structural and functional systems - Nat Rev Neurosci.pdf:pdf},
isbn = {1471-0048},
issn = {1471-003X},
journal = {Nat Rev Neurosci},
keywords = {Animals,Brain,Brain Mapping,Brain Mapping: methods,Brain: anatomy {\&} histology,Brain: physiology,Computer Graphics,Computer Graphics: trends,Computer-Assisted,Computer-Assisted: methods,Electroencephalography,Electroencephalography: methods,Humans,Image Processing,Magnetic Resonance Imaging,Magnetic Resonance Imaging: methods,Magnetoencephalography,Magnetoencephalography: methods,Nerve Net,Nerve Net: anatomy {\&} histology,Nerve Net: physiology,Neural Networks (Computer),brain-functionalities,brain-models,circuitry,computational-neuroscience,graph-theory,hypergraphs,hypernetworks,neuronal-structures},
number = {3},
pages = {186--198},
pmid = {19190637},
title = {{Complex brain networks: graph theoretical analysis of structural and functional systems}},
url = {citeulike-article-id{\%}5Cn4025955{\%}5Cnhttp{\%}5Cn//dx.doi.org/10.1038/nrn2575{\%}5Cnhttp://www.ncbi.nlm.nih.gov/pubmed/19190637{\%}5Cnhttp://www.ncbi.nlm.nih.gov/pubmed/19190637{\%}5Cnhttp://www.nature.com/doifinder/10.1038/nrn2575},
volume = {10},
year = {2009}
}
@article{Friston1993,
abstract = {The distributed brain systems associated with performance of a verbal fluency task were identified in a nondirected correlational analysis of neurophysiological data obtained with positron tomography. This analysis used a recursive principal-component analysis developed specifically for large data sets. This analysis is interpreted in terms of functional connectivity, defined as the temporal correlation of a neurophysiological index measured in different brain areas. The results suggest that the variance in neurophysiological measurements, introduced experimentally, was accounted for by two independent principal components. The first, and considerably larger, highlighted an intentional brain system seen in previous studies of verbal fluency. The second identified a distributed brain system including the anterior cingulate and Wernicke's area that reflected monotonic time effects. We propose that this system has an attentional bias.},
author = {Friston, K J and Frith, C D and Liddle, P F and Frackowiak, R S.J.},
doi = {10.1038/jcbfm.1993.4},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Friston et al/Friston et al. - 1993 - Functional connectivity The principal-component analysis of large (PET) data sets - Journal of Cerebral Blood Fl.pdf:pdf},
issn = {0271678X},
journal = {Journal of Cerebral Blood Flow and Metabolism},
keywords = {Effective connectivity,Functional connectivity,Neural networks,PET,Principal-component analysis,Verbal fluency},
month = {jan},
number = {1},
pages = {5--14},
pmid = {8417010},
publisher = {SAGE PublicationsSage UK: London, England},
title = {{Functional connectivity: The principal-component analysis of large (PET) data sets}},
url = {http://journals.sagepub.com/doi/10.1038/jcbfm.1993.4 http://www.ncbi.nlm.nih.gov/pubmed/8417010},
volume = {13},
year = {1993}
}
@article{Friston2003,
abstract = {In this paper we present an approach to the identification of nonlinear input-state-output systems. By using a bilinear approximation to the dynamics of interactions among states, the parameters of the implicit causal model reduce to three sets. These comprise (1) parameters that mediate the influence of extrinsic inputs on the states, (2) parameters that mediate intrinsic coupling among the states, and (3) [bilinear] parameters that allow the inputs to modulate that coupling. Identification proceeds in a Bayesian framework given known, deterministic inputs and the observed responses of the system. We developed this approach for the analysis of effective connectivity using experimentally designed inputs and fMRI responses. In this context, the coupling parameters correspond to effective connectivity and the bilinear parameters reflect the changes in connectivity induced by inputs. The ensuing framework allows one to characterise fMRI experiments, conceptually, as an experimental manipulation of integration among brain regions (by contextual or trial-free inputs, like time or attentional set) that is revealed using evoked responses (to perturbations or trial-bound inputs, like stimuli). As with previous analyses of effective connectivity, the focus is on experimentally induced changes in coupling (cf., psychophysiologic interactions). However, unlike previous approaches in neuroimaging, the causal model ascribes responses to designed deterministic inputs, as opposed to treating inputs as unknown and stochastic. {\textcopyright} 2003 Elsevier Science (USA). All rights reserved.},
author = {Friston, K. J. and Harrison, L. and Penny, W.},
doi = {10.1016/S1053-8119(03)00202-7},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Friston, Harrison, Penny/Friston, Harrison, Penny - 2003 - Dynamic causal modelling - NeuroImage.pdf:pdf},
isbn = {9780122648410},
issn = {10538119},
journal = {NeuroImage},
keywords = {Bilinear model,Effective connectivity,Functional neuroimaging,Hemodynamic response function,Nonlinear system identification,fMRI},
number = {4},
pages = {1273--1302},
pmid = {12948688},
title = {{Dynamic causal modelling}},
volume = {19},
year = {2003}
}
@article{Penny2004b,
abstract = {The brain appears to adhere to two fundamental principles of functional organisation, functional integration and functional specialisation, where the integration within and among specialised areas is mediated by effective connectivity. In this paper, we review two different approaches to modelling effective connectivity from fMRI data, structural equation models (SEMs) and dynamic causal models (DCMs). In common to both approaches are model comparison frameworks in which inferences can be made about effective connectivity per se and about how that connectivity can be changed by perceptual or cognitive set. Underlying the two approaches, however, are two very different generative models. In DCM, a distinction is made between the 'neuronal level' and the 'hemodynamic level'. Experimental inputs cause changes in effective connectivity expressed at the level of neurodynamics, which in turn cause changes in the observed hemodynamics. In SEM, changes in effective connectivity lead directly to changes in the covariance structure of the observed hemodynamics. Because changes in effective connectivity in the brain occur at a neuronal level DCM is the preferred model for fMRI data. This review focuses on the underlying assumptions and limitations of each model and demonstrates their application to data from a study of attention to visual motion. {\textcopyright} 2004 Elsevier Inc. All rights reserved.},
author = {Penny, W. D. and Stephan, K. E. and Mechelli, A. and Friston, K. J.},
doi = {10.1016/j.neuroimage.2004.07.041},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Penny et al/Penny et al. - 2004 - Modelling functional integration A comparison of structural equation and dynamic causal models - NeuroImage.pdf:pdf},
isbn = {1053-8119 (Print)$\backslash$n1053-8119 (Linking)},
issn = {10538119},
journal = {NeuroImage},
keywords = {Dynamic causal model,Functional integration,Structural equation},
number = {SUPPL. 1},
pages = {264--274},
pmid = {15501096},
title = {{Modelling functional integration: A comparison of structural equation and dynamic causal models}},
volume = {23},
year = {2004}
}
@techreport{Friston1999,
abstract = {This article considers the efficiency of event-related fMRI designs in terms of the optimum temporal pattern of stimulus or trial presentations. The distinction between ''stochastic'' and ''deterministic'' is used to distinguish between designs that are specified in terms of the probability that an event will occur at a series of time points (stochastic) and those in which events always occur at prespecified time (deterministic). Sto-chastic designs may be ''stationary,'' in which the probability is constant, or nonstationary, in which the probabilities change with time. All these designs can be parameterized in terms of a vector of occurrence probabilities and a prototypic design matrix that embodies constraints (such as the minimum stimulus onset asynchrony) and the model of hemodynamic responses. A simple function of these parameters is presented and used to compare the relative efficiency of different designs. Designs with slow modulation of occurrence probabilities are generally more efficient than stationary designs. Interestingly the most efficient design is a conventional block design. A critical point, made in this article, is that the most efficient design for one effect may not be the most efficient for another. This is particularly important when considering evoked responses and the differences among responses. The most efficient designs for evoked responses , as opposed to differential responses, require trial-free periods during which baseline levels can be attained. In the context of stochastic, rapid-presentation designs this is equivalent to the inclusion of ''null events.''},
author = {Friston, K J and Zarahn, E and Josephs, O and Henson, R N A and Dale, A M},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Friston et al/Friston et al. - 1999 - Stochastic Designs in Event-Related fMRI - Unknown.pdf:pdf},
keywords = {event-related,experimental design,fMRI,functional neuroimaging,stochastic},
title = {{Stochastic Designs in Event-Related fMRI}},
url = {http://www.idealibrary.com},
year = {1999}
}
@article{Penny2004a,
abstract = {This article describes the use of Bayes factors for comparing dynamic causal models (DCMs). DCMs are used to make inferences about effective connectivity from functional magnetic resonance imaging (fMRI) data. These inferences, however, are contingent upon assumptions about model structure, that is, the connectivity pattern between the regions included in the model. Given the current lack of detailed knowledge on anatomical connectivity in the human brain, there are often considerable degrees of freedom when defining the connectional structure of DCMs. In addition, many plausible scientific hypotheses may exist about which connections are changed by experimental manipulation, and a formal procedure for directly comparing these competing hypotheses is highly desirable. In this article, we show how Bayes factors can be used to guide choices about model structure, both concerning the intrinsic connectivity pattern and the contextual modulation of individual connections. The combined use of Bayes factors and DCM thus allows one to evaluate competing scientific theories about the architecture of large-scale neural networks and the neuronal interactions that mediate perception and cognition. {\textcopyright} 2004 Elsevier Inc. All rights reserved.},
author = {Penny, W. D. and Stephan, K. E. and Mechelli, A. and Friston, K. J.},
doi = {10.1016/j.neuroimage.2004.03.026},
file = {:Users/jt15118/OneDrive - University of Bristol/JamieMainLaptopFolder/1{\_}PhD{\_}Project/Mendeley/Penny et al/Penny et al. - 2004 - Comparing dynamic causal models - NeuroImage.pdf:pdf},
isbn = {1053-8119 (Print)$\backslash$n1053-8119 (Linking)},
issn = {10538119},
journal = {NeuroImage},
keywords = {Bayes factors,Dynamic causal models,fMRI},
number = {3},
pages = {1157--1172},
pmid = {15219588},
title = {{Comparing dynamic causal models}},
volume = {22},
year = {2004}
}
2
  • For future reference: Please ask only about one issue per question, especially if they are as apparently unrelated as your problems 1 and 2 here. That makes it easier to answer your question and it makes the answers more relevant for other people as well. See also tex.meta.stackexchange.com/q/7425/35864. There is no problem at all in asking several different question on the same day. Questions are free.
    – moewe
    Sep 5, 2022 at 16:05
  • Apologies, I wasn't completely sure they were unrelated, my mistake
    – jamiet
    Sep 7, 2022 at 11:26

1 Answer 1

1

For the first part about the grouping, the issue is that your redefinitions are from an out of date version of the style. Replace the \DeclareCiteCommands above with:

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}%
   \toggletrue{apa:inpcite}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperrefnonest]{\usebibmacro{cite}}%
   \usebibmacro{cite:post}}
  {}
  {\usebibmacro{postnote}%
   \togglefalse{apa:inpcite}}

 \makeatletter
\DeclareCiteCommand{\cbx@textcite}
  {\usebibmacro{cite:init}%
   \toggletrue{apa:intcite}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{textcite}}
   \usebibmacro{cite:post}%
   \togglefalse{apa:intcite}}
  {}
  {\printtext[bibhyperref]{\usebibmacro{textcite:postnote}}}
\makeatother

For the second part about ISBNs, the format of them is quite mangled in the .bib so you can put a sourcemap in your preamble to deal with this if you don't want to correct the .bib. Here is an example that just ignores all isbn fields with invalid ISBN characters in them:

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=isbn, notmatch=\regexp{^[-0-9]+$}, final]
      \step[fieldset=isbn, null]}}}

This doesn't quite solve all of you problems as there are other isbn fields in there that are invalid but don't have any strange characters. If you want to just ignore all isbn fields completely, simply remove the first \step above. Sourcemaps are a good way to deal with messy auto-exported data without having to modify the source files.

2
  • Thank you so much for this answer! The ISBN correction worked perfectly without the first \step, so this solved problem 2. As for problem 1 - it seems what I have been trying to do is against the APA rules, so this is likely why the authors do not get grouped, so have decided to leave this part as it is!
    – jamiet
    Sep 25, 2022 at 23:45
  • Unfortunately, the first part of your answer didn't work for me so after some research I decided to switch back to style=authoryear and this worked well with uniquename=false and uniquelist=false, but after using this in conjunction with the solution provided by Audrey (linked below) for hyperref changes to include the full citations, for some reason, the author grouping is suppressed. Any ideas on what in Audrey's code could be affecting this please?tex.stackexchange.com/questions/15951/….
    – jamiet
    Sep 29, 2022 at 1:22

You must log in to answer this question.

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