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 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332
|
% \iffalse
\NeedsTeXFormat{LaTeX2e}[1996/10/24]
%<package>\ProvidesPackage{ragged2e}
%<package> [2003/03/25 v2.04 ragged2e Package (MS)]
%
%<*driver>
\ProvidesFile{ragged2e.drv}
[2003/03/25 v1.06 Driver for ragged2e Package (MS)]
\documentclass{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage{url} % in latex/contrib/other/misc
\usepackage{array}
\usepackage{tabularx}
% booktabs.sty is in latex/contrib/supported/booktab
\IfFileExists{booktabs.sty}{%
\usepackage{booktabs}%
}{%
\PackageWarning{ragged2e}%
{booktabs.sty is missing.\MessageBreak
I'm emulating the needed commands, but you should\MessageBreak
install it for better results}%
\let\toprule\hline
\let\midrule\hline
\let\bottomrule\hline
}
\usepackage[document]{ragged2e}[2003/01/26]
\setlength{\RaggedRightRightskip}{0pt plus 4em}%
\GetFileInfo{ragged2e.sty}
\EnableCrossrefs
\RecordChanges % Gather update information
%%\DisableCrossrefs% Say \DisableCrossrefs if index is ready
\CodelineIndex % Index code by line number
\OnlyDescription % comment out for implementation details
%%\OldMakeIndex % use if your MakeIndex is pre-v2.9
\setcounter{IndexColumns}{2}
\setlength{\IndexMin}{40ex}
\setlength{\columnseprule}{.4pt}
\addtolength{\oddsidemargin}{1cm}
\addtolength{\textwidth}{-1cm}
\begin{document}
\DocInput{ragged2e.dtx}
\PrintIndex\PrintChanges
% Make sure that the index is not printed twice
% (ltxdoc.cfg might have a second \PrintIndex command)
\let\PrintChanges\relax
\let\PrintIndex\relax
\end{document}
%</driver>
%
% Copyright 1996, 1998, 1999, 2003 by Martin Schr"oder. All rights reserved.
%
% This program may be redistributed and/or modified under the terms
% of the LaTeX Project Public License, either version 1.2 of this
% license, or (at your option) any later version.
% The latest version of this license is in
% CTAN:macros/latex/base/lppl.txt.
%
% For error reports in case of UNCHANGED versions see ragged2e.ins
%
% \fi
%
% \CheckSum{466}
% ^^A$Id: ragged2e.dtx,v 1.22 2003/03/25 20:10:06 ms Exp $
%
%% \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 meta-comment
%% ===================================================================
%% @LaTeX-style-file{
%% author = {Martin Schr\"oder},
%% version = "2.04",
%% date = "25 March 2003",
%% filename = "ragged2e.sty",
%% address = {Martin Schr\"oder
%% Cr\"usemannallee 3
%% 28213 Bremen
%% Germany}
%% telephone = "+49-421-2239425",
%% email = "martin@oneiros.de",
% codetable = "ISO/ASCII",
% keywords = "raggedright",
% dependences = "everysel",
% supported = "yes",
%% docstring = "LaTeX package which defines new commands
%% \Centering, \RaggedLeft, \RaggedRight and
%% \justifying and new environments Center,
%% FlushLeft, FlushRight and justify, which
%% set ragged text and are easily configurable
%% to allow hyphenation.
%% Uses the everysel package.
%% "
%% }
%% ===================================================================
%% \fi
%
% \pagestyle{headings}
%
% \newcommand*{\file}[1] {\texttt{#1}}
% \newcommand{\plain} {\texttt{plain}}
% \newcommand{\bs} {\texttt{\symbol{'134}}}
% \newcommand*{\env}[1] {\textsf{#1}}
% \newcommand*{\option}[1] {\textsf{#1}}
% \newcommand*{\package}[1] {\textsf{#1}}
% \newcommand*{\NEWfeature}[1]{%
% \hskip 1sp \marginpar{\small\sffamily\raggedright
% New feature\\#1}}
% \newcommand*{\NEWdescription}[1]{%
% \hskip 1sp \marginpar{\small\sffamily\raggedright
% New description\\#1}}
%
% \changes{v1.00}{1996/05/30}{New from \package{raggedright} V 1.21}
% \changes{v1.01}{1998/08/09}{Documentation improved}
% \changes{v1.02}{1999/06/08}{Moved to LPPL}
% \changes{v2.00}{2003/01/04}{Incorporated \package{raggedr}}
%
% \hyphenation{flush-left rag-ged rag-ged-right}
%
% \newenvironment{Quote}{^^A
% \begin{quote}^^A
% \small^^A
% \fussy^^A
% }{^^A
% \end{quote}^^A
% }
%
% \renewcommand{\thefootnote}{\ensuremath{\fnsymbol{footnote}}}
%
% ^^A -----------------------------
%
% \title{\unskip
% The \textsf{ragged2e}-package^^A
% \thanks{^^A
% The version number of this file is \fileversion,
% last revised \filedate.}^^A
% }
% \author{Martin Schr\"oder\\[0.5ex]
% \normalsize Cr\"usemannallee 3\\
% \normalsize 28213 Bremen\\
% \normalsize Germany\\
% \normalsize martin@oneiros.de}
% \date{\filedate}
% \maketitle
%
% ^^A -----------------------------
%
% \begin{abstract}
% This package provides new commands and environments for setting
% ragged text which are easy to configure to allow hyphenation.
% An earlier attempt to do this was the style
% \package{raggedright}\cite{raggedri} by the same author.
% \end{abstract}
%
%
% ^^A -----------------------------
%
% \tableofcontents
%
% ^^A -----------------------------
%
% \begin{multicols}{2}
% \fussy
%
% \setlength{\parskip}{^^A
% .3\baselineskip plus.05\baselineskip minus.05\baselineskip}
%
% \section{The problem}
% ^^A
% \LaTeX{} has three commands (\cs{centering}, \cs{raggedleft}, and
% \cs{raggedright}) and three environments (\env{center},
% \env{flushleft}, and \env{flushright}) to typeset ragged text.
% The environments are based upon the commands (\env{center} uses
% \cs{centering}, \env{flushleft} \cs{raggedright}, and
% \env{flushright} \cs{raggedleft}).
%
% These commands have, however, one serious flaw: they render
% hyphenation almost impossible, and thus the text looks \emph{too}
% ragged, as the following example shows:
% \setcounter{unbalance}{2}
% \begin{multicols}{2}
% \small\fussy
% \raggedright
% \cs{raggedright}:\\
% ``The \LaTeX{} document preparation system is a special version
% of Donald Knuth's \TeX{} program.
% \TeX{} is a sophisticated program designed to produce
% high-quality typesetting, especially for mathematical text.''
% \cite[p\@. xiii]{lamport86}
%
% \newpage
% \RaggedRight
% \cs{RaggedRight}:\\
% ``The \LaTeX{} document preparation system is a special version
% of Donald Knuth's \TeX{} program.
% \TeX{} is a sophisticated program designed to produce
% high-quality typesetting, especially for mathematical text.''
% \cite[p\@. xiii]{lamport86}
% \end{multicols}
%
% \setcounter{unbalance}{0}
%
% ^^A -----------------------------
%
% \section{Old ``solutions''}
%
% ^^A -----------------------------
%
% \subsection{\LaTeX}
% ^^A
% \LaTeX{} defines e.\,g.\ \cs{raggedright} as follows:
% \begin{macrocode}
%<*latex>
\def\raggedright{%
\let\\=\@centercr
\@rightskip\@flushglue
\rightskip\@rightskip
\leftskip\z@
\parindent\z@}
% \end{macrocode}
% Initially, \cs{@flushglue} is defined as
% \begin{macrocode}
\@flushglue = 0pt plus 1fil
%</latex>
% \end{macrocode}
%
% Thus the \cs{rightskip} is set to |0pt plus 1fil|.
% Knuth, however warns \cite[p\@. 101]{KnuthTeXa}:
% \begin{Quote}
% ``For example, a person can set \cs{rightskip=0pt plus 1fil},
% and every line will be filled with space to the right.
% But this isn't a particularly good way to make ragged-right
% margins, because the infinte stretchability will assign zero
% badness to lines that are very short.
% To do a decent job of ragged-right setting, the trick is to set
% \cs{rightskip} so that it will stretch enough to make line breaks
% possible, yet not too much, because short lines should be
% considered bad.
% Furthermore the spaces between words should be fixed so that
% they do not stretch or shrink.''
% \end{Quote}
%
% ^^A -----------------------------
%
% \subsection{\plain{}}
% ^^A
% \plain{} \TeX{} defines an special version of
% \cs{raggedright}, which operates the way Knuth describes it;
% but which can not be used whith \LaTeX, because \LaTeX{} redefines
% \cs{raggedright}.
% \begin{macrocode}
%<*plain>
\def\raggedright{%
\rightskip\z@ plus2em
\spaceskip.3333em
\xspaceskip.5em\relax}
% \end{macrocode}
%
% \plain{} provides also a version of \cs{raggedright} for typewriter
% fonts
% \begin{macrocode}
\def\ttraggedright{%
\tt
\rightskip\z@ plus2em\relax}
%</plain>
% \end{macrocode}
%
% \end{multicols}
% \setlength{\parskip}{^^A
% .3\baselineskip plus.05\baselineskip minus.05\baselineskip}
%
% ^^A -----------------------------
%
% \section{Our solution}
%
% Since the \plain{} solution can not be used with \LaTeX, we have to
% redefine it and make it possible to configure it for personal
% preferences.
%
% ^^A -----------------------------
%
% \subsection{The macros}
% ^^A
% \DescribeMacro{\Centering}
% \DescribeMacro{\RaggedLeft}
% \DescribeMacro{\RaggedRight}
% \cs{Centering}, \cs{RaggedLeft}, and \cs{RaggedRight} can be used in
% the same way as \cs{centering}, \cs{raggedleft}, and
% \cs{raggedright}:
% Just type the command, and after that the whole text will be set
% centered, ragged-left or ragged-right.
%
% For example, we switched on \cs{RaggedRight} on the top of this
% text, and consequently this text was set
% ragged-right.\footnote{^^A
% Actually we also set \cs{RaggedRightRightskip} higher than usual
% (|0pt plus 4em|) because of all the long command names which
% make linebreaking difficult.}
%
% \DescribeMacro{\justifying}
% \NEWfeature{2003/01/04}%
% \cs{justifying} switches back to justified text after ragged text
% has been switched on.
% \changes{v2.00}{2003/01/04}{New command \cs{justifying}}
%
% The new commands \cs{Centering}, \cs{RaggedLeft}, and
% \cs{RaggedRight} are fully compatible with their counterparts in
% \LaTeX, but implement the \plain{} solution and can be easily
% configured using the following parameters:
%
% ^^A -----------------------------
%
% \subsection{The parameters}
% ^^A
% \changes{v2.00}{2003/01/25}{Removed \cs{RaggedSpaceskip} and
% \cs{RaggedXSpaceskip}}%
% \begin{tabularx}{\linewidth}{lX}\toprule
% Command & Uses\tabularnewline \midrule
% \cs{Centering} & \cs{CenteringLeftskip},
% \cs{CenteringRightskip},
% \cs{CenteringParfillskip},
% \cs{CenteringParindent}
% \tabularnewline
% \cs{RaggedLeft} & \cs{RaggedLeftLeftskip},
% \cs{RaggedLeftRightskip},
% \cs{RaggedLeftParfillskip},
% \cs{RaggedLeftParindent}
% \tabularnewline
% \cs{RaggedRight} & \cs{RaggedRightLeftskip},
% \cs{RaggedRightRightskip},
% \cs{RaggedRightParfillskip},
% \cs{RaggedRightParindent}
% \tabularnewline
% \cs{justifying} & \cs{JustifyingParfillskip},
% \cs{JustifyingParindent}
% \tabularnewline
% \bottomrule
% \end{tabularx}
%
% All Parameters can be set with \cs{setlength}, e.\,g.\
% \begin{Quote}
% |\setlength{RaggedRightRightskip}{0pt plus 1em}|
% \end{Quote}
% sets \cs{RaggedRightRightskip} to |0pt plus 1em|.
%
% \DescribeMacro{\CenteringLeftskip}
% \DescribeMacro{\RaggedLeftLeftskip}
% \DescribeMacro{\RaggedRightLeftskip}
% These are the \cs{leftskip}s inserted by \cs{Centering},
% \cs{RaggedLeft}, and \cs{RaggedRight}.
% \begin{Quote}
% \setlength{\tabcolsep}{.25em}
% \begin{tabularx}{\linewidth}{lX}
% ``\cs{leftskip} & (glue at left of justified lines)''
% \cite[p.~274]{KnuthTeXa}
% \end{tabularx}
% \end{Quote}
% \cs{leftskip} must be set to a finite value, to make hyphenation
% possible.
% Setting it to infinite values like |0pt plus 1fil| makes
% hyphenation almost impossible.
%
% \DescribeMacro{\CenteringRightskip}
% \DescribeMacro{\RaggedLeftRightskip}
% \DescribeMacro{\RaggedRightRightskip}
% These are the \cs{rightskip}s inserted by \cs{Centering},
% \cs{RaggedLeft}, and \cs{RaggedRight}.
% \begin{Quote}
% \setlength{\tabcolsep}{.25em}
% \begin{tabularx}{\linewidth}{lX}
% ``\cs{rightskip} & (glue at right of justified lines)''
% \cite[p.~274]{KnuthTeXa}
% \end{tabularx}
% \end{Quote}
% \cs{rightskip} must be set to a finite value, to make hyphenation
% possible.
% Setting it to infinite values like |0pt plus 1fil| makes
% hyphenation almost impossible.
%
% \DescribeMacro{\CenteringParfillskip}
% \DescribeMacro{\RaggedLeftParfillskip}
% \DescribeMacro{\RaggedRightParfillskip}
% \DescribeMacro{\JustifyingParfillskip}
% These are the \cs{parfillskip}s inserted by \cs{Centering},
% \cs{RaggedLeft}, \cs{RaggedRight}, and \cs{justifying}.
% \begin{Quote}
% \setlength{\tabcolsep}{.25em}
% \begin{tabularx}{\linewidth}{lX}
% ``\cs{parfillskip} & (additional \cs{rightskip} at end of paragraphs)''
% \cite[p.~274]{KnuthTeXa}
% \end{tabularx}
% \end{Quote}
% The normal setting for \cs{parfillskip} is |0pt plus 1fil|; the
% parameters are provided for testing combinations of
% \cs{}\{|left|$\mid$|right|\}|skip| and \cs{parfillskip}.
%
% \DescribeMacro{\CenteringParindent}
% \DescribeMacro{\RaggedLeftParindent}
% \DescribeMacro{\RaggedRightParindent}
% \DescribeMacro{\JustifyingParindent}
% These are the \cs{parindent}s used by \cs{Centering},
% \cs{RaggedLeft}, \cs{RaggedRight}, and \cs{justifying}.
% \begin{Quote}
% \setlength{\tabcolsep}{.25em}
% \begin{tabularx}{\linewidth}{lX}
% ``\cs{parindent} & (width of \cs{indent})''
% \cite[p.~274]{KnuthTeXa}
% \end{tabularx}
% \end{Quote}
% \cs{parindent} is the indent of the first line of a paragraph and
% should be set to |0pt|, since indented lines in ragged text
% do not look good.
%
% The parameters have the following initial setting:
% \begin{center}
% \begin{tabularx}{\linewidth}{l>{\ttfamily}X>{\ttfamily}X}\toprule
% Parameter & \normalfont\LaTeX{} setting
% & \normalfont\package{ragged2e} setting\\
% \midrule
% \cs{CenteringLeftskip} & 0pt plus 1fil
% & 0pt plus 2em\\
% \cs{RaggedLeftLeftskip} & 0pt plus 1fil
% & 0pt plus 2em\\
% \cs{RaggedRightLeftskip} & 0pt plus 0pt minus 0pt
% & 0pt plus 0pt minus 0pt\\
% \cs{CenteringRightskip} & 0pt plus 1fil
% & 0pt plus 2em\\
% \cs{RaggedLeftRightskip} & 0pt plus 0pt minus 0pt
% & 0pt plus 0pt minus 0pt \\
% \cs{RaggedRightRightskip} & 0pt plus 1fil
% & 0pt plus 2em\\
% \cs{CenteringParfillskip} & 0pt plus 0pt minus 0pt
% & 0pt plus 0pt minus 0pt \\
% \cs{RaggedLeftParfillskip} & 0pt plus 0pt minus 0pt
% & 0pt plus 0pt minus 0pt \\
% \cs{RaggedRightParfillskip}& 0pt plus 1fil
% & 0pt plus 1fil\\
% \cs{CenteringParindent} & 0pt
% & 0pt \\
% \cs{RaggedLeftParindent} & 0pt
% & 0pt \\
% \cs{RaggedRightParindent} & 0pt
% & 0pt \\
% \cs{JustifyingParfillskip} &
% & 0pt plus 1fil \tabularnewline
% \cs{JustifyingParindent} &
% & \cs{parindent} \tabularnewline
% \bottomrule
% \end{tabularx}
% \end{center}
% \footnotetext{^^A
% For proportional and monospaced fonts.}
%
% ^^A -----------------------------
%
% \subsection{The environments}
% ^^A
% \DescribeEnv{Center}
% \env{Center} is fully compatible with \env{center}, but uses
% \cs{Centering} instead of \cs{centering}.
%
% \DescribeEnv{FlushLeft}
% \env{FlushLeft} is fully compatible with \env{flushleft}, but uses
% \cs{RaggedRight} instead of \cs{raggedright}.
%
% \DescribeEnv{FlushRight}
% \env{FlushRight} is fully compatible with \env{flushright}, but uses
% \cs{RaggedLeft} instead of \cs{raggedleft}.
%
% \DescribeEnv{justify}
% \NEWfeature{2003/01/04}%
% \env{justify} is like the other environments but uses \cs{justifying}.
% \changes{v2.00}{2003/01/04}{New environment \env{justify}}
%
% E.\,g.\ \env{FlushLeft} can be used in the same way as
% \env{flushleft}:
% \begin{verse}
% \small
% |\begin{FlushLeft}|\\
% \meta{text, which is set ragged-right}\\
% |\end{FlushLeft}|
% \end{verse}
%
% ^^A -----------------------------
%
% \section{Options}
% ^^A
% This package has the following options:
% \changes{v2.00}{2003/01/04}{Allow all-lowercase versions of
% options and removed documentation of
% mixed-case versions.}
% \nopagebreak
% \begin{description}
% \item[\normalfont\option{originalcommands}]
% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and
% \cs{raggedright} and the \LaTeX-environments \env{center},
% \env{flushleft}, and \env{flushright} remain unchanged.\newline
% It is the default.
% \item[\normalfont\option{newcommands}]
% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and
% \cs{raggedright} and the \LaTeX-environments \env{center},
% \env{flushleft}, and \env{flushright} are set equal to their
% counterparts defined by \package{ragged2e}.
% Thus \cs{raggedright} invokes \cs{RaggedRight}.
% The original commands can be accessed unter the Names
% \cs{LaTeX}\meta{original name}, e.\,g.\ \cs{LaTeXraggedright}.
% \item[\normalfont\option{originalparameters}]
% The parameters used by the commands implemented by
% \package{ragged2e} are initialized with the default settings
% used by \LaTeX.
% \item[\normalfont\option{newparameters}]
% The parameters used by the commands implemented by
% \package{ragged2e} are initialized with the default settings
% defined by \package{ragged2e}.\newline
% It is the default.
% \item[\normalfont\option{raggedrightboxes}]
% \changes{v2.00}{2003/01/04}{New option \option{raggedrightboxes}}
% \NEWfeature{2003/01/18}
% All \cs{parbox}es, \env{minipage}s, \cs{marginpar}s and
% |p|-columns of \env{tabular}s and \env{array}s are
% automatically set using \cs{RaggedRight}.
% \item[\normalfont\option{footnotes}]
% \changes{v2.00}{2003/01/18}{New option \option{footnotes}}
% \NEWfeature{2003/01/18}
% This options sets all footnotes ragged-right by loading the
% \package{footmisc}\cite{footmisc} package with the
% \option{ragged} option.
% \item[\normalfont\option{document}]
% \changes{v2.00}{2003/01/18}{New option \option{document}}
% \NEWfeature{2003/01/18}
% This options sets the complete document ragged-right by
% executing a \cs{RaggedRight} at \cs{begin\{document\}} and
% the \option{raggedrightboxes} and the \option{footnotes}
% options.
% \end{description}
% All other options are passed to the \package{footmisc} package if
% the \option{footnotes} option is selected.
%
%
% ^^A -----------------------------
%
% \section{Required packages}
% ^^A
% This package requires the following package:
% \begin{description}
% \item[\normalfont\package{everysel}\cite{everysel}]
% It is used to distinguish between monospaced and proportional
% fonts.
% \item[\normalfont\package{footmisc}\cite{footmisc}]
% It is used by the \option{footnotes} option; at least
% version~5.00 (2002/08/28) is needed.
% \end{description}
%
%
% ^^A -----------------------------
%
% \StopEventually{^^A
%
%
% ^^A -----------------------------
%
% \section{Acknowledgements}
% ^^A
% A first version of this package for \LaTeX2.09 was named
% \package{raggedri}\cite{raggedri}.
% Laurent Siebenmann (\url{lcs@topo.math.u-psud.fr}) with his
% style \package{ragged.sty}\cite{ragged} provided the final impulse
% for this new implementation.\newline
% The code for \cs{justifying}, \env{justify} and the overloading of
% \cs{@arrayparboxrestore} is incorporated from the
% \package{raggedr}\cite{raggedr} package by James Kilfinger
% (\url{mapdn@csv.warwick.ac.uk}).\newline
% Without the constant nagging of Rainer Sieger
% (\url{rsieger@awi-bremerhaven.de}) this package might not
% be.\newline
% Markus Kohm (\url{markus.kohm@gmx.de}) provided the code for
% \cs{@gnewline}.\newline
% Frank Mittelbach (\url{frank.mittelbach@latex-project.org})
% provided the impetus for version~2.00.\newline
% Rolf Niepraschk (\url{Rolf.Niepraschk@ptb.de}) and Hubert G\"a\ss{}lein
% found many bugs and provided fixes for them and code for new
% features.
%
% ^^A -----------------------------
%
% \newcommand{\noopsort}[1]{} \newcommand{\printfirst}[2]{##1}
% \newcommand{\singleletter}[1]{##1} \newcommand{\switchargs}[2]{##2##1}
% \begin{thebibliography}{1}
%
% \bibitem{ltmiscen}
% Johannes Braams, David Carlisle, Alan Jeffrey, Leslie Lamport, Frank
% Mittelbach, Chris Rowley, and Rainer Sch{\"o}pf.
% \newblock ltmiscen.dtx.
% \newblock Part of the {\LaTeX}-distribution.
%
% \bibitem{footmisc}
% Robin Fairbairns.
% \newblock \texttt{footmisc} --- a portmanteau package for
% customising footnotes in \LaTeXe.
% \newblock \url{CTAN: tex-archive/macros/latex/contrib/supported/footmisc/footmisc.dtx}.
%
% \bibitem{raggedr}
% James Kilfiger.
% \newblock \url{CTAN: tex-archive/macros/latex/contrib/other/misc/raggedr.sty}.
% \newblock \LaTeXe{} package.
%
% \bibitem{KnuthTeXa}
% Donald~E. Knuth.
% \newblock \emph{The {\TeX}Book}, volume~A of \emph{Computers \& Typesetting}.
% \newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, {\noopsort{1986a}}1986.
%
% \bibitem{lamport86}
% Leslie Lamport.
% \newblock \emph{\LaTeX: A Document Preparation System}.
% \newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, first edition, 1986.
%
% \bibitem{cmfonts}
% Frank Mittelbach and Rainer Sch{\"o}pf.
% \newblock The file {\texttt{cmfonts.fdd}} for use with {\LaTeXe}.
% \newblock Part of the {\LaTeX}-distribution.
%
% \bibitem{everysel}
% Martin Schr{\"o}der.
% \newblock The \package{everysel}-package.
% \newblock \url{CTAN: tex-archive/macros/latex/contrib/supported/ms/everysel.dtx}.
% \newblock \LaTeXe{} package.
%
% \bibitem{raggedri}
% Martin Schr{\"o}der.
% \newblock The \package{raggedri} document option.
% \newblock Was in \url{CTAN: tex-archive/macros/latex209/contrib/raggedright}.
% \newblock \LaTeX2.09 style, outdated.
%
% \bibitem{ragged}
% Laurent Siebenmann.
% \newblock \texttt{ragged.sty}.
% \newblock \url{CTAN: tex-archive/macros/generic/ragged.sty}.
% \newblock generic macro file for \texttt{plain} and \LaTeX.
%
% \end{thebibliography}
% }
%
% ^^A -----------------------------
%
% \section{The implementation}
% \changes{v2.00}{2003/01/10}{Removed spaces and unneeded braces
% from \cs{setlength}; replaced
% \texttt{plus} with \cs{@plus}}
% \changes{v2.02}{2003/02/24}{Removed \cs{setlength}}
% \changes{v2.02}{2003/02/24}{Use \cs{@flushglue}}
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsection{Initial Code}
% ^^A
% \begin{macro}{\if@raggedtwoe@originalcommands}
% \cs{if@raggedtwoe@originalcommands} is used to flag the use of the
% \option{originalcommands} or \option{newcommands} option.
% \begin{macrocode}
\newif\if@raggedtwoe@originalcommands
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@raggedtwoe@originalparameters}
% \cs{if@raggedtwoe@originalparameters} is used to flag the use of the
% \option{originalparameters} or \option{newparameters} option.
% \begin{macrocode}
\newif\if@raggedtwoe@originalparameters
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@raggedtwoe@footmisc}
% \cs{if@raggedtwoe@footmisc} is used to flag the use of the
% \option{footnotes} option.
% \changes{v2.00}{2003/01/18}{New macro}%
% \begin{macrocode}
\newif\if@raggedtwoe@footmisc
% \end{macrocode}
% \end{macro}
%
%
% ^^A -----------------------------
%
% \subsection{Declaration of options}
%
%
% ^^A -----------------------------
%
% \subsubsection{\option{originalcommands} option}
% ^^A
% The \option{originalcommands} and \option{newcommands} options
% control the meaning of the \LaTeX-commands for ragged text:
% If \option{newcommands} is used the \LaTeX-commands are set equal
% to the commands defined by \package{ragged2e}.
% \changes{v2.00}{2003/01/04}{Allow all-lowercase versions of options}
% \begin{macrocode}
\DeclareOption{OriginalCommands}{\@raggedtwoe@originalcommandstrue}
\DeclareOption{originalcommands}{\@raggedtwoe@originalcommandstrue}
\DeclareOption{NewCommands}{\@raggedtwoe@originalcommandsfalse}
\DeclareOption{newcommands}{\@raggedtwoe@originalcommandsfalse}
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsubsection{\option{originalparameters} option}
% ^^A
% The \option{originalparameters} and \option{newparameters} options
% control the defaults for the parameters used by the commands
% implemented by \package{ragged2e}:
% If \option{newparameters} is used the parameters are set to the
% values defined by \package{ragged2e}.
% \changes{v2.00}{2003/01/04}{Allow all-lowercase versions of options}
% \begin{macrocode}
\DeclareOption{OriginalParameters}{\@raggedtwoe@originalparameterstrue}
\DeclareOption{originalparameters}{\@raggedtwoe@originalparameterstrue}
\DeclareOption{NewParameters}{\@raggedtwoe@originalparametersfalse}
\DeclareOption{newparameters}{\@raggedtwoe@originalparametersfalse}
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsubsection{\option{raggedrightboxes} option}
% ^^A
% \changes{v2.00}{2003/01/04}{New option \option{raggedrightboxes}}%
% The option \option{raggedrightboxes} sets all
% \cs{parbox}es, \env{minipage}s, \cs{marginpar}s and |p|-columns of
% \env{tabular}s and \env{array}s using \cs{RaggedRight}.
% This is done by redefining \cs{@arrayparboxrestore}.
% \begin{macro}{\@raggedtwoe@raggedrightboxes@opt}
% \cs{@raggedtwoe@raggedrightboxes@opt} is the code executed via
% \cs{DeclareOption}.
% \changes{v2.00}{2003/01/18}{New macro}%
% \begin{macrocode}
\newcommand*{\@raggedtwoe@raggedrightboxes@opt}{
% \end{macrocode}
% First we check if \cs{@arrayparboxrestore} is unchanged.
% \begin{macrocode}
\CheckCommand*{\@arrayparboxrestore}{%
\let\if@nobreak\iffalse
\let\if@noskipsec\iffalse
\let\par\@@par
\let\-\@dischyph
\let\'\@acci\let\`\@accii\let\=\@acciii
\parindent\z@ \parskip\z@skip
\everypar{}%
\linewidth\hsize
\@totalleftmargin\z@
\leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
\parfillskip\@flushglue \lineskip\normallineskip
\baselineskip\normalbaselineskip
\sloppy}%
% \end{macrocode}
% Then we redefine it by removing the setting of \cs{leftskip},
% \cs{rightskip}, \cs{@rightskip} and \cs{parfillskip} and instead
% calling \cs{RaggedRight}.
% \changes{v2.04}{2003/03/02}{The setting of \cs{parindent} is
% superfluous}%
% \begin{macrocode}
\renewcommand{\@arrayparboxrestore}{%
\let\if@nobreak\iffalse
\let\if@noskipsec\iffalse
\let\par\@@par
\let\-\@dischyph
\let\'\@acci\let\`\@accii\let\=\@acciii
\parskip\z@skip
\everypar{}%
\linewidth\hsize
\@totalleftmargin\z@
\RaggedRight
\lineskip\normallineskip
\baselineskip\normalbaselineskip
\sloppy}%
% \end{macrocode}
% Now we self-destroy so the command can be called more than once
% without causing harm (and it also frees up some space).
% \begin{macrocode}
\let\@raggedtwoe@raggedrightboxes@opt\relax
}
% \end{macrocode}
% \end{macro}
% Finally the declaration of the option.
% \begin{macrocode}
\DeclareOption{raggedrightboxes}{\@raggedtwoe@raggedrightboxes@opt}
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsubsection{\option{footnotes} option}
% ^^A
% \changes{v2.00}{2003/01/18}{New option \option{footnotes}}%
% \changes{v2.02}{2003/02/24}{Bugfix: \cs{if@raggedtwoe@footmisctrue}
% \ensuremath{\rightarrow} \cs{@raggedtwoe@footmisctrue}}%
% \changes{v2.03}{2003/02/26}{Bugfix: \option{footnotes} was actually
% \option{raggedrightboxes}}
% The option \option{footnotes} just sets a flag
% (\cs{if@raggedtwoe@footmisc}) to load the \option{footmisc}
% package and passes the option \option{ragged} to it.
% \begin{macrocode}
\DeclareOption{footnotes}{%
\@raggedtwoe@footmisctrue
\PassOptionsToPackage{ragged}{footmisc}%
}
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsubsection{\option{document} option}
% ^^A
% \changes{v2.00}{2003/01/18}{New option \option{document}}%
% The option \option{document} sets the complete document
% ragged-right by executing \cs{RaggedRight} via \cs{AtBeginDocument}
% and also executing the \option{raggedrightboxes} option.
% \begin{macro}{\@raggedtwoe@abdhook}
% \cs{@raggedtwoe@abdhook} is the code executed via
% \cs{AtBeginDocument}: Give a message on the terminal, execute
% \cs{RaggedRight} and self-destroy.
% We also make \cs{@tocrmarg} flexible; otherwise long lines in the
% table of contents (and similar tables) would not be broken because
% the spaceskip is rigid.
% \changes{v2.00}{2003/01/18}{New macro}%
% \changes{v2.04}{2003/03/02}{Set \cs{@tocrmarg} and use
% \cs{PackageInfo}}%
% \begin{macrocode}
\newcommand{\@raggedtwoe@abdhook}{%
\PackageInfo{ragged2e}{ABD: executing \string\RaggedRight}%
\RaggedRight
\edef\@tocrmarg{\@tocrmarg plus 2em}%
\let\@raggedtwoe@abdhook\relax
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@raggedtwoe@document@opt}
% \cs{@raggedtwoe@document@opt} is the code executed via
% \cs{DeclareOption}: Insert the code into \cs{AtBeginDocument},
% execute the \option{raggedrightboxes} and \option{footnotes} options
% and self-destroy.
% \changes{v2.00}{2003/01/18}{New macro}%
% \begin{macrocode}
\newcommand{\@raggedtwoe@document@opt}{%
\AtBeginDocument{\@raggedtwoe@abdhook}%
\@raggedtwoe@raggedrightboxes@opt
\@raggedtwoe@footmisctrue
\let\@raggedtwoe@document@opt\relax
}
% \end{macrocode}
% \end{macro}
% Finally the declaration of the option.
% \begin{macrocode}
\DeclareOption{document}{\@raggedtwoe@document@opt}
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsubsection{Other options}
% ^^A
% \changes{v2.00}{2003/01/18}{Pass all other options to
% \package{footmisc} if it's loaded}%
% All unused options are passed to the \package{footmisc} package if
% the \option{footnotes} option is selected; otherwise the usual error
% is raised.
% \begin{macrocode}
\DeclareOption*{%
\if@raggedtwoe@footmisc
\PassOptionsToPackage{\CurrentOption}{footmisc}%
\else
\OptionNotUsed
\fi
}
% \end{macrocode}
%
%
%% ^^A -----------------------------
%
% \subsection{Executing options}
% ^^A
% The default options are \option{originalcommands} and
% \option{newparameters}.
% \begin{macrocode}
\ExecuteOptions{originalcommands,newparameters}
\ProcessOptions\relax
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsection{Loading packages}
% ^^A
% We need the \package{everysel} package.
% \changes{v2.00}{2003/01/18}{Load the \package{footmisc} package}%
% \begin{macrocode}
\RequirePackage{everysel}
% \end{macrocode}
% If the option \option{footnotes} is selected, we load the
% \package{footmisc} package after we are finished (\package{footmisc}
% detects our presence by looking for the definition of
% \cs{RaggedRight}, so we can not load it just now).
% \begin{macrocode}
\if@raggedtwoe@footmisc
\AtEndOfPackage{\RequirePackage{footmisc}[2002/08/28]}
\fi
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsection{Allocations}
% ^^A
% \changes{v2.00}{2003/01/25}{Removed \cs{RaggedSpaceskip} and
% \cs{RaggedXSpaceskip}}%
% \begin{macro}{\CenteringLeftskip}
% \begin{macro}{\RaggedLeftLeftskip}
% \begin{macro}{\RaggedRightLeftskip}
% \begin{macro}{\CenteringRightskip}
% \begin{macro}{\RaggedLeftRightskip}
% \begin{macro}{\RaggedRightRightskip}
% \begin{macro}{\CenteringParfillskip}
% \begin{macro}{\RaggedLeftParfillskip}
% \begin{macro}{\RaggedRightParfillskip}
% \begin{macro}{\JustifyingParfillskip}
% \changes{v2.00}{2003/01/18}{New macro}
% \begin{macro}{\CenteringParindent}
% \begin{macro}{\RaggedLeftParindent}
% \begin{macro}{\RaggedRightParindent}
% \begin{macro}{\JustifyingParindent}
% \changes{v2.00}{2003/01/18}{New macro}
% First we allocate the parameters
% \begin{macrocode}
\newlength{\CenteringLeftskip}
\newlength{\RaggedLeftLeftskip}
\newlength{\RaggedRightLeftskip}
\newlength{\CenteringRightskip}
\newlength{\RaggedLeftRightskip}
\newlength{\RaggedRightRightskip}
\newlength{\CenteringParfillskip}
\newlength{\RaggedLeftParfillskip}
\newlength{\RaggedRightParfillskip}
\newlength{\JustifyingParfillskip}
\newlength{\CenteringParindent}
\newlength{\RaggedLeftParindent}
\newlength{\RaggedRightParindent}
\newlength{\JustifyingParindent}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% ^^A -----------------------------
%
% \subsection{Initializations}
% ^^A
% Depending on \cs{if@raggedtwoe@originalparameters} we initialize the
% parameters with the values \LaTeX{} uses for its own commands or with
% our new parameters.
% \changes{v2.04}{2003/03/02}{Initialize \cs{JustifyingParindent}
% with \cs{parindent}}
% \changes{v2.04}{2003/03/02}{Insert missing \textbackslash}
% \begin{macrocode}
\if@raggedtwoe@originalparameters
\CenteringLeftskip\@flushglue
\RaggedLeftLeftskip\@flushglue
\RaggedRightLeftskip\z@skip
\CenteringRightskip\@flushglue
\RaggedLeftRightskip\z@skip
\RaggedRightRightskip\@flushglue
\CenteringParfillskip\z@skip
\RaggedLeftParfillskip\z@skip
\RaggedRightParfillskip\@flushglue
\CenteringParindent\z@
\RaggedLeftParindent\z@
\RaggedRightParindent\z@
\else
\CenteringLeftskip\z@\@plus\tw@ em
\RaggedLeftLeftskip\z@\@plus\tw@ em
\RaggedRightLeftskip\z@skip
\CenteringRightskip\z@\@plus\tw@ em
\RaggedLeftRightskip\z@skip
\RaggedRightRightskip\z@\@plus\tw@ em
\CenteringParfillskip\z@skip
\RaggedLeftParfillskip\z@skip
\RaggedRightParfillskip\@flushglue
\CenteringParindent\z@
\RaggedLeftParindent\z@
\RaggedRightParindent\z@
\fi
\JustifyingParfillskip\@flushglue
\JustifyingParindent\parindent
% \end{macrocode}
%
%
% ^^A -----------------------------
%
% \subsection{Distinguishing between monospaced and proportional fonts}
% ^^A
% To set ragged text with proportional fonts \emph{and} monospaced
% fonts correctly, we must distinguish between these two kinds of
% fonts \emph{everytime} a font is loaded.
% Otherwise the settings for e.\,g.\ a proportional fonts would be
% in effect if you start \cs{RaggedRight} in \cs{rmfamily} and
% then switch to \cs{ttfamily}.
%
% The goal is to have a rigid interword space in all fonts.
% \TeX's interword space is |\fontdimen2 plus \fontdimen3 minus \fontdimen4|.
% This can be overwritten by setting \cs{spaceskip} (space between
% words, if nonzero) and \cs{xspaceskip} (space at the end of
% sentences, if nonzero).
%
% We do the setting with the help of \package{everysel}\cite{everysel},
% which allows us to define code which is (hopefully) executed after
% every fontchange in a \LaTeX{} document.\footnote{^^A
% It \emph{is} executed after every \cs{selectfont}, so if you stay
% within NFSS and don't declare your fonts with commands like
% \cs{newfont} and then switch to them, it will work.}
%
% \begin{macro}{\if@raggedtwoe@spaceskip}
% \cs{if@raggedtwoe@spaceskip} signals the use of commands defined by
% \package{ragged2e} to the command inserted into \cs{selectfont}.
% It is set to true by these commands and restored to false by \TeX{}
% when the scope of them ends.
% \begin{macrocode}
\newif\if@raggedtwoe@spaceskip
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@raggedtwoe@everyselectfont}
% \cs{@raggedtwoe@everyselectfont} is our code inserted into
% \cs{selectfont}.
% \changes{v2.00}{2003/01/26}{Completely redesigned and removed
% \cs{RaggedSpaceskip} and
% \cs{RaggedXSpaceskip}}
% \changes{v2.01}{2003/02/20}{Removed the setting of \cs{xspaceskip}}
% \begin{macrocode}
\newcommand{\@raggedtwoe@everyselectfont}{%
\if@raggedtwoe@spaceskip
% \end{macrocode}
% If no command defined by \package{ragged2e} is in use, we do
% nothing.
% But if it is, we look at \cs{fontdimen3} to see if the current
% font is monospaced or not.
% \begin{macrocode}
\ifdim\fontdimen\thr@@\font=\z@\relax
% \end{macrocode}
% If it is, we set \cs{spaceskip} to |0pt| so the interword space
% will be the one specified by the font designer -- which is rigid
% anyway for monospaced fonts.
% \begin{macrocode}
\spaceskip\z@
\else
% \end{macrocode}
% For proportional fonts we make the interword space rigid by setting
% \cs{spaceskip} to \cs{fontdimen2}.
% \begin{macrocode}
\spaceskip\fontdimen\tw@\font
\fi
% \end{macrocode}
% We have to reset the interword space if we are not active.
% \changes{v2.04}{2003/03/16}{Reset \cs{spaceskip} when we are not
% active}
% \begin{macrocode}
\else
\spaceskip\z@
\fi
}
\EverySelectfont{\@raggedtwoe@everyselectfont}
% \end{macrocode}
% \end{macro}
%
%
% ^^A -----------------------------
%
% \subsection{The commands}
% ^^A
% \begin{macro}{\@raggedtwoe@savedcr}
% We save the definition of \cs{\textbackslash} in
% \cs{@raggedtwoe@savedcr}.
% \begin{macrocode}
\let\@raggedtwoe@savedcr\\
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@raggedtwoe@saved@gnewline}
% \changes{v2.00}{2003/01/04}{New macro}
% We save the definition of \cs{@gnewline} in
% \cs{@raggedtwoe@saved@gnewline}.
% \begin{macrocode}
\let\@raggedtwoe@saved@gnewline\@gnewline
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@raggedtwoe@gnewline}
% The following definition of a \cs{@gnewline} used by the ragged
% commands was suggested by Markus Kohm:
% \changes{v2.00}{2003/01/04}{New macro}
% \changes{v2.02}{2003/02/24}{Bugfix: \cs{@nolerr}
% \ensuremath{\rightarrow} \cs{@nolnerr}}%
% \begin{macrocode}
\newcommand*{\@raggedtwoe@gnewline}[1]{%
\ifvmode
\@nolnerr
\else
\unskip
\reserved@e {\reserved@f #1}{\parskip\z@\par}%
\fi
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Centering}
% \cs{Centering} first lets \cs{\textbackslash} = \cs{@centercr},
% but only if |\\| has its original meaning, otherwise \cs{Center}
% would not work inside environments like \env{tabular} etc., in
% which \cs{\textbackslash} has a different meaning.
% It also sets \cs{@gnewline} to \cs{@raggedtwoe@gnewline}.
% Then, the \LaTeX{} and \TeX-parameters are set.\newline
% \cs{@rightskip} is \LaTeX's version of \cs{rightskip}.
% \begin{Quote}
% ``Every environment, like the list environments, that set
% \cs{rightskip} to its 'normal' value set it to \cs{@rightskip}''
% \cite{ltmiscen}
% \end{Quote}
% Finally we signal the code inserted into \cs{selectfont} that
% we are active and call that code directly.
% \changes{v2.00}{2003/01/04}{Call \cs{@raggedtwoe@everyselectfont}
% and switch \cs{@gnewline}}
% \begin{macrocode}
\newcommand{\Centering}{%
\ifx\\\@raggedtwoe@savedcr
\let\\\@centercr
\fi
\let\@gnewline\@raggedtwoe@gnewline
\leftskip\CenteringLeftskip
\@rightskip\CenteringRightskip
\rightskip\@rightskip
\parfillskip\CenteringParfillskip
\parindent\CenteringParindent
\@raggedtwoe@spaceskiptrue
\@raggedtwoe@everyselectfont
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\RaggedLeft}
% \cs{RaggedLeft} is like \cs{Centering}; it only uses other
% parameters.
% \changes{v2.00}{2003/01/04}{Call \cs{@raggedtwoe@everyselectfont}
% and switch \cs{@gnewline}}
% \begin{macrocode}
\newcommand{\RaggedLeft}{%
\ifx\\\@raggedtwoe@savedcr
\let\\\@centercr
\fi
\let\@gnewline\@raggedtwoe@gnewline
\leftskip\RaggedLeftLeftskip
\@rightskip\RaggedLeftRightskip
\rightskip\@rightskip
\parfillskip\RaggedLeftParfillskip
\parindent\RaggedLeftParindent
\@raggedtwoe@spaceskiptrue
\@raggedtwoe@everyselectfont
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\RaggedRight}
% \cs{RaggedRight} is like \cs{Centering}; it only uses other
% parameters.
% \changes{v2.00}{2003/01/04}{Call \cs{@raggedtwoe@everyselectfont}
% and switch \cs{@gnewline}}
% \begin{macrocode}
\newcommand{\RaggedRight}{%
\ifx\\\@raggedtwoe@savedcr
\let\\\@centercr
\fi
\let\@gnewline\@raggedtwoe@gnewline
\leftskip\RaggedRightLeftskip
\@rightskip\RaggedRightRightskip
\rightskip\@rightskip
\parfillskip\RaggedRightParfillskip
\parindent\RaggedRightParindent
\@raggedtwoe@spaceskiptrue
\@raggedtwoe@everyselectfont
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\justifying}
% \cs{justifying} switches back to the defaults used by \LaTeX{} for
% typesetting justyfied text.
% \changes{v2.00}{2003/01/04}{New macro}
% \begin{macrocode}
\newcommand{\justifying}{%
\let\\\@raggedtwoe@savedcr
\let\@gnewline\@raggedtwoe@saved@gnewline
\leftskip\z@
\@rightskip\z@
\rightskip\@rightskip
\parfillskip\JustifyingParfillskip
\parindent\JustifyingParindent
\@raggedtwoe@spaceskipfalse
\@raggedtwoe@everyselectfont
}
% \end{macrocode}
% \end{macro}
%
%
% ^^A -----------------------------
%
% \subsection{The environments}
% ^^A
% \begin{environment}{Center}
% \begin{environment}{FlushLeft}
% \begin{environment}{FlushRight}
% The environments \env{Center}, \env{FlushLeft}, and \cs{FlushRight}
% are implemented like their counterparts in \LaTeX: Start a
% \env{trivlist} and switch on the right command.
% \changes{v2.02}{2003/02/24}{Use \cs{trivlist} \ldots{}
% \cs{endtrivlist} instead of
% \cs{begin\{trivlist\}} \ldots{}
% \cs{end\{trivlist\}}}
% \begin{macrocode}
\newenvironment{Center}{%
\trivlist
\Centering\item\relax
}{%
\endtrivlist
}
\newenvironment{FlushLeft}{%
\trivlist
\RaggedRight\item\relax
}{%
\endtrivlist
}
\newenvironment{FlushRight}{%
\trivlist
\RaggedLeft\item\relax
}{%
\endtrivlist
}
% \end{macrocode}
% \end{environment}
% \end{environment}
% \end{environment}
% \begin{environment}{justify}
% \env{justify} is similar to the other environments: Start a
% \env{trivlist} and use \cs{justifying}.
% \changes{v2.00}{2003/01/04}{New environment}
% \changes{v2.02}{2003/02/24}{Use \cs{trivlist} \ldots{}
% \cs{endtrivlist} instead of
% \cs{begin\{trivlist\}} \ldots{}
% \cs{end\{trivlist\}}}
% \begin{macrocode}
\newenvironment{justify}{%
\trivlist
\justifying\item\relax
}{%
\endtrivlist
}
% \end{macrocode}
% \end{environment}
%
%
% ^^A -----------------------------
%
% \subsection{Overloading the \LaTeX-commands}
% ^^A
% If the option \option{newcommands} is used, we save the original
% \LaTeX-commands and environments for ragged text and overload them.
% \changes{v2.04}{2003/03/02}{Save more commands}
% \begin{macrocode}
\if@raggedtwoe@originalcommands
\else
\let\LaTeXcentering\centering
\let\LaTeXraggedleft\raggedleft
\let\LaTeXraggedright\raggedright
\let\centering\Centering
\let\raggedleft\RaggedLeft
\let\raggedright\RaggedRight
\let\LaTeXcenter\center
\let\endLaTeXcenter\endcenter
\let\LaTeXflushleft\flushleft
\let\endLaTeXflushleft\endflushleft
\let\LaTeXflushright\flushright
\let\endLaTeXflushright\endflushright
\let\center\Center
\let\endcenter\endCenter
\let\flushleft\Flushleft
\let\endflushleft\endFlushleft
\let\flushright\FlushRight
\let\endflushright\endFlushRight
\fi
% \end{macrocode}
%
% ^^A -----------------------------
%
% \begin{macrocode}
%</package>
% \end{macrocode}
% \Finale
% ^^A vim:tw=70:ts=2
|