diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/normalcolor |
Initial commit
Diffstat (limited to 'macros/latex/contrib/normalcolor')
-rw-r--r-- | macros/latex/contrib/normalcolor/README | 92 | ||||
-rw-r--r-- | macros/latex/contrib/normalcolor/makefile | 117 | ||||
-rw-r--r-- | macros/latex/contrib/normalcolor/normalcolor.dtx | 398 | ||||
-rw-r--r-- | macros/latex/contrib/normalcolor/normalcolor.pdf | bin | 0 -> 154998 bytes |
4 files changed, 607 insertions, 0 deletions
diff --git a/macros/latex/contrib/normalcolor/README b/macros/latex/contrib/normalcolor/README new file mode 100644 index 0000000000..d639f4c7ad --- /dev/null +++ b/macros/latex/contrib/normalcolor/README @@ -0,0 +1,92 @@ +normalcolor +Copyright (c) Markus Kohm, 2016 +---------------------------------------------------------------------------- +This work may be distributed and/or modified under the conditions of +the LaTeX Project Public License, version 1.3c of the license. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainer and author of this work is Markus Kohm. + +The work consists of the file `normalcolor.dtx` only. +---------------------------------------------------------------------------- +SHORT DESCRIPTION + +The package simple provides a command `\setnormalcolor` with the same +syntax as command `\color' either of package `color' or package `xcolor'. +But `\setnormalcolor' will not change the current colour but the normal +colour. So using `\normalcolor' (implicit or explicit) afterwards will +change the current colour to the colour given by the previous +`\setnormalcolor'. +---------------------------------------------------------------------------- +PACKAGE GENERATION + +Simple way: + +To use the simple way you need the original `makefile' from the source +distribution of `normalcolor' and `GNU make'. Then you can use: + + make all + +to generate all files of `normalcolor'. + +Manual way: + +If you cannot use make you can extract all the files using: + + tex normalcolor.dtx + +Note that you have to use `tex' not any LaTeX format! + +This will generate files `normalcolor.sty' and `README.txt'. Rename the +generated `README.txt' to `README'. + +To make the documentation use: + + pdflatex normalcolor.dtx + pdflatex normalcolor.dtx + mkindex normalcolor + pdflatex normalcolor.dtx + pdflatex normalcolor.dtx + +This will result in the manual file `normalcolor.pdf'. +---------------------------------------------------------------------------- +INSTALLATION + +Simple way: + +To use the simple way you need the original `makefile' from the source +distribution of `normalcolor' and `GNU make' and a TeX-Live-compatible +`kpsewhich'. Then you can use: + + make install + +to install normalcolor into your personal TEXMF tree. If you want to use +the local TEXMF tree instead of the personal one, you may use: + + make INSTALLLOCAL=true install + +If you want to use another TEXMF tree, you may use + + make INSTALLROOT=<path to the TEXMF tree> install + +Manual way: + +Copy `normalcolor.sty' to `tex/latex/normalcolor/' inside the TDS tree you +want to install `normalcolor'. + +Copy `normalcolor.pdf' and `README.txt' as `README' to +`doc/latex/normalcolor/' inside the TDS tree you want to install +`normalcolor'. + +Maybe you have to call `texhash' for the TDS tree you have installed +`normalcolor'. +---------------------------------------------------------------------------- +USAGE + +See `normalcolor.pdf'. +---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/normalcolor/makefile b/macros/latex/contrib/normalcolor/makefile new file mode 100644 index 0000000000..85e45155ba --- /dev/null +++ b/macros/latex/contrib/normalcolor/makefile @@ -0,0 +1,117 @@ +# +# makefile +# Copyright (c) Markus Kohm, 2016 +# +# This work may be distributed and/or modified under the conditions of +# the LaTeX Project Public License, version 1.3c of the license. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3c or later is part of all distributions of LaTeX +# version 2005/12/01 or later. +# +# This work has the LPPL maintenance status "maintained". +# +# The Current Maintainer and author of this work is Markus Kohm. +# +# The work consists of the file `normalcolor.dtx` only. +# + +PACKAGENAME = normalcolor + +RM = rm -f +CP = cp -a +SED = sed +CUT = cut +ECHO = echo +TeX = tex -interaction=batchmode +PDFTeX = pdflatex -interaction=batchmode +MKINDEX = mkindex +INSTALLFILES = install +INSTALLDIRS = install -d +CTANIFY = ctanify + +GETTEXMFLOCAL = kpsewhich -var-value=TEXMFLOCAL | cut -d: -f1 +GETTEXMFHOME = kpsewhich -var-value=TEXMFHOME | cut -d: -f1 + +TEXHASH = texhash + +SOURCEFILES = normalcolor.dtx makefile +UNSOURCEFILES= README.txt normalcolor.sty normalcolor-example.tex +LATEXFILES = normalcolor.sty +DOCFILES = normalcolor.pdf README +DISTFILES = $(SOURCEFILES) $(LATEXFILES) $(DOCFILES) + +CTANIFYEXTRA = --tdsonly normalcolor-example.tex \ + normalcolor-example.tex=doc/latex/normalcolor + +DATE = $(word 2, $$Date: 2016-03-18 15:00:44 +0100 (Fr, 18 Mär 2016) $$) +YEAR = $(shell $(ECHO) $(DATE) | $(CUT) -d- -f1) + +ifdef INSTALLLOCAL +INSTALLROOT = $(shell $(GETTEXMFLOCAL)) +else +INSTALLROOT = $(shell $(GETTEXMFHOME)) +endif + +ifeq ($(INSTALLROOT),) +$(error Installation TDS root dir not found) +endif + +SOURCEDIR = $(INSTALLROOT)/source/latex/$(PACKAGENAME) +DOCDIR = $(INSTALLROOT)/doc/latex/$(PACKAGENAME) +LATEXDIR = $(INSTALLROOT)/tex/latex/$(PACKAGENAME) + +all: info $(DISTFILES) + +info: + $(info Installation TDS root dir: $(INSTALLROOT)) + $(info Installation of source files to: $(SOURCEDIR)) + $(info Installation of LaTeX files to: $(LATEXDIR)) + $(info Installation of docu files to: $(DOCDIR)) + +makefile: makefile.in +ifeq ($(YEAR),2016) + $(CP) $< $@ +else + $(SED) 's/^# Copyright (c) Markus Kohm, 2016$$/\1-$(YEAR)/' $< >$@ +endif + $(SED) -i 's/^\(# makefile\)\.in$$/\1/' $@ + +README: README.txt + $(CP) $< $@ + +$(UNSOURCEFILES): $(SOURCEFILES) + $(TeX) $< + +normalcolor.pdf: $(SOURCEFILES) + $(PDFTeX) $< + $(PDFTeX) $< + $(MKINDEX) $(basename $<) + $(PDFTeX) $< + $(PDFTeX) $< + +install: $(DISTFILES) + $(INSTALLDIRS) $(DOCDIR) $(LATEXDIR) $(SOURCEDIR) + $(INSTALLFILES) $(DOCFILES) $(DOCDIR) + $(INSTALLFILES) $(LATEXFILES) $(LATEXDIR) + $(INSTALLFILES) $(SOURCEFILES) $(SOURCEDIR) + $(TEXHASH) $(INSTALLROOT) + +dist: $(DISTFILES) + $(CTANIFY) -p $(PACKAGENAME) \ + $(foreach latexfile,$(LATEXFILES),--tdsonly $(latexfile) )\ + $(CTANIFYEXTRA) \ + $(LATEXFILES) \ + $(SOURCEFILES) \ + $(DOCFILES) + +clean: + $(RM) *~ *.aux *.glo *.gls *.hd *.idx *.ilg *.ind *.log *.out *.toc \ + *.synctex.gz + +allclean: clean + $(RM) $(UNSOURCEFILES) $(DOCFILES) $(PACKAGENAME).tar.gz \ + $(PACKAGENAME).tds.zip + $(RM) -r auto + +.PHONY: all info install dist clean allclean diff --git a/macros/latex/contrib/normalcolor/normalcolor.dtx b/macros/latex/contrib/normalcolor/normalcolor.dtx new file mode 100644 index 0000000000..c48f3ba3fe --- /dev/null +++ b/macros/latex/contrib/normalcolor/normalcolor.dtx @@ -0,0 +1,398 @@ +% \CheckSum{129} +% \iffalse^^A meta-comment +% ====================================================================== +% normalcolor.dtx +% Copyright (c) Markus Kohm, 2016 +% +% This work may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, version 1.3c of the license. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer and author of this work is Markus Kohm. +% +% The work consists of the file `normalcolor.dtx` only. +% ====================================================================== +% \fi^^A meta-comment +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \iffalse^^A meta-comment +%<*package> +% From File: $Id: normalcolor.dtx 11 2016-03-22 07:55:35Z mjk $ +%</package> +%<*dtx> +\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi +%</dtx> +%<package>\NeedsTeXFormat{LaTeX2e}[1995/12/01] +%<*dtx|package> +\begingroup + \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} + \filedate$Date: 2016-03-22 08:55:35 +0100 (Di, 22 Mär 2016) $ + \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} + \filerevision$Revision: 11 $ +\endgroup +%</dtx|package> +%<*dtx> +\ProvidesFile{normalcolor.dtx}[% +%</dtx> +%<package>\ProvidesPackage{normalcolor}[% +%<*dtx|package> + \filedate \space\filerevision\space + simple (x)color extension package] +%</dtx|package> +%<*dtx> +\ifx\documentclass\undefined + \input docstrip.tex + \keepsilent + \askforoverwritefalse + \usedir{tex/latex/normalcolor} + \generate{% + \file{normalcolor.sty}{% + \from{normalcolor.dtx}{package}% + }% + \file{normalcolor-example.tex}{% + \from{normalcolor.dtx}{example}% + }% + }% + \generate{\nopreamble\nopostamble + \file{README.txt}{% + \from{normalcolor.dtx}{README}% + }% + }% +\else + \let\endbatchfile\relax +\fi +\endbatchfile +%</dtx> +%<*driver> + \documentclass{ltxdoc} + \usepackage{hypdoc} + \CodelineIndex + \RecordChanges + \GetFileInfo{normalcolor.dtx} + \begin{document} + \DocInput{\filename} + \end{document} +%</driver> +% \fi^^A meta-comment +% +% \changes{r0}{2016/03/18}{Start of project} +% \changes{r11}{2016/03/22}{First release} +% +% \title{The \texttt{(x)color} Extension Package \texttt{normalcolor}\\ +% Revision~\fileversion} +% \date{\filedate} +% \author{Markus Kohm} +% \maketitle +% \begin{abstract} +% Packages \texttt{color} and \texttt{xcolor} provide excellent features for +% managing and using colours. There is only one little feature sometimes +% missing: Setting up the default colour of \cs{normalcolor}. The only +% purpose of \texttt{normalcolor} is to extend both packages by exactly this +% single feature. +% \end{abstract} +% \tableofcontents +% +% \section{Loading \texttt{normalcolor}} +% +% You can load package \texttt{normalcolor} as you load all other packages, +% too: +% \begin{verbatim} +% \usepackage{normalcolor} +% \end{verbatim} +% \vskip-\baselineskip +% Note: It does not matter whether you load +% \texttt{color}\footnote{\url{http://ctan.org/pkg/color}} or +% \texttt{xcolor}\footnote{\url{http://ctan.org/pkg/xcolor}} before or after +% \texttt{normalcolor}. Even using neither \texttt{color} nor \texttt{xcolor} +% would not blame \texttt{normalcolor}, but then it would be completely +% useless. +% +% \section{Setting up the Normal Colour} +% +% \DescribeMacro{\setnormalcolor} This command has the same arguments like +% \cs{color}. See the documentation of either package +% \texttt{color}\footnotemark[1] or package \texttt{xcolor}\footnotemark[2] +% (depending on the one you are using) for the syntax. But in opposite to +% \cs{color} it does not change the current colour but the colour of all +% implicit or explicit usages of \cs{normalcolor}. +% +% If you use the command before |\begin{document}| it will also change the +% initial colour of the document. +% +% \DescribeMacro{\resetnormalcolor} +% This command, which has no argument, changes the colour of \cs{normalcolor} +% into the current colour. If you use it before |\begin{document}| it will be +% delayed until |\begin{document}| and therefore also changes the current +% colour at the start of the document. But after |\begin{document}| it will +% only change \cs{normalcolor} without changing the current colour. +% +% \StopEventually{\PrintChanges\PrintIndex} +% +% \iffalse^^A meta-comment +% We do not need documentation of the README or the makefile in the manual. +%<*README> +% \begin{macrocode} +normalcolor +Copyright (c) Markus Kohm, 2016 +---------------------------------------------------------------------------- +This work may be distributed and/or modified under the conditions of +the LaTeX Project Public License, version 1.3c of the license. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainer and author of this work is Markus Kohm. + +The work consists of the file `normalcolor.dtx` only. +---------------------------------------------------------------------------- +SHORT DESCRIPTION + +The package simple provides a command `\setnormalcolor` with the same +syntax as command `\color' either of package `color' or package `xcolor'. +But `\setnormalcolor' will not change the current colour but the normal +colour. So using `\normalcolor' (implicit or explicit) afterwards will +change the current colour to the colour given by the previous +`\setnormalcolor'. +---------------------------------------------------------------------------- +PACKAGE GENERATION + +Simple way: + +To use the simple way you need the original `makefile' from the source +distribution of `normalcolor' and `GNU make'. Then you can use: + + make all + +to generate all files of `normalcolor'. + +Manual way: + +If you cannot use make you can extract all the files using: + + tex normalcolor.dtx + +Note that you have to use `tex' not any LaTeX format! + +This will generate files `normalcolor.sty' and `README.txt'. Rename the +generated `README.txt' to `README'. + +To make the documentation use: + + pdflatex normalcolor.dtx + pdflatex normalcolor.dtx + mkindex normalcolor + pdflatex normalcolor.dtx + pdflatex normalcolor.dtx + +This will result in the manual file `normalcolor.pdf'. +---------------------------------------------------------------------------- +INSTALLATION + +Simple way: + +To use the simple way you need the original `makefile' from the source +distribution of `normalcolor' and `GNU make' and a TeX-Live-compatible +`kpsewhich'. Then you can use: + + make install + +to install normalcolor into your personal TEXMF tree. If you want to use +the local TEXMF tree instead of the personal one, you may use: + + make INSTALLLOCAL=true install + +If you want to use another TEXMF tree, you may use + + make INSTALLROOT=<path to the TEXMF tree> install + +Manual way: + +Copy `normalcolor.sty' to `tex/latex/normalcolor/' inside the TDS tree you +want to install `normalcolor'. + +Copy `normalcolor.pdf' and `README.txt' as `README' to +`doc/latex/normalcolor/' inside the TDS tree you want to install +`normalcolor'. + +Maybe you have to call `texhash' for the TDS tree you have installed +`normalcolor'. +---------------------------------------------------------------------------- +USAGE + +See `normalcolor.pdf'. +---------------------------------------------------------------------------- +% \end{macrocode} +%</README> +% \fi^^A meta-comment +% +% \section{Example} +% +% Try the following example and have a look at the page numbers in the table +% of contents and the page footer. All these, except the section page numbers +% in the table of contents, are printed using |\normalcolor|: +% +% \iffalse^^A meta-comment +%<*example> +% \fi^^A meta-comment +% \begin{macrocode} +\listfiles +\documentclass{article} + +\usepackage{normalcolor} +\setnormalcolor{green} +\usepackage{xcolor} + +\usepackage{blindtext} +\begin{document} +\color{blue} +\tableofcontents +\blinddocument +\setnormalcolor{red} +\blinddocument + +\resetnormalcolor +\blinddocument +\end{document} +% \end{macrocode} +% \iffalse^^A meta-comment +%</example> +% \fi^^A meta-comment^ +% +% \section{Implementation} +% +% The package does not have any options. So we just call +% \iffalse^^A meta-comment +%<*package> +% \fi^^A meta-comment +% \begin{macrocode} +\ProcessOptions\relax +% \end{macrocode} +% +% \begin{macro}{\resetnormalcolor} +% This is the very simple first version of the command. Before +% |\begin{documet}| it simply delays itself until |\begin{document}|. +% \begin{macrocode} +\DeclareRobustCommand*{\resetnormalcolor}{\AtBeginDocument{\resetnormalcolor}} +% \end{macrocode} +% To make this work, we need to redefine it at |\begin{document}|: +% \begin{macrocode} +\AtBeginDocument{% + \let\resetnormalcolor\relax + \DeclareRobustCommand*{\resetnormalcolor}{% + \ifdefined\default@color + \ifdefined\current@color + \let\default@color\current@color + \fi + \fi + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setnormalcolor} +% \begin{macro}{\@setnormalcolor} +% \begin{macro}{\@@setnormalcolor} +% Note, that changing the default colour before loading either +% \texttt{color} or \texttt{xcolor} does not work, because these packages +% set |\default@color| themselves at |\begin{document}|. But indeed in this +% case it is much more simple, because we just have to set up the wanted +% colour. +% \begin{macrocode} +\DeclareRobustCommand*{\setnormalcolor}{% + \@ifnextchar [%] + \@@setnormalcolor\@setnormalcolor +} +\newcommand*{\@@setnormalcolor}[2][]{% + \AtBeginDocument{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname color\endcsname\relax\else + \color[{#1}]{#2}\let\default@color\current@color + \fi + }% +} +\newcommand*{\@setnormalcolor}[1]{% + \AtBeginDocument{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname color\endcsname\relax\else + \color{#1}\let\default@color\current@color + \fi + }% +} +% \end{macrocode} +% After |\begin{document}| we need another definition of |\@@setnormalcolor| +% and |\@setnormalcolor|. In this case we need to change |\default@color| +% without changing |\current@color|. This may be done using a trick. +% \begin{macrocode} +\AtBeginDocument{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname color\endcsname\relax + \renewcommand*{\@@setnormalcolor}[2][]{}% + \let\@setnormalcolor\@gobble + \else + \renewcommand*{\@@setnormalcolor}[2][]{% + \begingroup + \color[{#1}]{#2}% + \edef\reserved@a{% + \noexpand\endgroup + \noexpand\def\noexpand\default@color{% + \unexpanded\expandafter{\current@color}% + }% + }% + \reserved@a + }% + \renewcommand*{\@setnormalcolor}[1]{% + \begingroup + \color{#1}% + \edef\reserved@a{% + \noexpand\endgroup + \noexpand\def\noexpand\default@color{% + \unexpanded\expandafter{\current@color}% + }% + }% + \reserved@a + }% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \iffalse^^A meta-comment +%</package> +% \fi^^A meta-comment +% +% \Finale +% +\endinput +% +% end of file `normalcolor.dtx' + +%%% Local Variables: +%%% mode: doctex +%%% mode: flyspell +%%% ispell-local-dictionary: "en_GB" +%%% TeX-master: t +%%% End: diff --git a/macros/latex/contrib/normalcolor/normalcolor.pdf b/macros/latex/contrib/normalcolor/normalcolor.pdf Binary files differnew file mode 100644 index 0000000000..2b6e7b5eb2 --- /dev/null +++ b/macros/latex/contrib/normalcolor/normalcolor.pdf |