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 all 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
13 changes: 11 additions & 2 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ \section{Replacement for the legacy mark mechanism}

\section{News from Tagged PDF project}

The \texttt{testphase} key now takes also the value \texttt{latest}.
The \texttt{testphase} key now takes also the value \texttt{latest}.
This will load all modules that we recommend
so that it is not necessary to specify individual modules. The list of loaded modules
will be adjusted as needed when the project progresses. It is also written to the log.
Expand Down Expand Up @@ -466,6 +466,15 @@ \subsection{Process global options once per package}
%
\githubissue{1619}

\section{Documentation}
\subsection{Clarifying space handling of \cs{textcolor}}

In contrast to other \cs{text}-commands like \cs{textbf} or \cs{textrm},
the command \cs{textcolor} gobbles spaces at the start of its argument, so \verb=Hello\textcolor{red}{ World}= will output Hello\textcolor{red}{ World}.
There are technical as well as compatibility reasons for this, so the behavior will not change. This has now been clarified in the documentation.
%
\githubissue{1474}

%\section{Changes to packages in the \pkg{amsmath} category}

\section{Changes to packages in the \pkg{graphics} category}
Expand Down Expand Up @@ -498,7 +507,7 @@ \subsection{\pkg{multicol}:\ Full support for extended marks}
\subsection{\pkg{array}:\ Improve preamble setup code for \texttt{p} and friends}

While the preamble of a \env{tabular} or \env{array} is being built
the arguments to \texttt{p}, \texttt{m}, or \texttt{b} columns got
the arguments to \texttt{p}, \texttt{m}, or \texttt{b} columns got
expanded several times. This is normally harmless because that
argument contains usually just a dimension. However, in a case like
\verb=p{\fpeval{15}pt}= this resulted in an error, because \cs{fpeval}
Expand Down
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. In contrast to |\textrm|, the command gobbles spaces
% 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
14 changes: 8 additions & 6 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 @@ -231,8 +231,9 @@ \subsubsection{Using predefined colours}
\end{decl}

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

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}|}|. In contrast to |\textbf|,
the command gobbles spaces at the start of its argument, so |Hello\textcolor{red}{ World}| will output Hello\textcolor{red}{ World}.

\subsection{Using Colours in math formulas}

Expand Down
Loading