[Tex/LaTex] ConTeXt: Change the default text colour for entire document

colorcontextcontext-mkivdocument-configuration

Background

I am looking to change the text colour for a document from black to a different dark colour.

Problem

The documentation shows how to change individual colours for a text document, but does not show how to change the base black colour. This includes body text, page numbers, footnotes, headings, table of contents, indices, bibliographies, and so forth.

However, changing the base text colour should not preclude overriding the text colour later on (e.g., to change the heading colour). I would like to override every aspect that uses the default black without having to know or program each aspect individually.

Code

The following fails to set the footnote colour and the table border colour — and there might be other aspects that use the default black that I don't know about:

\setupcolors[textcolor=red]
\setupinmargin[color=red] 

\starttext
\completecontent

\section{A test}
\inmargin{a test}

\placetable{Caption}
{\bTABLE
\bTR \bTD One \eTD \bTD two \eTD \eTR
\bTR \bTD One \eTD \bTD two \eTD \eTR
\eTABLE}

\input tufte

\section{Another test}
\index{test}Test footnotes\footnote[f]{A footnote test.} and \seeindex{test}{index}indexes.

\page
\placeindex

\stoptext

Question

How do you change the default base black colour throughout the entire document, without having to configure all aspects individually?

Note

ConTeXt should use a single colour that all text inherits. It should then be possible to change that single instance to ensure the new base colour is applied consistently throughout the document.

Related

Best Answer

In ConTeXt mkii you need to specify \setupcolors[state=start]. If on the other hand, you are using ConTeXt mkiv, and want to specify a color for the margin, it must be set in the options of said margin, or else it will reset to default. So the margin is set with \setupinmargin[color=red]

The example that follows is with whatever color you want in the document, while keeping the page numbering color.

The second option, which I assume that based in your comment is what you want, will let you specify the color for the whole document.

The third option is with ConTeXt mkiv.

The fourth option is with ConTeXt mkiv in which the margin is set throughout the document by \setupinmargin[line=13]

The fifth example will show you that footnotes are also possible. In the following, we will use ConTeXt mkii to set footnotes throughout the document. To do so, the footnotes must be enclosed within an environment which is set with the command \placelocalfootnotes or else the footnotes won't appear in the document.

The sixth example is also with ConTeXt mkii, in which the \color command will take over. This time around the \color is grouped within the footnote, while the footnote is set in the preamble of the document. The option state=start must be specified, as well as the color option for the margin.



\setupinmargin[location=right,style=slanted,color=red]
\setupcolors[state=start]
\starttext
\startcolor[red] 
\section{A test}
\inmargin{Just a test}
\input tufte 
\input zapf    

\section{Another test}

\input knuth   
a test 
\dorecurse{2}{\input zapf \par \input tufte} 
\stoptext

enter image description here



\setupinmargin[location=right,style=slanted,color=red]
\setupcolors[state=start,textcolor=red]
\starttext

\section{A test} 
\inmargin{a test}adjust your margins to accommodate the type.  
\input tufte 
\input zapf    

\section{Another test}

\input knuth   
a test 
\dorecurse{2}{\input zapf \par \input tufte} 
\stoptext   

enter image description here



\setupcolors[textcolor=red]
\setupinmargin[color=red,style=slanted] 
\starttext 

\section{A test} 
\inmargin{a test} 
\input tufte  
\input zapf      

\section{Another test}  

\input knuth   
a test 
\dorecurse{2}{\input zapf \par \input tufte}  
\stoptext    

enter image description here



\setupcolors[textcolor=red]
\setupinmargin[line=13,color=red,style=slanted,] 

\starttext 
\section{A test} 
\inmargin{a test}

\input tufte  
\input zapf      

\section{Another test}   
\inmargin{another\\ test}
\input knuth   
a test 

\dorecurse{2}{\input zapf \inmargin{ another\\ test\\ of tests} \par \input tufte}    
\stoptext    

enter image description here enter image description here


\setupcolors[state=start,textcolor=red,]
\setupfootnotes[,conversion=Romannumerals,]
\starttext  
\section{A Test}
\dorecurse{2}{\input zapf \par \startlocalfootnotes Nota \footnote[]{Bene}\stoplocalfootnotes \input tufte}

\placelocalfootnotes
\pagebreak
\dorecurse{2}{\input tufte \par \input zapf}

\stoptext

enter image description here


\setupcolors[state=start,textcolor=red]
\setupinmargin[line=23,color=darkgreen,]
\setupfootnotes[color=green]
\starttext

a test\footnote{\red some nonsense text to test it out.}
\dorecurse{4}{\input hawking \footnote{ \darkblue If in 2600 you stacked all the new books being published next to
each other, you would have to move at ninety miles an hour just to
keep up with the end of the line. Of course, by 2600 new artistic
and scientific work will come in electronic forms, rather than as
physical books and paper. Nevertheless, if the exponential growth
continued, there would be ten papers a second in my kind of
theoretical physics, and no time to read them.}}\inright{This artificial \\ Wild West\\ became America's Iliad.}

\stoptext

enter image description here