1

Suppose I'm using the FiXme package:

\usepackage{fixme}
\fxsetup{
    status=draft,
    author= ,
    layout=inline,
    theme=color}
\definecolor{fxnote}{rgb}{0,0,0}    % black
\definecolor{fxwarning}{rgb}{0,0,0} % black
\definecolor{fxerror}{rgb}{0,0,0}   % black
\colorlet{fxnotebg}{green}     % define the background colour:
\colorlet{fxwarningbg}{yellow} % define the background colour:
\colorlet{fxerrorbg}{red}      % define the background colour:
% redefine the layout macro:
\makeatletter
\renewcommand*\FXLayoutInline[3]{%
  \@fxdocolon {#3}{%
    \@fxuseface {inline}%
    \begingroup
      \sethlcolor{fx#1bg}%
      \color {fx#1}\ignorespaces \hl{#3\@fxcolon #2}%
    \endgroup}}
\makeatother

in which I have three different background colors - red, yellow, and green - which are invoked using \fxerror{...}, \fxwarning{...}, and \fxnote{...}, respectively.

How do I make these background colors appear in the List of Corrections? As of now, the notes appear in the traditional way, i.e. black characters on a white background.

  • I don't know the command \sethlcolor... Where is it from? – user31729 Nov 11 '14 at 9:59
2

You can redefine \FXLayoutContentsLine to add the background color also in the List of Fixmes; a possible redefinition would be:

\renewcommand*\FXLayoutContentsLine[3]{%
  \iffx@mode@multiuser%
    \fxaddcontentsline{\ignorespaces#3 \protect\sethlcolor{fx#1bg}\color{fx#1}\hl{\fxnotename{#1}: #2}}%
  \else%
    \fxaddcontentsline{\protect\sethlcolor{fx#1bg}\color{fx#1}\hl{\fxnotename{#1}: #2}}%
  \fi}

A complete example

\documentclass{article}    
\usepackage{xcolor}
\usepackage{soul}
\usepackage{fixme}
\fxsetup{
    status=draft,
    author= ,
    layout=inline,
    theme=color}
\definecolor{fxnote}{rgb}{0,0,0}    % black
\definecolor{fxwarning}{rgb}{0,0,0} % black
\definecolor{fxerror}{rgb}{0,0,0}   % black
\colorlet{fxnotebg}{green!60}     % define the background colour:
\colorlet{fxwarningbg}{yellow!60} % define the background colour:
\colorlet{fxerrorbg}{red!60}      % define the background colour:
% redefine the layout macro:
\makeatletter
\renewcommand*\FXLayoutInline[3]{%
  \@fxdocolon {#3}{%
    \@fxuseface {inline}%
    \begingroup
      \sethlcolor{fx#1bg}%
      \color {fx#1}\ignorespaces \hl{#3\@fxcolon #2}%
    \endgroup}}

\renewcommand*\FXLayoutContentsLine[3]{%
  \iffx@mode@multiuser%
    \fxaddcontentsline{\ignorespaces#3 \protect\sethlcolor{fx#1bg}\color{fx#1}\hl{\fxnotename{#1}: #2}}%
  \else%
    \fxaddcontentsline{\protect\sethlcolor{fx#1bg}\color{fx#1}\hl{\fxnotename{#1}: #2}}%
  \fi}
\makeatother

\begin{document}
\listoffixmes

Some regular text
\fxnote{Some test note}
\fxwarning{Some test warning}
\fxnote{Another test note}
\fxnote{Yet another test note}
\fxerror{Some test error}
\fxwarning{Another test warning}
\fxerror{Another test error}

\end{document}

The result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.