| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: hypcap.dtx |
| 4 |
% Version: 2024-07-26 v1.13 |
| 5 |
% Info: Adjusting the anchors of captions |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 1999-2001, 2006-2008, 2011 Heiko Oberdiek |
| 9 |
% 2016-2024 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/hypcap/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/hypcap/issues |
| 27 |
% |
| 28 |
% This work consists of the main source file hypcap.dtx |
| 29 |
% and the derived files |
| 30 |
% hypcap.sty, hypcap.pdf, hypcap.ins, hypcap.drv. |
| 31 |
% |
| 32 |
% Distribution: |
| 33 |
% CTAN:macros/latex/contrib/hypcap/hypcap.dtx |
| 34 |
% CTAN:macros/latex/contrib/hypcap/hypcap.pdf |
| 35 |
% |
| 36 |
% Unpacking: |
| 37 |
% (a) If hypcap.ins is present: |
| 38 |
% tex hypcap.ins |
| 39 |
% (b) Without hypcap.ins: |
| 40 |
% tex hypcap.dtx |
| 41 |
% (c) If you insist on using LaTeX |
| 42 |
% latex \let\install=y\input{hypcap.dtx} |
| 43 |
% (quote the arguments according to the demands of your shell) |
| 44 |
% |
| 45 |
% Documentation: |
| 46 |
% (a) If hypcap.drv is present: |
| 47 |
% latex hypcap.drv |
| 48 |
% (b) Without hypcap.drv: |
| 49 |
% latex hypcap.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 |
% Program calls to get the documentation (example): |
| 56 |
% pdflatex hypcap.dtx |
| 57 |
% makeindex -s gind.ist hypcap.idx |
| 58 |
% pdflatex hypcap.dtx |
| 59 |
% makeindex -s gind.ist hypcap.idx |
| 60 |
% pdflatex hypcap.dtx |
| 61 |
% |
| 62 |
% Installation: |
| 63 |
% TDS:tex/latex/hypcap/hypcap.sty |
| 64 |
% TDS:doc/latex/hypcap/hypcap.pdf |
| 65 |
% TDS:source/latex/hypcap/hypcap.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: hypcap 2024-07-26 v1.13 Adjusting the anchors of captions (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: hypcap |
| 94 |
Version: 2024-07-26 v1.13 |
| 95 |
|
| 96 |
Copyright (C) |
| 97 |
1999-2001, 2006-2008, 2011 Heiko Oberdiek |
| 98 |
2016-2024 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/hypcap/issues |
| 115 |
|
| 116 |
|
| 117 |
This work consists of the main source file hypcap.dtx |
| 118 |
and the derived files |
| 119 |
hypcap.sty, hypcap.pdf, hypcap.ins, hypcap.drv. |
| 120 |
|
| 121 |
\endpreamble |
| 122 |
\let\MetaPrefix\DoubleperCent |
| 123 |
|
| 124 |
\generate{% |
| 125 |
\file{hypcap.ins}{\from{hypcap.dtx}{install}}% |
| 126 |
\file{hypcap.drv}{\from{hypcap.dtx}{driver}}% |
| 127 |
\usedir{tex/latex/hypcap}% |
| 128 |
\file{hypcap.sty}{\from{hypcap.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{* hypcap.sty} |
| 139 |
\Msg{*} |
| 140 |
\Msg{* To produce the documentation run the file `hypcap.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{hypcap.drv}% |
| 155 |
[2024-07-26 v1.13 Adjusting the anchors of captions (HO)]% |
| 156 |
\documentclass{ltxdoc} |
| 157 |
\usepackage{holtxdoc}[2011/11/22] |
| 158 |
\begin{document} |
| 159 |
\DocInput{hypcap.dtx}% |
| 160 |
\end{document} |
| 161 |
%</driver> |
| 162 |
% \fi |
| 163 |
% |
| 164 |
% |
| 165 |
% |
| 166 |
% \GetFileInfo{hypcap.drv} |
| 167 |
% |
| 168 |
% \title{The \xpackage{hypcap} package} |
| 169 |
% \date{2024-07-26 v1.13} |
| 170 |
% \author{Heiko Oberdiek\thanks |
| 171 |
% {Please report any issues at \url{https://github.com/ho-tex/hypcap/issues}}} |
| 172 |
% |
| 173 |
% \maketitle |
| 174 |
% |
| 175 |
% \begin{abstract} |
| 176 |
% This package tries a solution of the problem with |
| 177 |
% hyperref, that links to floats points below the |
| 178 |
% caption and not at the beginning of the float. |
| 179 |
% Therefore this package divides the task into two |
| 180 |
% part, the link setting with \cs{capstart} or |
| 181 |
% automatically at the beginning of a float and |
| 182 |
% the rest in the \cs{caption} command. |
| 183 |
% \end{abstract} |
| 184 |
% |
| 185 |
% \tableofcontents |
| 186 |
% |
| 187 |
% \newpage |
| 188 |
% \section{Usage} |
| 189 |
% The package \Package{hypcap} requires that \Package{hyperref} |
| 190 |
% is loaded first: |
| 191 |
% \begin{quote} |
| 192 |
% |\usepackage[...]{hyperref}|\\ |
| 193 |
% |\usepackage[...]{hypcap}| |
| 194 |
% \end{quote} |
| 195 |
% |
| 196 |
% \subsection{Package options} |
| 197 |
% The names of the four float environments |figure|, |figure*|, |
| 198 |
% |table|, or |table*| can be used as option. Then the package |
| 199 |
% redefines the environment in order to insert \cmd{\capstart} |
| 200 |
% (see below) in the beginning of the environment automatically. |
| 201 |
% |
| 202 |
% Option |all| enables the redefinitions of all four |
| 203 |
% float environments. For other environments see |
| 204 |
% the user command \cmd{\hypcapredef}. |
| 205 |
% |
| 206 |
% \subsection{User commands} |
| 207 |
% \begin{description} |
| 208 |
% \item[\cmd{\capstart}:]\DescribeMacro{\capstart} |
| 209 |
% First this command increments the counter (\cmd{\@captype}). |
| 210 |
% Then it makes an anchor for package \Package{hyperref}. |
| 211 |
% At last \cmd{\caption} is redefined to remove the |
| 212 |
% anchor setting part from \Package{hyperref}'s \cmd{\caption}. |
| 213 |
% |
| 214 |
% The package expects the following structure of a float |
| 215 |
% environment: |
| 216 |
% \begin{quote} |
| 217 |
% |\begin{|\textit{|float|}|}...|\\ |
| 218 |
% |\capstart|\\ |
| 219 |
% |...|\\ |
| 220 |
% |\caption{...}|\\ |
| 221 |
% |...|\\ |
| 222 |
% |\end{|\textit{|float|}|}| |
| 223 |
% \end{quote} |
| 224 |
% There can be several \cmd{\caption} commands. For these |
| 225 |
% you need \cmd{\capstart} again: |
| 226 |
% \begin{quote} |
| 227 |
% |\capstart ... \caption... \capstart ... \caption...| |
| 228 |
% \end{quote} |
| 229 |
% And the \cmd{\caption} command itself can be put in a group. |
| 230 |
% |
| 231 |
% With the options, described above, the extra |
| 232 |
% writing of \cmd{\capstart} can be avoided. |
| 233 |
% Consequently, there must be a \cmd{\caption} in every |
| 234 |
% environment of this type, specified by the option. |
| 235 |
% If you want to use more than one \cmd{\caption} in this |
| 236 |
% environment, you have to state \cmd{\capstart} again. |
| 237 |
% \item[\cmd{\hypcapspace}:]\DescribeMacro{\hypcapspace} |
| 238 |
% Because it looks poor, if the link points exactly at top of |
| 239 |
% the figure, there is additional space: \cmd{\hypcapspace}, |
| 240 |
% the default is |0.5\baselineskip|, examples: |
| 241 |
% \begin{quote} |
| 242 |
% |\renewcommand{\hypcapspace}{0pt}| removes the space\\ |
| 243 |
% |\renewcommand{\hypcapspace}{1pt}| sets a fix value |
| 244 |
% \end{quote} |
| 245 |
% \item[\cmd{\hypcapredef}:]\DescribeMacro{\hypcapredef} |
| 246 |
% If there are other float environments, that |
| 247 |
% should automatically execute \cmd{\capstart}, then |
| 248 |
% a redefinition with \cmd{\hypcapredef} can be tried: |
| 249 |
% \begin{quote} |
| 250 |
% |\hypcapredef{myfloat}| |
| 251 |
% \end{quote} |
| 252 |
% Only environments with one optional parameter are |
| 253 |
% supported. |
| 254 |
% \item[\cs{capstartfalse}, \cs{capstarttrue}:]^^A |
| 255 |
% \DescribeMacro{\capstartfalse}^^A |
| 256 |
% \DescribeMacro{\capstarttrue}^^A |
| 257 |
% Since 2008/09/08 v1.10.\\ |
| 258 |
% They disable and enable \cs{capstart}. They can be used to |
| 259 |
% cancel the effect of a redefined float environment. |
| 260 |
% Example: |
| 261 |
%\begin{quote} |
| 262 |
%\catcode`Y=\active |
| 263 |
%\def Y#1Z{\textit{\cs{#1}}} |
| 264 |
%\begin{verbatim} |
| 265 |
%\documentclass{article} |
| 266 |
%\usepackage{hyperref} |
| 267 |
%\usepackage[figure]{hypcap}[2008/09/08] |
| 268 |
% |
| 269 |
%\begin{document} |
| 270 |
% \section{Hello World} |
| 271 |
% \begin{figure} |
| 272 |
% \caption{Figure with caption A} |
| 273 |
% \end{figure} |
| 274 |
% YcapstartfalseZ |
| 275 |
% \begin{figure} |
| 276 |
% Figure without caption |
| 277 |
% \end{figure} |
| 278 |
% YcapstarttrueZ |
| 279 |
% \begin{figure} |
| 280 |
% \caption{Figure with caption B} |
| 281 |
% \end{figure} |
| 282 |
%\end{document} |
| 283 |
%\end{verbatim} |
| 284 |
%\end{quote} |
| 285 |
% \end{description} |
| 286 |
% |
| 287 |
% \subsection{Limitations} |
| 288 |
% \begin{itemize} |
| 289 |
% \item Packages that redefine \cmd{\caption} or |
| 290 |
% \cmd{\@caption}. |
| 291 |
% \end{itemize} |
| 292 |
% |
| 293 |
% \StopEventually{ |
| 294 |
% } |
| 295 |
% |
| 296 |
% \section{Implementation} |
| 297 |
% \begin{macrocode} |
| 298 |
%<*package> |
| 299 |
% \end{macrocode} |
| 300 |
% Package identification. |
| 301 |
% \begin{macrocode} |
| 302 |
\NeedsTeXFormat{LaTeX2e} |
| 303 |
\ProvidesPackage{hypcap}% |
| 304 |
[2024-07-26 v1.13 Adjusting the anchors of captions (HO)] |
| 305 |
% \end{macrocode} |
| 306 |
% |
| 307 |
% For unique command names this package uses |hc@| as prefix |
| 308 |
% for internal command names. |
| 309 |
% |
| 310 |
% First we check, if package \Package{hyperref} is loaded: |
| 311 |
% \begin{macrocode} |
| 312 |
\@ifundefined{hyper@@anchor}{% |
| 313 |
\PackageError{hypcap}{You have to load 'hyperref' first}\@ehc |
| 314 |
\endinput |
| 315 |
}{} |
| 316 |
% \end{macrocode} |
| 317 |
% |
| 318 |
% \begin{macrocode} |
| 319 |
\RequirePackage{letltxmacro}[2008/06/24] |
| 320 |
% \end{macrocode} |
| 321 |
% |
| 322 |
% \begin{macro}{\hc@org@caption} |
| 323 |
% Save the original meaning of \cmd{\caption}: |
| 324 |
% \begin{macrocode} |
| 325 |
\newcommand*\hc@org@caption{} |
| 326 |
\let\hc@org@caption\caption |
| 327 |
% \end{macrocode} |
| 328 |
% \end{macro} |
| 329 |
% |
| 330 |
% \newcommand*{\BeginMacro}[1]{\expandafter\DoBeginMacro\csname#1\endcsname} |
| 331 |
% \newcommand*{\DoBeginMacro}[1]{\begin{macro}{#1}} |
| 332 |
% \newcommand*{\Cmd}[1]{\expandafter\cmd\csname#1\endcsname} |
| 333 |
% \BeginMacro{if@capstart} |
| 334 |
% The switch \Cmd{if@capstart} helps to detect |
| 335 |
% \cmd{\capstart} commands with missing \cmd{\caption} macros. |
| 336 |
% Because \cmd{\caption} can occur inside a group, assignments |
| 337 |
% to the switch have to be made global. |
| 338 |
% \begin{macrocode} |
| 339 |
\newif\if@capstart |
| 340 |
% \end{macrocode} |
| 341 |
% \end{macro} |
| 342 |
% |
| 343 |
% \begin{macro}{\hypcapspace} |
| 344 |
% The anchor is raised.by \cmd{\hypcapspace}. |
| 345 |
% \begin{macrocode} |
| 346 |
\newcommand*\hypcapspace{.5\baselineskip} |
| 347 |
% \end{macrocode} |
| 348 |
% \end{macro} |
| 349 |
% |
| 350 |
% \begin{macro}{\ifcapstart} |
| 351 |
% \begin{macrocode} |
| 352 |
\newif\ifcapstart |
| 353 |
\capstarttrue |
| 354 |
% \end{macrocode} |
| 355 |
% \end{macro} |
| 356 |
% |
| 357 |
% \begin{macro}{\capstart} |
| 358 |
% The macro \cmd{\capstart} contains the first part of |
| 359 |
% the \cmd{\caption} command: Incrementing the counter |
| 360 |
% and setting the anchor. |
| 361 |
% \begin{macrocode} |
| 362 |
\newcommand*\capstart{% |
| 363 |
\ifcapstart |
| 364 |
\H@refstepcounter\@captype % first part of caption |
| 365 |
\hyper@makecurrent\@captype |
| 366 |
\global\let\hc@currentHref\@currentHref |
| 367 |
\vspace*{-\hypcapspace}% |
| 368 |
\begingroup |
| 369 |
\let\leavevmode\relax |
| 370 |
\hyper@@anchor\@currentHref\relax |
| 371 |
\endgroup |
| 372 |
\vspace*{\hypcapspace}% |
| 373 |
\hc@hyperref{\let\caption\hc@caption}% |
| 374 |
\global\@capstarttrue |
| 375 |
\global\advance\csname c@\@captype\endcsname\m@ne |
| 376 |
\fi |
| 377 |
} |
| 378 |
% \end{macrocode} |
| 379 |
% \end{macro} |
| 380 |
% |
| 381 |
% \begin{macrocode} |
| 382 |
\@ifpackagelater{hyperref}{2007/04/09}{% |
| 383 |
\let\hc@hyperref\@gobble |
| 384 |
}{% |
| 385 |
\let\hc@hyperref\@firstofone |
| 386 |
} |
| 387 |
% \end{macrocode} |
| 388 |
% |
| 389 |
% \begin{macro}{\hc@caption} |
| 390 |
% The new \cmd{\caption} command without the first part |
| 391 |
% is defined in the macro \cmd{\hc@caption}. |
| 392 |
% \begin{macrocode} |
| 393 |
\def\hc@caption{% |
| 394 |
\global\advance\csname c@\@captype\endcsname\@ne |
| 395 |
\@dblarg{\hc@@caption\@captype}% |
| 396 |
} |
| 397 |
% \end{macrocode} |
| 398 |
% \end{macro} |
| 399 |
% |
| 400 |
% \begin{macro}{\hc@@caption} |
| 401 |
% This is a copy of package \Package{hyperref}'s \cmd{\@caption} |
| 402 |
% macro without making the anchor, because this is already done |
| 403 |
% in \cmd{\capstart}. |
| 404 |
% \begin{macrocode} |
| 405 |
\long\def\hc@@caption#1[#2]#3{% |
| 406 |
\let\caption\hc@org@caption |
| 407 |
\global\@capstartfalse |
| 408 |
\ifHy@hypertexnames |
| 409 |
\hyper@makecurrent\@captype |
| 410 |
\else |
| 411 |
\global\let\@currentHref\hc@currentHref |
| 412 |
\fi |
| 413 |
\par\addcontentsline{% |
| 414 |
\csname ext@#1\endcsname}{#1}{% |
| 415 |
\protect\numberline{% |
| 416 |
\csname the#1\endcsname |
| 417 |
}{\ignorespaces #2}% |
| 418 |
}% |
| 419 |
\begingroup |
| 420 |
\@parboxrestore |
| 421 |
\normalsize |
| 422 |
\@makecaption{\csname fnum@#1\endcsname}{% |
| 423 |
\ignorespaces#3% |
| 424 |
}% |
| 425 |
\par |
| 426 |
\endgroup |
| 427 |
} |
| 428 |
% \end{macrocode} |
| 429 |
% \end{macro} |
| 430 |
% |
| 431 |
% \begin{macro}{\hypcapredef} |
| 432 |
% The macro \cmd{\hypcapredef} prepares the call of |
| 433 |
% \cmd{\hc@redef} that will redefine the environment |
| 434 |
% that is given in the argument. |
| 435 |
% \begin{macrocode} |
| 436 |
\def\hypcapredef#1{% |
| 437 |
\expandafter\hc@redef\csname hc@org#1\expandafter\endcsname |
| 438 |
\csname hc@orgend#1\expandafter\endcsname |
| 439 |
\expandafter{#1}% |
| 440 |
} |
| 441 |
% \end{macrocode} |
| 442 |
% \end{macro} |
| 443 |
% \begin{macro}{\hc@redef} |
| 444 |
% The old meaning of the environment is saved. Then |
| 445 |
% \cmd{\capstart} is appended in the begin part. |
| 446 |
% The end part contains a check |
| 447 |
% that produces an error message in case of \cmd{\capstart} |
| 448 |
% without \cmd{\capstart} (\cmd{\capstart} has incremented |
| 449 |
% the counter). |
| 450 |
% \begin{macrocode} |
| 451 |
\def\hc@redef#1#2#3{% |
| 452 |
\newcommand#1{}% |
| 453 |
\expandafter\LetLtxMacro\expandafter#1\csname#3\endcsname |
| 454 |
\expandafter\LetLtxMacro\expandafter#2\csname end#3\endcsname |
| 455 |
\renewenvironment*{#3}[1][]{% |
| 456 |
\ifx\\##1\\% |
| 457 |
#1\relax |
| 458 |
\else |
| 459 |
#1[##1]% hash-ok (compatibility for float) |
| 460 |
\fi |
| 461 |
\capstart |
| 462 |
}{% |
| 463 |
\if@capstart |
| 464 |
\PackageWarning{hypcap}{You have forgotten to use \string\caption}% |
| 465 |
\global\@capstartfalse |
| 466 |
\else |
| 467 |
\fi |
| 468 |
#2% |
| 469 |
}% |
| 470 |
} |
| 471 |
% \end{macrocode} |
| 472 |
% \end{macro} |
| 473 |
% |
| 474 |
% At last the options are defined and processed. |
| 475 |
% \begin{macrocode} |
| 476 |
\DeclareOption{figure}{\hypcapredef{\CurrentOption}} |
| 477 |
\DeclareOption{figure*}{\hypcapredef{\CurrentOption}} |
| 478 |
\DeclareOption{table}{\hypcapredef{\CurrentOption}} |
| 479 |
\DeclareOption{table*}{\hypcapredef{\CurrentOption}} |
| 480 |
\DeclareOption{all}{% |
| 481 |
\hypcapredef{figure}% |
| 482 |
\hypcapredef{figure*}% |
| 483 |
\hypcapredef{table}% |
| 484 |
\hypcapredef{table*}% |
| 485 |
} |
| 486 |
\ProcessOptions\relax |
| 487 |
% \end{macrocode} |
| 488 |
% |
| 489 |
% \begin{macrocode} |
| 490 |
%</package> |
| 491 |
% \end{macrocode} |
| 492 |
% |
| 493 |
% \section{Installation} |
| 494 |
% |
| 495 |
% \subsection{Download} |
| 496 |
% |
| 497 |
% \paragraph{Package.} This package is available on |
| 498 |
% CTAN\footnote{\CTANpkg{hypcap}}: |
| 499 |
% \begin{description} |
| 500 |
% \item[\CTAN{macros/latex/contrib/hypcap/hypcap.dtx}] The source file. |
| 501 |
% \item[\CTAN{macros/latex/contrib/hypcap/hypcap.pdf}] Documentation. |
| 502 |
% \end{description} |
| 503 |
% |
| 504 |
% |
| 505 |
% \subsection{Package installation} |
| 506 |
% |
| 507 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 508 |
% \docstrip\ archive. The files are extracted by running the |
| 509 |
% \xfile{.dtx} through \plainTeX: |
| 510 |
% \begin{quote} |
| 511 |
% \verb|tex hypcap.dtx| |
| 512 |
% \end{quote} |
| 513 |
% |
| 514 |
% \paragraph{TDS.} Now the different files must be moved into |
| 515 |
% the different directories in your installation TDS tree |
| 516 |
% (also known as \xfile{texmf} tree): |
| 517 |
% \begin{quote} |
| 518 |
% \def\t{^^A |
| 519 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 520 |
% hypcap.sty & tex/latex/hypcap/hypcap.sty\\ |
| 521 |
% hypcap.pdf & doc/latex/hypcap/hypcap.pdf\\ |
| 522 |
% hypcap.dtx & source/latex/hypcap/hypcap.dtx\\ |
| 523 |
% \end{tabular}^^A |
| 524 |
% }^^A |
| 525 |
% \sbox0{\t}^^A |
| 526 |
% \ifdim\wd0>\linewidth |
| 527 |
% \begingroup |
| 528 |
% \advance\linewidth by\leftmargin |
| 529 |
% \advance\linewidth by\rightmargin |
| 530 |
% \edef\x{\endgroup |
| 531 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 532 |
% }\x |
| 533 |
% \def\lwbox{^^A |
| 534 |
% \leavevmode |
| 535 |
% \hbox to \linewidth{^^A |
| 536 |
% \kern-\leftmargin\relax |
| 537 |
% \hss |
| 538 |
% \usebox0 |
| 539 |
% \hss |
| 540 |
% \kern-\rightmargin\relax |
| 541 |
% }^^A |
| 542 |
% }^^A |
| 543 |
% \ifdim\wd0>\lw |
| 544 |
% \sbox0{\small\t}^^A |
| 545 |
% \ifdim\wd0>\linewidth |
| 546 |
% \ifdim\wd0>\lw |
| 547 |
% \sbox0{\footnotesize\t}^^A |
| 548 |
% \ifdim\wd0>\linewidth |
| 549 |
% \ifdim\wd0>\lw |
| 550 |
% \sbox0{\scriptsize\t}^^A |
| 551 |
% \ifdim\wd0>\linewidth |
| 552 |
% \ifdim\wd0>\lw |
| 553 |
% \sbox0{\tiny\t}^^A |
| 554 |
% \ifdim\wd0>\linewidth |
| 555 |
% \lwbox |
| 556 |
% \else |
| 557 |
% \usebox0 |
| 558 |
% \fi |
| 559 |
% \else |
| 560 |
% \lwbox |
| 561 |
% \fi |
| 562 |
% \else |
| 563 |
% \usebox0 |
| 564 |
% \fi |
| 565 |
% \else |
| 566 |
% \lwbox |
| 567 |
% \fi |
| 568 |
% \else |
| 569 |
% \usebox0 |
| 570 |
% \fi |
| 571 |
% \else |
| 572 |
% \lwbox |
| 573 |
% \fi |
| 574 |
% \else |
| 575 |
% \usebox0 |
| 576 |
% \fi |
| 577 |
% \else |
| 578 |
% \lwbox |
| 579 |
% \fi |
| 580 |
% \else |
| 581 |
% \usebox0 |
| 582 |
% \fi |
| 583 |
% \end{quote} |
| 584 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 585 |
% TDS installing feature, then some files can already be in the right |
| 586 |
% place, see the documentation of \docstrip. |
| 587 |
% |
| 588 |
% \subsection{Refresh file name databases} |
| 589 |
% |
| 590 |
% If your \TeX~distribution |
| 591 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 592 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 593 |
% \verb|mktexlsr|. |
| 594 |
% |
| 595 |
% \subsection{Some details for the interested} |
| 596 |
% |
| 597 |
% \paragraph{Unpacking with \LaTeX.} |
| 598 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 599 |
% \begin{description} |
| 600 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 601 |
% \item[\LaTeX:] Generate the documentation. |
| 602 |
% \end{description} |
| 603 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 604 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 605 |
% about your intention: |
| 606 |
% \begin{quote} |
| 607 |
% \verb|latex \let\install=y\input{hypcap.dtx}| |
| 608 |
% \end{quote} |
| 609 |
% Do not forget to quote the argument according to the demands |
| 610 |
% of your shell. |
| 611 |
% |
| 612 |
% \paragraph{Generating the documentation.} |
| 613 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 614 |
% the documentation. The process can be configured by the |
| 615 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 616 |
% line into this file, if you want to have A4 as paper format: |
| 617 |
% \begin{quote} |
| 618 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 619 |
% \end{quote} |
| 620 |
% An example follows how to generate the |
| 621 |
% documentation with pdf\LaTeX: |
| 622 |
% \begin{quote} |
| 623 |
%\begin{verbatim} |
| 624 |
%pdflatex hypcap.dtx |
| 625 |
%makeindex -s gind.ist hypcap.idx |
| 626 |
%pdflatex hypcap.dtx |
| 627 |
%makeindex -s gind.ist hypcap.idx |
| 628 |
%pdflatex hypcap.dtx |
| 629 |
%\end{verbatim} |
| 630 |
% \end{quote} |
| 631 |
% |
| 632 |
% \begin{History} |
| 633 |
% \begin{Version}{1999/02/13 v1.0} |
| 634 |
% \item |
| 635 |
% A beginning version, published in newsgroup \xnewsgroup{comp.text.tex}:\\ |
| 636 |
% \URL{``\link{Re: \xpackage{hyperref} and figures}''}^^A |
| 637 |
% {https://groups.google.com/group/comp.text.tex/msg/5c9b47b001a9379c} |
| 638 |
% \end{Version} |
| 639 |
% \begin{Version}{2000/08/14 v1.1} |
| 640 |
% \item |
| 641 |
% Global assignments of \cs{if@capstart} |
| 642 |
% in order to allow \cs{caption} in groups. |
| 643 |
% \item |
| 644 |
% Option \texttt{all} added. |
| 645 |
% \end{Version} |
| 646 |
% \begin{Version}{2000/09/07 v1.2} |
| 647 |
% \item |
| 648 |
% Package in dtx format. |
| 649 |
% \end{Version} |
| 650 |
% \begin{Version}{2001/08/27 v1.3} |
| 651 |
% \item |
| 652 |
% Bug fix with hyperref's pdfmark driver\\ |
| 653 |
% (\cs{leavevmode} in |
| 654 |
% \cs{hyper@@anchor}/\cs{pdf@rect}). |
| 655 |
% \end{Version} |
| 656 |
% \begin{Version}{2001/09/06 v1.4} |
| 657 |
% \item |
| 658 |
% Small fixes in the dtx file. |
| 659 |
% \end{Version} |
| 660 |
% \begin{Version}{2006/02/20 v1.5} |
| 661 |
% \item |
| 662 |
% Code is not changed. |
| 663 |
% \item |
| 664 |
% New DTX framework. |
| 665 |
% \end{Version} |
| 666 |
% \begin{Version}{2007/02/19 v1.6} |
| 667 |
% \item |
| 668 |
% Fix for hypertexnames=false. |
| 669 |
% \end{Version} |
| 670 |
% \begin{Version}{2007/04/09 v1.7} |
| 671 |
% \item |
| 672 |
% Stuff in \cs{caption} moved to \xpackage{hyperref}. |
| 673 |
% This avoids redefinitions of \cs{caption} and \cs{@caption} |
| 674 |
% (idea of Axel Sommerfeldt). |
| 675 |
% \item |
| 676 |
% Fix for subfigure (Marco Kuhlmann, Amilcar do Carmo Lucas). |
| 677 |
% \end{Version} |
| 678 |
% \begin{Version}{2008/04/14 v1.8} |
| 679 |
% \item |
| 680 |
% \cs{hc@redef} fixed to get package \xpackage{float} work |
| 681 |
% (Axel Sommerfeldt). |
| 682 |
% \end{Version} |
| 683 |
% \begin{Version}{2008/08/11 v1.9} |
| 684 |
% \item |
| 685 |
% Code is not changed. |
| 686 |
% \item |
| 687 |
% URLs updated. |
| 688 |
% \end{Version} |
| 689 |
% \begin{Version}{2008/09/08 v1.10} |
| 690 |
% \item |
| 691 |
% \cs{capstartfalse} and \cs{capstarttrue} added. |
| 692 |
% \end{Version} |
| 693 |
% \begin{Version}{2011/02/16 v1.11} |
| 694 |
% \item |
| 695 |
% \cs{hc@redef} fixed by using package \xpackage{letltxmacro}. |
| 696 |
% \end{Version} |
| 697 |
% \begin{Version}{2016/05/16 v1.12} |
| 698 |
% \item |
| 699 |
% Documentation updates. |
| 700 |
% \end{Version} |
| 701 |
% \begin{Version}{2024-07-26 v1.13} |
| 702 |
% \item Change error into warning, issue \#1 |
| 703 |
% \end{Version} |
| 704 |
% \end{History} |
| 705 |
% |
| 706 |
% \PrintIndex |
| 707 |
% |
| 708 |
% \Finale |
| 709 |
\endinput |