![tikz ノード [fill=black, text=white] 内の色付きの引用リンク (hyperref) を防止して、テキストの色を黒にリセットするにはどうすればよいですか?](https://rvso.com/image/357881/tikz%20%E3%83%8E%E3%83%BC%E3%83%89%20%5Bfill%3Dblack%2C%20text%3Dwhite%5D%20%E5%86%85%E3%81%AE%E8%89%B2%E4%BB%98%E3%81%8D%E3%81%AE%E5%BC%95%E7%94%A8%E3%83%AA%E3%83%B3%E3%82%AF%20(hyperref)%20%E3%82%92%E9%98%B2%E6%AD%A2%E3%81%97%E3%81%A6%E3%80%81%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%AE%E8%89%B2%E3%82%92%E9%BB%92%E3%81%AB%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
次の MWE は問題を示しています。
\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The {LaTeX} Companion},
date = 1994,
edition = 1,
publisher = {Addison-Wesley},
location = {Reading, Mass.},
pagetotal = 528,
langid = {english},
langidopts = {variant=american},
sorttitle = {LaTeX Companion},
indextitle = {LaTeX Companion, The},
shorttitle = {LaTeX Companion},
}
\end{filecontents}
\usepackage[english]{babel}
\usepackage[autolang=other,
style=alphabetic,
backend=biber,
%backref=true,
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{tikz}
\usepackage[pdfencoding=auto,
final=true,
colorlinks=true,
citecolor=yellow,
% linkcolor=blue,
% anchorcolor=purple,
% urlcolor=green,
]{hyperref}
\begin{document}
\begin{tikzpicture}
\node[draw, rectangle,
minimum height=100mm,
text width=10cm,
align=center,
fill=black,
text=white,] {\huge
%\hypersetup{citecolor=green}
Hello World!
\cite[p. 100]{companion}
Where am I? %you are there, but invisible due to wrong text color
\textcolor{white}{Ahh, hello again!}
};
\end{tikzpicture}
\noindent
I have two problems:
\begin{enumerate}
\item
Manually resetting the textcolor is inefficient and
\item
even if the textcolor is reset right after the cite command the text until the cite's closing bracket ', p. 100]' is not affected (it remains invisible).
\end{enumerate}
Question: Is there a comfortable solution to get the cite mark colored?
\printbibliography
\end{document}
何が間違っているのでしょうか? 私のビルド環境: Win7-64、Texlive 2017、luaLaTeX
答え1
パッケージ (TeXLive-2017、MiKTeX)で生成された OCG カラー リンクは、ocgx2
報告された両方の問題を修正しているように見えますが、さらに、OCG カラー リンクが現在のテキスト カラーで紙に印刷されるという利点もwhite
あります。
\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The {LaTeX} Companion},
date = 1994,
edition = 1,
publisher = {Addison-Wesley},
location = {Reading, Mass.},
pagetotal = 528,
langid = {english},
langidopts = {variant=american},
sorttitle = {LaTeX Companion},
indextitle = {LaTeX Companion, The},
shorttitle = {LaTeX Companion},
}
\end{filecontents}
\usepackage[english]{babel}
\usepackage[autolang=other,
style=alphabetic,
backend=biber,
%backref=true,
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{tikz}
\usepackage[pdfencoding=auto,
final=true,
% colorlinks=true,
citecolor=yellow,
% linkcolor=blue,
% anchorcolor=purple,
% urlcolor=green,
]{hyperref}
\usepackage[ocgcolorlinks]{ocgx2}
\begin{document}
\begin{tikzpicture}
\node[draw, rectangle,
minimum height=100mm,
text width=10cm,
align=center,
fill=black,
text=white,] {\huge
%\hypersetup{citecolor=green}
Hello World!
\cite[p. 100]{companion}
Where am I?
%\textcolor{white}{Ahh, hello again!}
Ahh, hello again!
};
\end{tikzpicture}
%\noindent
%I have two problems:
%\begin{enumerate}
%\item
%Manually resetting the textcolor is inefficient and
%
%\item
%even if the textcolor is reset right after the cite command the text until the cite's closing bracket ', p. 100]' is not affected (it remains invisible).
%\end{enumerate}
%
%Question: Is there a comfortable solution to get the cite mark colored?
\printbibliography
\end{document}