Biblatex by default (autopunct = true) moves punctuations around for superscript citation. However, changing the color of the superscript by \textcolor or by \color (need extra grouping) breaks this feature.
I noticed this even happens also with fnpct.
As can be seen in the MWE all attempts to have a colored superscript after punctuation failed (lines 2 to 4).
Any idea how to solve this?
\documentclass{article}
\usepackage{xparse}
\usepackage{xcolor}
\usepackage[
%autopunct = true, %that is the default setting
autocite = superscript,
hyperref=true
]{biblatex}
\addbibresource{biblatex-examples.bib}
\NewDocumentCommand\testA{m}{%
\begingroup\color{blue}\autocite{#1}\endgroup%
}%
\NewDocumentCommand\testB{m}{%
\color{blue}\autocite{#1}%
}%
\begin{document}
This is a normal test \autocite{loh}. Things after.
This is an inline with color test \textcolor{blue}{\autocite{loh}}. Things after.
This is a macro test \testA{loh}. Things after.
This is a macro test \testB{loh}. Things after.
\end{document}
EDIT: As an example for what I am trying to reproduce: https://www.nature.com/articles/s41699-019-0098-2.pdf
EDIT 2:
To make it more clear: I need one pdf-a version (through pdfx) for archiving and one pdf-x version for printing. Many of hyperref features, including citecolor are disabled with pdf-x and using hyperref citecolor option is not possible anymore.
Some more detailss are mentioned here:
X-4 option of PDFX does not show hyperlink color with the PDF/X option (x-4)


\autociteand is ignored. – moewe Apr 19 '19 at 05:19biblatex's citation outputs? Ishyperrefinvolved? – moewe Apr 19 '19 at 05:20hyperrefbecause a cheap solution might be to just colour all citation links in blue\usepackage[colorlinks,citecolor=blue]{hyperref}. Technically you would not be colouring citations, you would be colouring all linked parts of citations. But in your case this probably coincides. – moewe Apr 19 '19 at 06:50In other words, trying to have press-ready pdf one should ignore hyperref
– Shahryar Apr 19 '19 at 06:54citecoloroption.