Hot answers tagged

2

You can use the #{ argument to grab everything until the first {, and then pass that to \oldcitep. You also need an extra set of braces to contain the color change to that citation only: \let\oldcitep=\citep \def\citep#1#{\INNERcitep{#1}} \def\INNERcitep#1#2{{\hypersetup{citecolor=Teal}\oldcitep#1{#2}}} MWE: \documentclass{article} \usepackage{natbib} ...


2

Not change hypersetup, but define new color which can be changed: \documentclass[12pt]{report} \usepackage[colorlinks=true, citecolor=blue]{hyperref} \usepackage{natbib} \usepackage{filecontents} \usepackage{xpatch} \usepackage[most]{tcolorbox} \colorlet{citeauthor}{black} \colorlet{citeyear}{black} \colorlet{citep}{blue} \colorlet{citet}{blue} \...


2

The term for "et al." (in citations) is saved in apacite's \BOthers macro. We can temporarily redefine it to say "and colleagues" or something else. It might be convenient to pack up this redefinition in a new macro called \etalchange. We keep the redefinition local by enclosing it and the \cite it should refer to in curly braces, like {\etalchange\citet*{...


1

(too long for a comment, hence posted as an answer) I can only surmise that you either have corrupted versions of the apalike2 and authordate3 bibliography styles on your system or have code somewhere in the document that modifies the hard-coded string "et al." to "etal.". For sure, the following minimalist working example produces no "etal" output. On my ...


1

Use the following setting \hypersetup{citecolor=black} Working example: \documentclass{article} \usepackage[backend=bibtex,style=authoryear,natbib=true,maxbibnames=2]{biblatex} \addbibresource{bibliography.bib} \DeclareCiteCommand{\citep} {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \printtext[bibhyperref]{\usebibmacro{cite}}} {\...


1

To cite a chapter within a book, you should use the inbook entry type. MWE \documentclass{article} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @inbook{khalil2002, author = {Khalil, Hassan K.}, title = {Gain-Scheduling}, booktitle = {Nonlinear Systems}, publisher = {Prentice Hall, Inc.\isdot}, date = {2002} } \end{filecontents} \...


1

If you want to simplify the redefinition syntax you can also use the xpatch package, which takes care of the lower level implementation details. The package defines (among other things) a command \xpretocmd, which has four arguments: the command you want to change (here: \citep), the code you want to put in front (here: \hypersetup{citecolor=Teal}, code that ...


1

Well, in your code you have several issues ... You have not added package graphicx resulting in error messages for used comands \includegraphics. I added the package in the following mwe ... I used images from package mwe, for example example-image, which must be installed but not loaded ... Wrap your used urls with command \url{}, then you can use package ...


1

I ran into this issue as well and emailed the maintainer of natbib to report the bug, using the contact email provided in the documentation. Here is the most relevant part of the reply: I will submit a new version shortly […]. For now you can make the following fix: On line 494 of natbib.sty, replace \else \NAT@nm with \else \NAT@nmfmt{\NAT@nm}%...


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