1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998
|
% \CheckSum{679}
% \iffalse meta-comment
% ======================================================================
% scrhack.dtx
% Copyright (c) Markus Kohm, 2008-2013
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% 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 and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
%
% To create `scrhack.sty' run `tex scrhack.dtx'. Using LaTeX instead
% of TeX would generate the implementation documentation.
% ----------------------------------------------------------------------
% scrhack.dtx
% Copyright (c) Markus Kohm, 2008-2013
%
% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
% Version 1.3c, verteilt und/oder veraendert werden.
% Die neuste Version dieser Lizenz ist
% http://www.latex-project.org/lppl.txt
% und Version 1.3c ist Teil aller Verteilungen von LaTeX
% Version 2005/12/01 oder spaeter und dieses Werks.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
% (allein durch den Autor verwaltet).
%
% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
%
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
%
% `scrhack.sty' kann durch den Aufruf `tex scrhack.dtx' erzeugt
% werden. Bei Verwendung von LaTeX statt TeX wird hingegen die
% Implementierungsdokumentation erzeugt.
% ======================================================================
% \fi
%
% \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
%%% From File: $Id: scrhack.dtx 1383 2013-10-01 15:44:28Z mjk $
%<package&identify>%%% using: package,identify
%<package&option>%%% using: package,option
%<package&body>%%% using: package,body
%<package&identity>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
%<*driver>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{scrhack.dtx}[%
%</driver>
%<manual>\ProvidesFile{scrhack.tex}[%
%<package&identify>\ProvidesPackage{scrhack}[%
%<hyperref&identify>\ProvidesFile{hyperref.hak}[%
%<float&identify>\ProvidesFile{float.hak}[%
%<floatrow&identify>\ProvidesFile{floatrow.hak}[%
%<listings&identify>\ProvidesFile{listings.hak}[%
%<*driver|manual|identify>
%!KOMAScriptVersion
package
%<*!identify>
(hacking other packages)%
%</!identify>
%</driver|manual|identify>
%<hack&identify> (hacking package
%<hyperref&identify> hyperref)%
%<float&identify> float)%
%<floatrow&identify> floatrow)%
%<listings&identify> listings)%
%<*driver|manual|identify>
]
%</driver|manual|identify>
%<*dtx>
\ifx\documentclass\undefined
\input scrdocstrip.tex
\@@input scrkernel-version.dtx
\@@input scrstrip.inc
\KOMAdefVariable{COPYRIGHTFROM}{2008}
\generate{\usepreamble\defaultpreamble
\file{scrhack.sty}{%
\from{scrkernel-version.dtx}{package,scrhack}%
\from{scrhack.dtx}{package,identify}%
\from{scrkernel-basics.dtx}{load}%
\from{scrhack.dtx}{package,option}%
\from{scrhack.dtx}{package,body}%
\from{scrlogo.dtx}{logo}%
}%
\file{hyperref.hak}{%
\from{scrkernel-version.dtx}{file,hyperref.hak}%
\from{scrhack.dtx}{hack,hyperref,identify}%
\from{scrhack.dtx}{hack,hyperref,body}%
}%
\file{float.hak}{%
\from{scrkernel-version.dtx}{file,float.hak}%
\from{scrhack.dtx}{hack,float,identify}%
\from{scrhack.dtx}{hack,float,body}%
}%
\file{floatrow.hak}{%
\from{scrkernel-version.dtx}{file,floatrow.hak}%
\from{scrhack.dtx}{hack,floatrow,identify}%
\from{scrhack.dtx}{hack,floatrow,body}%
}%
\file{listings.hak}{%
\from{scrkernel-version.dtx}{file,listings.hak}%
\from{scrhack.dtx}{hack,listings,identify}%
\from{scrhack.dtx}{hack,listings,body}%
}%
}
\@@input scrstrop.inc
\else
\let\endbatchfile\relax
\fi
\endbatchfile
%</dtx>
%<*driver>
\documentclass[halfparskip-]{scrdoc}
\usepackage[latin1]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\CodelineIndex
\RecordChanges
\begin{document}
\GetFileInfo{scrhack.dtx}
\DocInput{scrhack.dtx}
\end{document}
%</driver>
% \fi
%
%
% \selectlanguage{english}
%
% \newcommand*{\Package}[1]{\textsf{\mbox{#1}}}
% \let\File\Package
% \let\Macro\cs
% \let\PName\meta
% \let\Parameter\marg
% \providecommand*{\PParameter}[1]{\texttt{\{#1\}}}
% \providecommand*{\Counter}[1]{\texttt{\mbox{#1}}}
% \providecommand*{\OptionValue}[2]{\texttt{\mbox{#1=}\linebreak[3]\mbox{#2}}}
% \let\PValue\texttt
%
% \title{\KOMAScript{} \partname\ \texttt{\filename}%
% \thanks{This file is version \fileversion\ of \texttt{\filename}.}}
% \date{\filedate}
% \author{Markus Kohm\thanks{mailto:komascript(at)gmx.info}}
% \maketitle
% \begin{abstract}
% \iffalse
%<*manual|dtx>
%<*manual>
\chapter{Hacks for Third-Party Packages by Package \Package{scrhack}}
\labelbase{scrhack}
%</manual>
% \fi
Some packages from other authors may have problems with \KOMAScript{}. In my
opinion some packages could be improved. With some packages this makes only
sense, if \KOMAScript{} was used. With some other packages the package author
has another opinion. Sometimes proposals was never answered. Package
\Package{scrhack} contains all those improvement proposals for other
packages. This means, \Package{scrhack} redefines macros of packages from
other authors! The redefinitions are only activated, if those packages were
loaded. Users may prevent \Package{scrhack} from redefining macros of
individual packages.
%\iffalse
%<*dtx>
%\fi
% \end{abstract}
% \tableofcontents
%\iffalse
%</dtx>
%\fi
\section{The \Package{hyperref} hack}
\label{sec:scrhack.hyperref}
Before version~6.79h package \Package{hyperref} does behave different at part,
chapter, and section headings that get no number. If they get no number,
because of to low counter \Counter{secnumdepth} \Package{hyperref} sets an
anchor for links and bookmarks before the heading. Same would be, if the
headings have a number. But if the headings get no number because of usage of
the star version of the commands, e.g., \Macro{part*}, \Macro{chapter*} or
\Macro{section*}, the anchor for links and bookmarks are set after the
headings. The anchors for numbered headings are always set before the
headings.
Package \Package{scrhack} redefines some macros of some hyperref driver files,
e.g., \File{hpdftex.def}, after loading the hyperref driver file. With this
redefinitions the anchor of not numbered headings will be set always before
the headings, too.
% \iffalse
\begin{Declaration}
\KOption{hyperref}{switch}
\end{Declaration}
% \fi
You may switch off the \Package{hyperref} hack loading package
\Package{scrhack} with option \OptionValue{hyperref}{false}. You may also
switch off the \Package{hyperref} hack using
\Macro{KOMAoptions}\PParameter{hyperref=false} or
\Macro{KOMAoption}\PParameter{hyperref}\PParameter{false} somewhere after
loading package \Package{scrhack}, but before loading the hyperref driver
package, that is by default after loading the package.
\section{The \Package{float} hack}
\label{sec:scrhack.float}
Package \Package{float} uses macros \Macro{float@listhead} to set the headings
of a float listing and \Macro{float@addtolists} to add informations to all
float listings. These macros where proposed by the \KOMAScript{} author for
some years. In theory those macros may be used by several class and package
authors to deligate some parts of the creation of a float listing to the
class. This would increase the compatiblity of packages and classes. But
unfortunately some package authors, even the author of package
\Package{float}, implemented the commands in such a way, that these packages
will become incompatible to each other.
Because of this \KOMAScript\ stopped support for \Macro{float@addtolists} and
\Macro{float@listhead} with version 3. Instead of this \KOMAScript\ supports
several improvements for package authors using \KOMAScript\ package
\Package{tocbasic}.
Package \Package{scrhack} redefines some macros of package \Package{float} to
not longer use \Macro{float@addtolists} and \Macro{float@listhead} but use the
interface of package \Package{tocbasic}. This does not only improve the
compatibility of \KOMAScript\ and package \Package{float}, but also improves
the compatibility of packages \Package{babel} and \Package{float}.
% \iffalse
\begin{Declaration}
\KOption{float}{switch}
\end{Declaration}
% \fi
You may switch off the \Package{float} hack loading package \Package{scrhack}
with option \OptionValue{float}{false}. You may also switch off the
\Package{float} hack using \Macro{KOMAoptions}\PParameter{float=false} or
\Macro{KOMAoption}\PParameter{float}\PParameter{false} somewhere after loading
package \Package{scrhack}, but before loading package \Package{float}.
\section{The \Package{floatrow} hack}
\label{sec:scrhack.floatrow}
Package \Package{floatrow} uses macros \Macro{float@listhead} to set the
headings of a float listing and \Macro{float@addtolists} to add informations
to all float listings. These macros where proposed by the \KOMAScript{} author
for some years. In theory those macros may be used by several class and package
authors to deligate some parts of the creation of a float listing to the
class. This would increase the compatiblity of packages and classes. But
unfortunately some package authors, even the author of package
\Package{floatrow}, implemented the commands in such a way, that these packages
will become incompatible to each other.
Because of this \KOMAScript\ stopped support for \Macro{float@addtolists} and
\Macro{float@listhead} with version 3. Instead of this \KOMAScript\ supports
several improvements for package authors using \KOMAScript\ package
\Package{tocbasic}.
Package \Package{scrhack} redefines some macros of package \Package{floatrow}
to not longer use \Macro{float@addtolists} and \Macro{float@listhead} but use
the interface of package \Package{tocbasic}. This does not only improve the
compatibility of \KOMAScript\ and package \Package{floatrow}, but also
improves the compatibility of packages \Package{babel} and \Package{floatrow}.
% \iffalse
\begin{Declaration}
\KOption{floatrow}{switch}
\end{Declaration}
% \fi
You may switch off the \Package{floatrow} hack loading package
\Package{scrhack} with option \OptionValue{floatrow}{false}. You may also
switch off the \Package{floatrow} hack using
\Macro{KOMAoptions}\PParameter{floatrow=false} or
\Macro{KOMAoption}\PParameter{floatrow}\PParameter{false} somewhere after
loading package \Package{scrhack}, but before loading package
\Package{floatrow}.
\section{The \Package{listings} hack}
\label{sec:scrhack.listings}
Package \Package{listings} uses macros \Macro{float@listhead} to set the
headings of a float listing, if defined, and \Macro{float@addtolists} to add
informations to all float listings. These macros where proposed by the
\KOMAScript{} author for some years. In theory those macros may be used by
several class and package authors to deligate some parts of the creation of a
float listing to the class. This would increase the compatiblity of packages
and classes. But unfortunately some package authors, even the author of
package \Package{float}, impemented the commands in such a way, that these
packages may become incompatible to each other.
Because of this \KOMAScript\ stopped support for \Macro{float@addtolists} and
\Macro{float@listhead} with version 3. Instead of this \KOMAScript\ supports
several improvements for package authors using \KOMAScript\ package
\Package{tocbasic}.
Package \Package{scrhack} redefines some macros of package \Package{listings} to
not longer use \Macro{float@addtolists} and \Macro{float@listhead} but use the
interface of package \Package{tocbasic}. This does not only improve the
compatibility of \KOMAScript\ and package \Package{listings}, but also improves
the compatibility of packages \Package{babel} and \Package{listings}.
Note: A significant change with \Package{scrhack} is, that \KOMAScript{} options
like \OptionValue{lists}{totoc} or \OptionValue{lists}{totocnumbered} does only
change the behaviour of \Macro{listoflistings}, if they are set after loading
package \Package{listings}.
% \iffalse
\begin{Declaration}
\KOption{listings}{switch}
\end{Declaration}
% \fi
You may switch off the \Package{listings} hack loading package
\Package{scrhack} with option \OptionValue{listings}{false}. You may also
switch off the \Package{listings} hack using
\Macro{KOMAoptions}\PParameter{listings=false} or
\Macro{KOMAoption}\PParameter{listings}\PParameter{false} somewhere after
loading package \Package{scrhack}, but before loading package
\Package{listings}.
% \iffalse
%</manual|dtx>
% \fi
%
% \selectlanguage{ngerman}
% \StopEventually{\PrintIndex\PrintChanges}
% \changes{v3.03}{2009/03/12}{erste Version des Pakets}
%
% \section{Implementation of \Package{scrhack}}
%
% \changes{v3.04b}{2009/08/05}{Die Reihenfolge von Anweisungen und Optionen
% grundlegend gendert, um das Paket \textsf{scrhack} unabhngiger von der
% Reihenfolge beim Laden von Paketen zu machen.}
%
% \subsection{Optionen}
%
% \iffalse
%<*package&option>
% \fi
%
% Das Paket bedient sich \cs{KOMAoptions} etc. aus \textsf{scrkbase} (dieses
% wird brigens direkt per \texttt{scrkbase.dtx} geladen).
%
% Per Option kann gewhlt werden, welche Manipulationen geladen werden
% sollen. Alle diese Optionen knnen jedoch nur bis zum Laden des
% entsprechenden Pakets oder dem Laden von \textsf{scrhack} gesetzt
% werden (es zhlt, was spter kommt). Anschlieend sind sie wirkungslos.
%
% \subsection{Verwendete Anweisungen}
%
% \iffalse
%</package&option>
%<*package&body>
% \fi
%
% \begin{macro}{\scr@ifexpected}
% Wenn die im ersten Argument angegebene Anweisung nach Ausfhrung der im
% zweiten Argument angegebenen Anweisungen unverndert ist, dann soll das
% dritte Argument ausgefhrt werden, sonst das vierte.
% \begin{macrocode}
\newcommand{\scr@ifexpected}[2]{%
\begingroup
\let\@tempa#1
#2
\ifx\@tempa#1
\aftergroup\@firstoftwo
\else
\aftergroup\@secondoftwo
\fi
\endgroup
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\scr@hack@load}
% Wenn die Datei mit dem Namen des zweiten Arguments und der Endung des ersten
% Arguments so geladen wurde, dass \LaTeX{} eine Versionsinfo dazu gespeichert
% hat, dann soll zustzlich der entsprechende Hack geladen werden.
% \begin{macrocode}
\newcommand*{\scr@hack@load}[2]{%
\expandafter\ifx\csname ver@#2.#1\endcsname\relax
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
{%
\PackageInfo{scrhack}{loading #2 hack}%
\edef\reserved@a{%
\noexpand\makeatletter\noexpand\input{#2.hak}%
\noexpand\catcode`\noexpand\@\the\catcode`\@\relax
}\reserved@a
}{%
\PackageInfo{scrhack}{ignorring #2 hack}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \iffalse
%</package&body>
% \fi
%
% \subsection{Der \textsf{hyperref}-Hack}
%
% \textsf{hyperref} setzt den Anker zu der Stern-Variante einer berschrift
% hinter die berschrift, whrend es bei der nicht Stern-Variante den Anker
% auch dann vor die berschrift setzt, wenn die berschrift aufgrund von
% \texttt{secnumdepth} nicht nummeriert wird. Der Hack setzt den Anker
% einheitlich vor die berschrift.
%
% \begin{option}{hyperref}
% \changes{v3.12}{2013/03/05}{Signalisierung mit \cs{FamilyKeyStateProcessed}}
% \begin{macrocode}
%<*package&option>
\KOMA@ifkey{hyperref}{@scrhack@hyperref}%
\@scrhack@hyperreftrue
%</package&option>
%<*package&body>
% \end{macrocode}
% \changes{v3.04b}{2009/11/09}{\textsf{hyperref}-Hack wird frher geladen}
% Hier muss ein wenig trickreicher gearbeitet werden, weil \textsf{hyperref}
% die Treiberdatei per \cs{AtEndOfPackage} ldt und der Hack erst danach
% installiert werden darf. Mit \cs{AfterPackage*} alleine, wrde der Hack aber
% vor dem Laden der Treiberdatei installiert. Dafr knnen wir aber sicher
% sein, dass ein innerhalb von \cs{AfterPackage*} aufgerufenes
% \cs{AtEndOfPackage} garantiert nach dem Laden der Treiberdatei ausgefhrt
% wird. Das funktioniert auch noch, wenn \textsf{hyperref} bereits geladen
% wurde. In dem Fall wird der Code einfach nach dem Ende von \textsf{scrhack}
% statt nach dem Ende von \textsf{hyperref} ausgefhrt.
% \begin{macrocode}
\AfterPackage*{hyperref}{%
\@ifpackagelater{hyperref}{2009/11/24}{%
\PackageInfo{scrhack}{hyperref hack deactivated because of\MessageBreak
detection of hyperref version, that doesn't\MessageBreak
need that hack,}%
}{%
\AtEndOfPackage{%
\KOMA@key[.scrhack.sty]{hyperref}{%
\PackageWarning{scrhack}{option `hyperref=#1' ignored}%
\FamilyKeyStateProcessed
}%
\if@scrhack@hyperref\scr@hack@load\@pkgextension{hyperref}\fi
}%
}%
}
%</package&body>
% \end{macrocode}
% \end{option}
%
%
% \begin{macro}{\@schapter}
% \begin{macro}{\@spart}
% \begin{macro}{\@ssect}
% Eigentlich wird hier gar nicht \texttt{hyperref.sty} verndert, sondern
% diverse Treiberdateien. Sobald das Paket \textsf{hyperref} geladen ist, ist
% auch die passende Treiberdatei geladen und auerdem sind alle
% Treiberdateien, die entsprechende Definitionen vornehmen, gleichermaen
% betroffen. Also kann der entsprechende Patch einfach erfolgen, wenn hyperref
% geladen ist (was bereits von \cs{scr@hack@load} getestet wurde). Es muss
% also nur noch sichergestellt werden, dass die umzudefinierenden Macros
% derzeit den erwarteten Inhalt haben.
% \begin{macrocode}
%<*hyperref&body>
\scr@ifexpected\@schapter{%
\def\@schapter#1{%
\H@old@schapter{#1}%
\begingroup
\let\@mkboth\@gobbletwo
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
\endgroup
}%
}{%
\PackageInfo{scrhack}{redefining \string\@schapter}%
\def\@schapter#1{%
\begingroup
\let\@mkboth\@gobbletwo
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
\endgroup
\H@old@schapter{#1}%
}%
}{%
\scr@ifexpected\@schapter{%
\def\@schapter#1{%
\begingroup
\let\@mkboth\@gobbletwo
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
\endgroup
\H@old@schapter{#1}%
}%
}{}{%
\PackageWarningNoLine{scrhack}{unknown \string\@schapter\space
definition found!\MessageBreak
Maybe you are using a unsupported hyperref version}%
}%
}
\scr@ifexpected\@spart{%
\def\@spart#1{%
\H@old@spart{#1}%
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{part*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
}%
}{%
\PackageInfo{scrhack}{redefining \string\@spart}%
\def\@spart#1{%
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{part*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
\H@old@spart{#1}%
}%
}{%
\scr@ifexpected\@spart{%
\def\@spart#1{%
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{part*.\the\Hy@linkcounter}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
\H@old@spart{#1}%
}%
}{}{%
\PackageWarningNoLine{scrhack}{unknown \string\@spart\space
definition found!\MessageBreak
Maybe you are using a unsupported hyperref version}%
}%
}
\scr@ifexpected\@ssect{%
\def\@ssect#1#2#3#4#5{%
\H@old@ssect{#1}{#2}{#3}{#4}{#5}%
\phantomsection
}%
}{%
\PackageInfo{scrhack}{redefining \string\@ssect}%
\def\@ssect#1#2#3#4#5{%
\H@old@ssect{#1}{#2}{#3}{#4}{\phantomsection\ignorespaces#5}%
}%
}{%
\scr@ifexpected\@ssect{%
\def\@ssect#1#2#3#4#5{%
\H@old@ssect{#1}{#2}{#3}{#4}{\phantomsection\ignorespaces#5}%
}%
}{}{%
\PackageWarningNoLine{scrhack}{unknown \string\@ssect\space
definition found!\MessageBreak
Maybe you are using a unsupported hyperref version}%
}%
}
%</hyperref&body>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Der \textsf{float}-Hack}
%
% Das \textsf{float}-Paket verwendet das Makro \cs{float@listhead} zum
% Setzen der berschriften. Dies wird seit \KOMAScript~3 nicht mehr empfohlen
% und fliegt demnchst komplett aus der Untersttzung. Stattdessen wird
% empfohlen, dass Pakete \textsf{tocbasic} untersttzen. Der Aufwand dafr ist
% sehr gering und wird mit vielen neuen Mglichkeiten belohnt.
%
% Dieser Hack rstet die \textsf{tocbasic}-Untersttzung fr \textsf{float}
% nach.
%
% \begin{option}{float}
% \changes{v3.12}{2013/03/05}{Signalisierung mit \cs{FamilyKeyStateProcessed}}
% \begin{macrocode}
%<*package&option>
\KOMA@ifkey{float}{@scrhack@float}%
\@scrhack@floattrue
%</package&option>
%<*package&body>
\AfterPackage*{float}{%
\KOMA@key[.scrhack.sty]{float}{%
\PackageWarning{scrhack}{option `float' ignored}%
\FamilyKeyStateProcessed
}%
\if@scrhack@float\scr@hack@load\@pkgextension{float}\fi
}
%</package&body>
% \end{macrocode}
% \end{option}
%
%
% \begin{macro}{\newfloat}
% ber die Anweisung \cs{newfloat} wird eine neue Gleitumgebung
% definiert. Hier muss die neue Erweiterung aus dem dritten Argument
% \textsf{tocbasic} bekannt gemacht werden.
% \begin{macro}{\listof}
% ber die Anweisung \cs{listof} wird ein Verzeichnis fr Gleitumgebungen
% ausgegeben. Hier muss schlicht die entsprechende Anweisung von
% \textsf{tocbasic} verwendet werden.
% \begin{macro}{\float@addtolists}
% Diese Anweisung wird nicht lnger bentigt und daher auf die ursprngliche
% Definition zurckgesetzt.
% \begin{macrocode}
%<*float&body>
\scr@ifexpected{\newfloat}{%
\long\def\newfloat#1#2#3{\@namedef{ext@#1}{#3}
\let\float@do=\relax
\xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
\@tempa
\floatplacement{#1}{#2}%
\@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
\expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
\addtocounter{float@type}{\value{float@type}}
\restylefloat{#1}%
\expandafter\edef\csname fnum@#1\endcsname%
{\expandafter\noexpand\csname fname@#1\endcsname{}
\expandafter\noexpand\csname the#1\endcsname}
\@ifnextchar[%]
{\float@newx{#1}}%
{\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
{}}}%
}{%
\scr@ifexpected{\listof}{%
\def\listof#1#2{%
\@ifundefined{ext@#1}{\float@error{#1}}{%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\float@listhead{#2}%
\begingroup\setlength{\parskip}{\z@}%
\@starttoc{\@nameuse{ext@#1}}%
\endgroup}}%
}{%
\RequirePackage{tocbasic}%
\PackageInfo{scrhack}{redefining \string\newfloat}%
\renewcommand\newfloat[3]{%
\ifattoclist{#3}{%
\PackageError{scrhack}{extension `#3' already in use}{%
Each extension may be used only once.\MessageBreak
You, the class, or another package already uses extension
`#3'.\MessageBreak
\string\newfloat\space command will be ignored!}%
}{%
\addtotoclist[float]{#3}%
\setuptoc{#3}{chapteratlist}%
\@namedef{ext@#1}{#3}%
\let\float@do=\relax
\xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
\@tempa
\floatplacement{#1}{#2}%
\@ifundefined{fname@#1}{\floatname{#1}{#1}}{}%
\expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
\addtocounter{float@type}{\value{float@type}}
\restylefloat{#1}%
\expandafter\edef\csname fnum@#1\endcsname%
{\expandafter\noexpand\csname fname@#1\endcsname{}
\expandafter\noexpand\csname the#1\endcsname}%
\@ifnextchar[%]
{\float@newx{#1}}%
{\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
{}}}%
}%
\PackageInfo{scrhack}{redefining \string\listof}%
\renewcommand*\listof[2]{%
\@ifundefined{ext@#1}{\float@error{#1}}{%
\@ifundefined{l@#1}{\expandafter\let\csname l@#1\endcsname\l@figure
\@ifundefined{l@#1}{%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}}{}%
}{}%
\listoftoc[{#2}]{\csname ext@#1\endcsname}%
}%
}%
\scr@ifexpected{\float@addtolists}{%
\long\def\float@addtolists#1{%
\def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}%
}{%
\PackageInfo{scrhack}{undefining \string\float@addtolists}%
\let\float@addtolists\relax
}{%
\PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
definition found!\MessageBreak
Maybe you are using a unsupported float version}%
}%
}{%
\PackageWarningNoLine{scrhack}{unknown \string\listof\space
definition found!\MessageBreak
Maybe you are using a unsupported float version}%
}%
}{%
\PackageWarningNoLine{scrhack}{unknown \string\newfloat\space
definition found!\MessageBreak
Maybe you are using a unsupported float version}%
}
%</float&body>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Der \textsf{floatrow}-Hack}
%
% Das \textsf{floatrow}-Paket verwendet das Makro \cs{float@listhead} zum
% Setzen der berschriften. Dies wird seit \KOMAScript~3 nicht mehr empfohlen
% und fliegt demnchst komplett aus der Untersttzung. Stattdessen wird
% empfohlen, dass Pakete \textsf{tocbasic} untersttzen. Der Aufwand dafr ist
% sehr gering und wird mit vielen neuen Mglichkeiten belohnt.
%
% Dieser Hack rstet die \textsf{tocbasic}-Untersttzung fr \textsf{floatrow}
% nach.
%
% \begin{option}{floatrow}
% \changes{v3.12}{2013/03/05}{Signalisierung mit \cs{FamilyKeyStateProcessed}}
% \begin{macrocode}
%<*package&option>
\KOMA@ifkey{floatrow}{@scrhack@floatrow}%
\@scrhack@floatrowtrue
%</package&option>
%<*package&body>
\AfterPackage*{floatrow}{%
\KOMA@key[.scrhack.sty]{floatrow}{%
\PackageWarning{scrhack}{option `floatrow' ignored}%
\FamilyKeyStateProcessed
}%
\if@scrhack@floatrow\scr@hack@load\@pkgextension{floatrow}\fi
}
%</package&body>
% \end{macrocode}
% \end{option}
%
%
% \begin{macro}{\DeclareNewFloatType}
% ber die Anweisung \cs{DeclareNewFloatType} wird eine neue Gleitumgebung
% definiert. Hier muss die neue Erweiterung aus dem dritten Argument
% \textsf{tocbasic} bekannt gemacht werden.
% \begin{macro}{\listof}
% ber die Anweisung \cs{listof} wird ein Verzeichnis fr Gleitumgebungen
% ausgegeben. Hier muss schlicht die entsprechende Anweisung von
% \textsf{tocbasic} verwendet werden.
% \begin{macro}{\float@addtolists}
% Diese Anweisung wird nicht lnger bentigt und daher auf die ursprngliche
% Definition zurckgesetzt.
% \begin{macrocode}
%<*floatrow&body>
\scr@ifexpected{\DeclareNewFloatType}{%
\long\def\DeclareNewFloatType#1#2{\def\FB@captype{#1}%
\expandafter\edef\csname ftype@#1\endcsname{\the\c@float@type}%
\addtocounter{float@type}{\value{float@type}}%
\@namedef{#1name}{#1}\newcounter{#1}%
\expandafter\edef\csname fnum@#1\endcsname
{\expandafter\noexpand\csname #1name\endcsname\nobreakspace
\expandafter\noexpand\csname the#1\endcsname}%
\@namedef{the#1}{\arabic{#1}}\flnew@ext{lo#1}\@namedef{fps@#1}{tbp}%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\caption@setkeys[floatrow]{newfloat}{#2}\let\FR@tmp=\relax
\xdef\@tempa{\noexpand\flrow@types{\the\flrow@types \FR@tmp{#1}}}%
\@tempa}%
}{%
\scr@ifexpected{\listof}{%
\def\listof#1#2{%
\@ifundefined{ext@#1}{\flrow@error{Unknown float style `#1'}}{%
\expandafter\providecommand\csname l@#1\endcsname
{\@dottedtocline{1}{1.5em}{2.3em}}%
\float@listhead{#2}%
\begingroup\setlength{\parskip}{\z@}%
\@starttoc{\@nameuse{ext@#1}}%
\endgroup}}%
}{%
\RequirePackage{tocbasic}%
\PackageInfo{scrhack}{redefining \string\DeclareNewFloatType}%
% \end{macrocode}
% Eigentlich wre es besser, wie im \textsf{float}-Hack einen Test
% vorzuschalten, ob die Dateiendung bereits in Gebrauch ist. Aber das wrde
% voraussetzen, dass die Reihenfolge der Anweisungen gendert wird. Dazu
% stecke ich aber im Code von \textsf{floatrow} zu wenig
% drin. (\emph{\foreignlanguage{english}{Note: It would be better to first
% test, if the new extension is already in use like done at the
% \textsf{float} hack. But I don't know the \textsf{floatrow} code good
% enough to make such a change!}})
% \begin{macrocode}
\renewcommand\DeclareNewFloatType[2]{\def\FB@captype{#1}%
\expandafter\edef\csname ftype@#1\endcsname{\the\c@float@type}%
\addtocounter{float@type}{\value{float@type}}%
\@namedef{#1name}{#1}\newcounter{#1}%
\expandafter\edef\csname fnum@#1\endcsname
{\expandafter\noexpand\csname #1name\endcsname\nobreakspace
\expandafter\noexpand\csname the#1\endcsname}%
\@namedef{the#1}{\arabic{#1}}\flnew@ext{lo#1}\@namedef{fps@#1}{tbp}%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\caption@setkeys[floatrow]{newfloat}{#2}\let\FR@tmp=\relax
\xdef\@tempa{\noexpand\flrow@types{\the\flrow@types \FR@tmp{#1}}}%
\@tempa
\xdef\@tempa{\noexpand\addtotoclist[float]{\@nameuse{ext@\FB@captype}}%
\noexpand\setuptoc{\@nameuse{ext@\FB@captype}}{chapteratlist}%
}%
\@tempa
}%
\PackageInfo{scrhack}{redefining \string\listof}%
\renewcommand*\listof[2]{%
\@ifundefined{ext@#1}{\flrow@error{Unknown float style `#1'}}{%
\@ifundefined{l@#1}{\expandafter\let\csname l@#1\endcsname\l@figure
\@ifundefined{l@#1}{%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}}{}%
}{}%
\listoftoc[{#2}]{\csname ext@#1\endcsname}%
}%
}%
\scr@ifexpected{\float@addtolists}{%
\long\def\float@addtolists#1{%
\def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}%
}{%
\PackageInfo{scrhack}{undefining \string\float@addtolists}%
\let\float@addtolists\relax
}{%
\PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
definition found!\MessageBreak
Maybe you are using a unsupported floatrow version}%
}%
}{%
\PackageWarningNoLine{scrhack}{unknown \string\listof\space
definition found!\MessageBreak
Maybe you are using a unsupported floatrow version}%
}%
}{%
\PackageWarningNoLine{scrhack}{unknown \string\DeclareNewFloatType\space
definition found!\MessageBreak
Maybe you are using a unsupported floatrow version}%
}
%</floatrow&body>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Der \textsf{listings}-Hack}
%
% Das \textsf{listings}-Paket verwendet das Makro \cs{float@listhead} zum
% Setzen der berschriften. Dies wird seit \KOMAScript~3 nicht mehr empfohlen
% und fliegt demnchst komplett aus der Untersttzung. Stattdessen wird
% empfohlen, dass Pakete \textsf{tocbasic} untersttzen. Der Aufwand dafr ist
% sehr gering und wird mit vielen neuen Mglichkeiten belohnt.
%
% Dieser Hack rstet die \textsf{tocbasic}-Untersttzung fr \textsf{listings}
% nach.
%
% \begin{option}{listings}
% \changes{v3.12}{2013/03/05}{Signalisierung mit \cs{FamilyKeyStateProcessed}}
% \begin{macrocode}
%<*package&option>
\KOMA@ifkey{listings}{@scrhack@listings}%
\@scrhack@listingstrue
%</package&option>
%<*package&body>
\AfterPackage*{listings}{%
\KOMA@key[.scrhack.sty]{listings}{%
\PackageWarning{scrhack}{option `listings' ignored}%
\FamilyKeyStateProcessed
}%
\if@scrhack@listings\scr@hack@load\@pkgextension{listings}\fi
}
%</package&body>
% \end{macrocode}
% \end{option}
%
%
% \begin{macro}{\scr@do@hack@listings}
% \begin{macro}{\lstlistoflistings}
% ber dieses Macro wird das Verzeichnis der Listings gesetzt. Die gesamte
% Funktionalitt dafr kann \Package{tocbasic} berlassen werden.
% \begin{macro}{\float@addtolists}
% Diese Anweisung wird nicht lnger bentigt und daher auf die ursprngliche
% Definition zurckgesetzt. Da \Package{listings} ihre Definition mit
% \Macro{AtBeginDocument} verzgert, muss dies hier ebenfalls geschehen.
% \begin{macrocode}
%<*listings&body>
\newcommand*{\scr@do@hack@listings}{%
\RequirePackage{tocbasic}%
\addtotoclist[float]{lol}%
\setuptoc{lol}{chapteratlist}%
\PackageInfo{scrhack}{redefining \string\lstlistoflistings}%
\renewcommand*{\lstlistoflistings}{\listoftoc[{\lstlistlistingname}]{lol}}%
\AtBeginDocument{%
\scr@ifexpected{\float@addtolists}{%
\def\float@addtolists##1{\addtocontents{lol}{##1}}%
}{%
\PackageInfo{scrhack}{undefining \string\float@addtolists}%
\let\float@addtolists\relax
}{%
\scr@ifexpected{\float@addtolists}{%
\def\float@addtolists##1{\addtocontents{lol}{##1}%
\orig@float@addtolists{##1}}%
}{%
\PackageInfo{scrhack}{setting \string\float@addtolists\MessageBreak
to \string\orig@float@addtolists}%
\let\float@addtolists\orig@float@addtolists
}{%
\PackageWarningNoLine{scrhack}{unkown \string\float@addtolists\space
definition found!\MessageBreak
Maybe you are using a unsupported listings version}%
}%
}%
}%
\let\scr@do@hack@listings\relax
}
\scr@ifexpected{\lstlistoflistings}{%
\def\lstlistoflistings{\bgroup
\let\contentsname\lstlistlistingname
\let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}%
\tableofcontents \egroup}%
}{%
\scr@do@hack@listings
}{%
\scr@ifexpected{\lstlistoflistings}{%
\def\lstlistoflistings{%
\begingroup
\@ifundefined{@restonecoltrue}{}{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
}%
\float@listhead{\lstlistlistingname}%
\parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil%
\@starttoc{lol}%
\@ifundefined{@restonecoltrue}{}{%
\if@restonecol\twocolumn\fi
}%
\endgroup
}%
}{%
\scr@do@hack@listings
}{%
\PackageWarningNoLine{scrhack}{unknown \string\lstlistoflistings\space
definition found!\MessageBreak
Maybe you are using a unsupported listings version}%
}%
}
%</listings&body>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Optionen ausfhren}
%
% Zum Schluss noch die Optionen ausfhren. Im Paket wird diese Anweisung
% allerdings vor den Anweisungen der Hacks und den Anweisungen aus dem
% Abschnitt Verwendete Anweisungen stehen.
% \begin{macrocode}
%<*package&option>
\KOMAProcessOptions\relax
%</package&option>
% \end{macrocode}
%
%
% \Finale
%
\endinput
%
% end of file `scrhack.dtx'
%%% Local Variables:
%%% mode: doctex
%%% coding: iso-latin-1
%%% TeX-master:
%%% End:
|