Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for textcolor for gh1474 #1629

Merged
merged 8 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions required/graphics/color.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
%<driver> \ProvidesFile{color.drv}
% \fi
% \ProvidesFile{color.dtx}
[2024/06/23 v1.3e Standard LaTeX Color (DPC)]
[2025/01/14 v1.3e Standard LaTeX Color (DPC)]
%
% \iffalse
%<*driver>
Expand Down Expand Up @@ -458,7 +458,9 @@
% specified colour, but then the colour reverts to its previous value.
% The naming is by analogy with |\textrm| (as opposed to |\rm| and
% |\rmfamily|) although it is slightly a misnomer as the command also
% works in math-mode.
% works in math-mode. Differently to |\textrm| the command gobbles spaces
u-fischer marked this conversation as resolved.
Show resolved Hide resolved
% at the begin of its argument, so |Hello\textcolor{red}{ World}| will
% output Hello\textcolor{red}{ World}.
%
% Since December 95, in fact this command has one other difference
% from |\color|. It calls |\leavevmode| to ensure the start of
Expand Down
12 changes: 7 additions & 5 deletions required/graphics/grfguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
\title{Packages in the `graphics' bundle}
\author{D. P. Carlisle \and The \LaTeX\ Project}

\date{2024-12-31}
\date{2025-01-14}

\maketitle

Expand Down Expand Up @@ -232,7 +232,8 @@ \subsubsection{Using predefined colours}

This is a \emph{declaration}, like |\bfseries|. It changes the current
colour to \m{name} until the end of the current group or
environment.
environment. It does not automatically start horizontal mode so typically at
the begin of a paragraph it should be used in combination with a |\leavevmode|.
u-fischer marked this conversation as resolved.
Show resolved Hide resolved

An alternative command syntax is to use a \emph{command} form that
takes the text to be coloured as an \emph{argument}. This is similar
Expand All @@ -242,9 +243,10 @@ \subsubsection{Using predefined colours}
|\textcolor|\arg{name}\arg{text}
\end{decl}


So the above is essentially equivalent to
|{\color|\arg{name}\emph{text}|}|.
The command switches to horizontal mode,
so the above is essentially equivalent to
|{\leavevmode\color|\arg{name}\emph{text}|}|. Differently to |\textbf|
u-fischer marked this conversation as resolved.
Show resolved Hide resolved
the command gobbles spaces at the begin of its argument, so |Hello\textcolor{red}{ World}| will output Hello\textcolor{red}{ World}.
u-fischer marked this conversation as resolved.
Show resolved Hide resolved

\subsection{Using Colours in math formulas}

Expand Down
Loading