Debian Codegraph @

texmf-dist/source/latex/pdfcolfoot/pdfcolfoot.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: pdfcolfoot.dtx
4 % Version: 2023-01-10 v1.4
5 % Info: Color stack for footnotes with pdfTeX
6 %
7 % Copyright (C)
8 % 2007, 2012 Heiko Oberdiek
9 % 2016-2023 Oberdiek Package Support Group
10 % https://github.com/ho-tex/pdfcolfoot/issues
11 %
12 % This work may be distributed and/or modified under the
13 % conditions of the LaTeX Project Public License, either
14 % version 1.3c of this license or (at your option) any later
15 % version. This version of this license is in
16 % https://www.latex-project.org/lppl/lppl-1-3c.txt
17 % and the latest version of this license is in
18 % https://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of
20 % LaTeX version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status "maintained".
23 %
24 % The Current Maintainers of this work are
25 % Heiko Oberdiek and the Oberdiek Package Support Group
26 % https://github.com/ho-tex/pdfcolfoot/issues
27 %
28 % This work consists of the main source file pdfcolfoot.dtx
29 % and the derived files
30 % pdfcolfoot.sty, pdfcolfoot.pdf, pdfcolfoot.ins, pdfcolfoot.drv
31 %
32 % Distribution:
33 % CTAN:macros/latex/contrib/pdfcolfoot/pdfcolfoot.dtx
34 % CTAN:macros/latex/contrib/pdfcolfoot/pdfcolfoot.pdf
35 %
36 % Unpacking:
37 % (a) If pdfcolfoot.ins is present:
38 % tex pdfcolfoot.ins
39 % (b) Without pdfcolfoot.ins:
40 % tex pdfcolfoot.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{pdfcolfoot.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If pdfcolfoot.drv is present:
47 % latex pdfcolfoot.drv
48 % (b) Without pdfcolfoot.drv:
49 % latex pdfcolfoot.dtx; ...
50 % The class ltxdoc loads the configuration file ltxdoc.cfg
51 % if available. Here you can specify further options, e.g.
52 % use A4 as paper format:
53 % \PassOptionsToClass{a4paper}{article}
54 %
55 % Programm calls to get the documentation (example):
56 % pdflatex pdfcolfoot.dtx
57 % makeindex -s gind.ist pdfcolfoot.idx
58 % pdflatex pdfcolfoot.dtx
59 % makeindex -s gind.ist pdfcolfoot.idx
60 % pdflatex pdfcolfoot.dtx
61 %
62 % Installation:
63 % TDS:tex/latex/pdfcolfoot/pdfcolfoot.sty
64 % TDS:doc/latex/pdfcolfoot/pdfcolfoot.pdf
65 % TDS:source/latex/pdfcolfoot/pdfcolfoot.dtx
66 %
67 %<*ignore>
68 \begingroup
69 \catcode123=1 %
70 \catcode125=2 %
71 \def\x{LaTeX2e}%
72 \expandafter\endgroup
73 \ifcase 0\ifx\install y1\fi\expandafter
74 \ifx\csname processbatchFile\endcsname\relax\else1\fi
75 \ifx\fmtname\x\else 1\fi\relax
76 \else\csname fi\endcsname
77 %</ignore>
78 %<*install>
79 \input docstrip.tex
80 \Msg{************************************************************************}
81 \Msg{* Installation}
82 \Msg{* Package: pdfcolfoot 2023-01-10 v1.4 Color stack for footnotes with pdfTeX (HO)}
83 \Msg{************************************************************************}
84
85 \keepsilent
86 \askforoverwritefalse
87
88 \let\MetaPrefix\relax
89 \preamble
90
91 This is a generated file.
92
93 Project: pdfcolfoot
94 Version: 2023-01-10 v1.4
95
96 Copyright (C)
97 2007, 2012 Heiko Oberdiek
98 2016-2023 Oberdiek Package Support Group
99
100 This work may be distributed and/or modified under the
101 conditions of the LaTeX Project Public License, either
102 version 1.3c of this license or (at your option) any later
103 version. This version of this license is in
104 https://www.latex-project.org/lppl/lppl-1-3c.txt
105 and the latest version of this license is in
106 https://www.latex-project.org/lppl.txt
107 and version 1.3 or later is part of all distributions of
108 LaTeX version 2005/12/01 or later.
109
110 This work has the LPPL maintenance status "maintained".
111
112 The Current Maintainers of this work are
113 Heiko Oberdiek and the Oberdiek Package Support Group
114 https://github.com/ho-tex/pdfcolfoot/issues
115
116
117 This work consists of the main source file pdfcolfoot.dtx
118 and the derived files
119 pdfcolfoot.sty, pdfcolfoot.pdf, pdfcolfoot.ins, pdfcolfoot.drv
120
121 \endpreamble
122 \let\MetaPrefix\DoubleperCent
123
124 \generate{%
125 \file{pdfcolfoot.ins}{\from{pdfcolfoot.dtx}{install}}%
126 \file{pdfcolfoot.drv}{\from{pdfcolfoot.dtx}{driver}}%
127 \usedir{tex/latex/oberdiek}%
128 \file{pdfcolfoot.sty}{\from{pdfcolfoot.dtx}{package}}%
129 }
130
131 \catcode32=13\relax% active space
132 \let =\space%
133 \Msg{************************************************************************}
134 \Msg{*}
135 \Msg{* To finish the installation you have to move the following}
136 \Msg{* file into a directory searched by TeX:}
137 \Msg{*}
138 \Msg{* pdfcolfoot.sty}
139 \Msg{*}
140 \Msg{* To produce the documentation run the file `pdfcolfoot.drv'}
141 \Msg{* through LaTeX.}
142 \Msg{*}
143 \Msg{* Happy TeXing!}
144 \Msg{*}
145 \Msg{************************************************************************}
146
147 \endbatchfile
148 %</install>
149 %<*ignore>
150 \fi
151 %</ignore>
152 %<*driver>
153 \NeedsTeXFormat{LaTeX2e}
154 \ProvidesFile{pdfcolfoot.drv}%
155 [2023-01-10 v1.4 Color stack for footnotes with pdfTeX (HO)]%
156 \documentclass{ltxdoc}
157 \usepackage{holtxdoc}[2011/11/22]
158 \begin{document}
159 \DocInput{pdfcolfoot.dtx}%
160 \end{document}
161 %</driver>
162 % \fi
163 %
164 %
165 %
166 % \GetFileInfo{pdfcolfoot.drv}
167 %
168 % \title{The \xpackage{pdfcolfoot} package}
169 % \date{2023-01-10 v1.4}
170 % \author{Heiko Oberdiek\thanks
171 % {Please report any issues at \url{https://github.com/ho-tex/pdfcolfoot/issues}}}
172 %
173 % \maketitle
174 %
175 % \begin{abstract}
176 % Since version 1.40 \pdfTeX\ supports several color stacks. This
177 % package uses a separate color stack for footnotes that can break
178 % across pages.
179 % \end{abstract}
180 %
181 % \tableofcontents
182 %
183 % \section{User interface}
184 %
185 % Just load the package:
186 % \begin{quote}
187 % |\usepackage{pdfcolfoot}|
188 % \end{quote}
189 % The package assigns a color stack for footnotes and patches
190 % the appropriate internal macros to support this color stack.
191 %
192 % \subsection{Other packages or classes}
193 %
194 % This package \xpackage{pdfcolfoot} redefines \cs{@makecol}
195 % and \cs{@makefntext}.
196 % This can cause conflicts if other packages or classes also change
197 % these macro in an incompatible way. Sometimes it can help
198 % to change the package order.
199 %
200 % \section{Interface for package or class writers}
201 %
202 % Two macros \cs{pdfcolfoot@switch} and \cs{pdfcolfoot@current}
203 % need to be added to get support of the color stack for footnotes.
204 % This package \xpackage{pdfcolfoot} already patches many macros
205 % to add these two macros. If a package or class that deals
206 % with \cs{@makefntext} or \cs{@makecol} is not recognized by
207 % this package, the package/class author can add these two
208 % macros in his package/class.
209 %
210 % \subsection{Macro \cs{pdfcolfoot@switch}}
211 %
212 % Color commands inside footnotes should use the special
213 % color stack for footnotes. Macro \cs{pdfcolfoot@switch}
214 % sets this special color stack. (It can be called several
215 % times). But caution, footnotes for minipages should not
216 % be affected. This package patches \cs{@makefntext} for
217 % this purpose.
218 %
219 % \subsection{Macro \cs{pdfcolfoot@current}}
220 %
221 % In \LaTeX\ the footnote stuff goes into box \cs{footins}
222 % that is placed on the page (\cs{@makecol}).
223 % Two things need consideration:
224 % \begin{itemize}
225 % \item The footnote area should not interfere with the normal
226 % color stack. Macro \cs{normalcolor} inside a group helps
227 % it stores the current color of the normal stack and
228 % restores it after the group.
229 % \item If a footnote is broken across a page boundary, we
230 % need the latest color of the footnote area in the previous page.
231 % This is set by macro \cs{pdfcolfoot@current}.
232 % \end{itemize}
233 % As example the changes for \cs{@makecol} are shown (however
234 % this macro is already patched by this package):
235 %\begin{quote}
236 %\begin{verbatim}
237 %\gdef\@makcol{%
238 % ...
239 % \setbox\@outputbox\vbox{% or similar
240 % ...
241 % \color@begingroup
242 % \normalcolor
243 % \footnoterule % using normal color (black)
244 % \csname pdfcolfoot@current\endcsname
245 % \unvbox\footins
246 % \color@endgroup
247 % }%
248 % ...
249 %}
250 %\end{verbatim}
251 %\end{quote}
252 % We use \cs{csname} to call macro \cs{pdfcolfoot@current}.
253 % If package \xpackage{pdfcolfoot} is not loaded, \cs{pdfcolfoot@current}
254 % is not defined. In this case \cs{csname} defines the undefined
255 % macro with meaning \cs{relax} and we do not get an error because
256 % of undefined command.
257 %
258 % \StopEventually{
259 % }
260 %
261 % \section{Implementation}
262 %
263 % \subsection{Identification}
264 %
265 % \begin{macrocode}
266 %<*package>
267 \NeedsTeXFormat{LaTeX2e}
268 \ProvidesPackage{pdfcolfoot}%
269 [2023-01-10 v1.4 Color stack for footnotes with pdfTeX (HO)]%
270 % \end{macrocode}
271 %
272 % \subsection{Load package \xpackage{pdfcol}}
273 %
274 % \begin{macrocode}
275 \RequirePackage{pdfcol}[2007/09/09]
276 \ifpdfcolAvailable
277 \else
278 \PackageInfo{pdfcolfoot}{%
279 Loading aborted, because color stacks are not available%
280 }%
281 \expandafter\endinput
282 \fi
283 % \end{macrocode}
284 %
285 % \subsection{Color stack for footnotes}
286 %
287 % Version 1.0 has used \cs{current@color} as initial color stack
288 % value, since version 1.1 package \xpackage{pdfcol} with its
289 % default setting is used.
290 % \begin{macrocode}
291 \pdfcolInitStack{foot}
292 % \end{macrocode}
293 %
294 % \subsection{Patch \cs{@makefntext}}
295 %
296 % \begin{macro}{\pdfcolfoot@switch}
297 % Macro \cs{pdfcolfoot@switch} switches the color stack. Subsequent
298 % color calls uses the color stack for footnotes.
299 % \begin{macrocode}
300 \newcommand*{\pdfcolfoot@switch}{%
301 \pdfcolSwitchStack{foot}%
302 }
303 % \end{macrocode}
304 % \end{macro}
305 %
306 % \begin{macrocode}
307 \AtBeginDocument{%
308 \newcommand*{\pdfcolfoot@makefntext}{}%
309 \let\pdfcolfoot@makefntext\@makefntext
310 \renewcommand{\@makefntext}[1]{%
311 \pdfcolfoot@makefntext{%
312 \if@minipage
313 \else
314 \pdfcolfoot@switch
315 \fi
316 \color@begingroup
317 #1%
318 \color@endgroup
319 }%
320 }%
321 }
322 % \end{macrocode}
323 %
324 % \subsection{Patch \cs{@makecol}}
325 %
326 % \begin{macro}{\pdfcolfoot@current}
327 % When the footnote area starts, the color should continue with
328 % the latest color value of the previous footnote area. This color
329 % is available on the current top of the color stack.
330 % \begin{macrocode}
331 \newcommand*{\pdfcolfoot@current}{%
332 \pdfcolSetCurrent{foot}%
333 }
334 % \end{macrocode}
335 % \end{macro}
336 %
337 % For convenience we use \cs{detokenize} for patching \cs{@makecol}
338 % and related macros.
339 % \begin{macrocode}
340 \begingroup\expandafter\expandafter\expandafter\endgroup
341 \expandafter\ifx\csname detokenize\endcsname\relax
342 \PackageWarningNoLine{pdfcolfoot}{%
343 Missing e-TeX for patching \string\@makecol
344 }%
345 \expandafter\endinput
346 \fi
347 % \end{macrocode}
348 %
349 % \begin{macrocode}
350 \newif\ifPCF@result
351 \def\pdfcolfoot@patch#1{%
352 \ifx#1\@undefined
353 \else
354 \ifx#1\relax
355 \else
356 \begingroup
357 \toks@{}%
358 \let\on@line\@empty
359 \expandafter\PCF@CheckPatched
360 \detokenize\expandafter{#1pdfcolfoot@current}\@nil
361 \ifPCF@result
362 \PackageInfo{pdfcolfoot}{\string#1\space is already patched}%
363 \else
364 \expandafter\PCF@CanPatch
365 \detokenize\expandafter{%
366 #1\setbox\@outputbox\vbox{\footnoterule}%
367 }%
368 \@nil
369 \ifPCF@result
370 \PackageInfo{pdfcolfoot}{\string#1 is being patched}%
371 \expandafter\PCF@PatchA#1\PCF@nil#1%
372 \else
373 \PackageInfo{pdfcolfoot}{%
374 \string#1\space cannot be patched%
375 }%
376 \fi
377 \fi
378 \expandafter\endgroup
379 \the\toks@
380 \fi
381 \fi
382 }
383 \expandafter\def\expandafter\PCF@CheckPatched
384 \expandafter#\expandafter1\detokenize{pdfcolfoot@current}#2\@nil{%
385 \ifx\\#2\\%
386 \PCF@resultfalse
387 \else
388 \PCF@resulttrue
389 \fi
390 }
391 \edef\PCF@BraceLeft{\string{}
392 \edef\PCF@BraceRight{\string}}
393 \begingroup
394 \edef\x{\endgroup
395 \def\noexpand\PCF@CanPatch
396 ##1\detokenize{\setbox\@outputbox\vbox}\PCF@BraceLeft
397 ##2\detokenize{\footnoterule}##3\PCF@BraceRight
398 }%
399 \x#4\@nil{%
400 \ifx\\#2#3#4\\%
401 \PCF@resultfalse
402 \else
403 \PCF@resulttrue
404 \fi
405 }
406 \def\PCF@PatchA#1\setbox\@outputbox\vbox#2#3\PCF@nil#4{%
407 \PCF@PatchB{#1}#2\PCF@nil{#3}#4%
408 }
409 \def\PCF@PatchB#1#2\footnoterule#3\PCF@nil#4#5{%
410 \toks@{%
411 \def#5{%
412 #1%
413 \setbox\@outputbox\vbox{%
414 #2%
415 \footnoterule
416 \pdfcolfoot@current
417 #3%
418 }%
419 #4%
420 }%
421 }%
422 }
423 \def\pdfcolfoot@all#1{%
424 \begingroup
425 \let\on@line\@empty
426 \PackageInfo{pdfcolfoot}{%
427 Patching \string\@makecol\space macros (#1)%
428 }%
429 \endgroup
430 % \end{macrocode}
431 % \LaTeX\ base macro:
432 % \begin{macrocode}
433 \pdfcolfoot@patch\@makecol
434 % \end{macrocode}
435 % Class \xclass{aastex}:
436 % \begin{macrocode}
437 \pdfcolfoot@patch\@makecol@pptt
438 % \end{macrocode}
439 % Class \xclass{memoir}:
440 % \begin{macrocode}
441 \pdfcolfoot@patch\mem@makecol
442 \pdfcolfoot@patch\mem@makecolbf
443 \pdfcolfoot@patch\m@mopfootnote
444 % \end{macrocode}
445 % Class \xclass{revtex4}:
446 % \begin{macrocode}
447 \pdfcolfoot@patch\@combineinserts
448 % \end{macrocode}
449 % Package \xpackage{changebar}:
450 % \begin{macrocode}
451 \pdfcolfoot@patch\ltx@makecol
452 % \end{macrocode}
453 % Package \xpackage{dblfnote}:
454 % \begin{macrocode}
455 \pdfcolfoot@patch\dfn@latex@makecol
456 % \end{macrocode}
457 % Package \xpackage{fancyhdr}:
458 % \begin{macrocode}
459 \pdfcolfoot@patch\latex@makecol
460 % \end{macrocode}
461 % Package \xpackage{lscape}:
462 % \begin{macrocode}
463 \pdfcolfoot@patch\LS@makecol
464 % \end{macrocode}
465 % Package \xpackage{lineno}:
466 % \begin{macrocode}
467 \pdfcolfoot@patch\@LN@orig@makecol
468 % \end{macrocode}
469 % Package \xpackage{stfloats}:
470 % \begin{macrocode}
471 \pdfcolfoot@patch\org@makecol
472 \pdfcolfoot@patch\fn@makecol
473 % \end{macrocode}
474 % \begin{macrocode}
475 }
476 \AtBeginDocument{\pdfcolfoot@all{AtBeginDocument}}
477 \pdfcolfoot@all{AtEndOfPackage}
478 % \end{macrocode}
479 %
480 % \begin{macrocode}
481 %</package>
482 % \end{macrocode}
483 %% \section{Installation}
484 %
485 % \subsection{Download}
486 %
487 % \paragraph{Package.} This package is available on
488 % CTAN\footnote{\CTANpkg{pdfcolfoot}}:
489 % \begin{description}
490 % \item[\CTAN{macros/latex/contrib/pdfcolfoot/pdfcolfoot.dtx}] The source file.
491 % \item[\CTAN{macros/latex/contrib/pdfcolfoot/pdfcolfoot.pdf}] Documentation.
492 % \end{description}
493 %
494 % \subsection{Package installation}
495 %
496 % The package should be installed with the package manager of your \TeX~system.
497 % If for some reason a manual installation is needed follow the following instructions.
498 %
499 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
500 % \docstrip\ archive. The files are extracted by running the
501 % \xfile{.dtx} through \plainTeX:
502 % \begin{quote}
503 % \verb|tex pdfcolfoot.dtx|
504 % \end{quote}
505 %
506 % \paragraph{TDS.} Now the different files must be moved into
507 % the different directories in your installation TDS tree
508 % (also known as \xfile{texmf} tree):
509 % \begin{quote}
510 % \def\t{^^A
511 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
512 % pdfcolfoot.sty & tex/latex/pdfcolfoot/pdfcolfoot.sty\\
513 % pdfcolfoot.pdf & doc/latex/pdfcolfoot/pdfcolfoot.pdf\\
514 % pdfcolfoot.dtx & source/latex/pdfcolfoot/pdfcolfoot.dtx\\
515 % \end{tabular}^^A
516 % }^^A
517 % \sbox0{\t}^^A
518 % \ifdim\wd0>\linewidth
519 % \begingroup
520 % \advance\linewidth by\leftmargin
521 % \advance\linewidth by\rightmargin
522 % \edef\x{\endgroup
523 % \def\noexpand\lw{\the\linewidth}^^A
524 % }\x
525 % \def\lwbox{^^A
526 % \leavevmode
527 % \hbox to \linewidth{^^A
528 % \kern-\leftmargin\relax
529 % \hss
530 % \usebox0
531 % \hss
532 % \kern-\rightmargin\relax
533 % }^^A
534 % }^^A
535 % \ifdim\wd0>\lw
536 % \sbox0{\small\t}^^A
537 % \ifdim\wd0>\linewidth
538 % \ifdim\wd0>\lw
539 % \sbox0{\footnotesize\t}^^A
540 % \ifdim\wd0>\linewidth
541 % \ifdim\wd0>\lw
542 % \sbox0{\scriptsize\t}^^A
543 % \ifdim\wd0>\linewidth
544 % \ifdim\wd0>\lw
545 % \sbox0{\tiny\t}^^A
546 % \ifdim\wd0>\linewidth
547 % \lwbox
548 % \else
549 % \usebox0
550 % \fi
551 % \else
552 % \lwbox
553 % \fi
554 % \else
555 % \usebox0
556 % \fi
557 % \else
558 % \lwbox
559 % \fi
560 % \else
561 % \usebox0
562 % \fi
563 % \else
564 % \lwbox
565 % \fi
566 % \else
567 % \usebox0
568 % \fi
569 % \else
570 % \lwbox
571 % \fi
572 % \else
573 % \usebox0
574 % \fi
575 % \end{quote}
576 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
577 % TDS installing feature, then some files can already be in the right
578 % place, see the documentation of \docstrip.
579 %
580 % \subsection{Refresh file name databases}
581 %
582 % If your \TeX~distribution
583 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
584 % these. For example, \TeX\,Live\ users run \verb|texhash| or
585 % \verb|mktexlsr|.
586 %
587 % \subsection{Some details for the interested}
588 %
589 % \paragraph{Unpacking with \LaTeX.}
590 % The \xfile{.dtx} chooses its action depending on the format:
591 % \begin{description}
592 % \item[\plainTeX:] Run \docstrip\ and extract the files.
593 % \item[\LaTeX:] Generate the documentation.
594 % \end{description}
595 % If you insist on using \LaTeX\ for \docstrip\ (really,
596 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
597 % about your intention:
598 % \begin{quote}
599 % \verb|latex \let\install=y\input{pdfcolfoot.dtx}|
600 % \end{quote}
601 % Do not forget to quote the argument according to the demands
602 % of your shell.
603 %
604 % \paragraph{Generating the documentation.}
605 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
606 % the documentation. The process can be configured by the
607 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
608 % line into this file, if you want to have A4 as paper format:
609 % \begin{quote}
610 % \verb|\PassOptionsToClass{a4paper}{article}|
611 % \end{quote}
612 % An example follows how to generate the
613 % documentation with pdf\LaTeX:
614 % \begin{quote}
615 %\begin{verbatim}
616 %pdflatex pdfcolfoot.dtx
617 %makeindex -s gind.ist pdfcolfoot.idx
618 %pdflatex pdfcolfoot.dtx
619 %makeindex -s gind.ist pdfcolfoot.idx
620 %pdflatex pdfcolfoot.dtx
621 %\end{verbatim}
622 % \end{quote}
623 %
624 % \begin{thebibliography}{9}
625 %
626 % \bibitem{pdfcol}
627 % Heiko Oberdiek: \textit{The \xpackage{pdfcol} package};
628 % 2007/09/09;\\
629 % \CTANpkg{pdfcol}.
630 %
631 % \end{thebibliography}
632 %
633 % \begin{History}
634 % \begin{Version}{2007/01/08 v1.0}
635 % \item
636 % First version.
637 % \end{Version}
638 % \begin{Version}{2007/09/09 v1.1}
639 % \item
640 % Use of package \xpackage{pdfcol}.
641 % \item
642 % Test file added.
643 % \end{Version}
644 % \begin{Version}{2012/01/02 v1.2}
645 % \item
646 % Support updated for memoir 2011/03/06 v3.6j.
647 % (Thanks Bob for the bug report.)
648 % \end{Version}
649 % \begin{Version}{2016/05/16 v1.3}
650 % \item
651 % Documentation updates.
652 % \end{Version}
653 % \begin{Version}{2023-01-10 v1.4}
654 % \item Added a group to avoid that the wrong color
655 % stack is reset after the footnote.
656 % \end{Version}
657 % \end{History}
658 %
659 % \PrintIndex
660 %
661 % \Finale
662 \endinput