我可以让我的\captionof
s 变成蓝色。
我可以让我的\makenote
s 变成蓝色。
但似乎无论我怎么努力,我都无法让s\captionof
中的 s\makenote
变成蓝色。
例子
\documentclass[]{scrbook}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{caption}%
\captionsetup{compatibility=false}%
\usepackage{scrlayer-scrpage}
\usepackage{scrlayer-notecolumn} %must be loaded ``Lastest''
\RedeclareNoteColumn[font = \color{blue}]{marginpar} %default
\DeclareCaptionFont{bluecaptionfont}{\color{blue}}
\captionsetup{font={bluecaptionfont}, labelfont=bluecaptionfont}
\begin{document}
here is the main text
\makenote*{
\includegraphics[width=3cm]{example-grid-100x100pt}
\captionof{figure}{This should be blue}
}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=8cm]{example-grid-100x100pt}
\captionof{figure}{Normal captionof's are blue}
\end{minipage}
\makenote*{
Normal notes are blue
}
\end{document}
远亲相关:如何将 vspaces 插入到 scrlayer-notecolumn marginnote 中?
输出
答案1
scrlayer-notecolumn
v0.2.3085 来自SourceForge 上的 KOMA-Script 源代码库已经支持使用 LuaLaTeX 或 PDFLaTeX 的注释列中的颜色(但不支持使用 XeLaTeX)。因此,问题中的示例结果如下:
答案2
\makenote*
重新定义\color
为不执行任何操作,因此字幕的内部代码无法更改颜色。您可以使用其他命令,但请注意,\makenote*
重新定义可能有原因:蓝色很可能会泄露。
\documentclass[]{scrbook}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{caption}%
\captionsetup{compatibility=false}%
\usepackage{scrlayer-scrpage}
\usepackage{scrlayer-notecolumn} %must be loaded ``Lastest''
\RedeclareNoteColumn[font = \color{blue}]{marginpar} %default
\let\mycolorcommand\color
\DeclareCaptionFont{bluecaptionfont}{\mycolorcommand{blue}}
\captionsetup{font={bluecaptionfont}, labelfont=bluecaptionfont}
\begin{document}
here is the main text
\makenote*{
\includegraphics[width=3cm]{example-grid-100x100pt}
\captionof{figure}{This should be blue}
}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=8cm]{example-grid-100x100pt}
\tracingmacros=1 \captionof{figure}{Normal captionof's are blue}
\end{minipage}
\makenote*{
Normal notes are blue
}
\end{document}
一个可能更安全的选择是局部重新定义\normalcolor
。然后标题不能重置颜色,注释中的颜色获胜:
\makenote*{
\includegraphics[width=3cm]{example-grid-100x100pt}
\let\normalcolor\relax
\captionof{figure}{This should be blue}
}