Debian Codegraph @

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

raw
1 %% \CheckSum{11}
2 % \iffalse
3 % File: centerlastline.dtx
4 % Copyright (C) 2020 Miguel V. S. Frasson ([email protected])
5 %
6 % This package may be distributed under the terms of the LaTeX
7 % Project Public License, as described in lppl.txt in the base
8 % LaTeX distribution, either version 1.2 or (at your option)
9 % any later version.
10 %
11 %<*driver>
12 \documentclass{ltxdoc}
13 \usepackage{doc}
14 \usepackage[T1]{fontenc}
15 \usepackage{xcolor,lipsum,centerlastline,microtype}
16 %\usepackage[margin=1.6in]{geometry}
17 \begin{document}
18 \DocInput{centerlastline.dtx}
19 \end{document}
20 %</driver>
21 % \fi
22 %
23 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %
25 % \StopEventually
26 %
27 % \changes{1.0}{2020/10/12}{Initial version}
28 %
29 % \MakeShortVerb+
30 %
31 % \title{\textsf{centerlastline}: last line centered}
32 % \author{Miguel V.\ S.\ Frasson\\(\texttt{[email protected]})}
33 % \date{2020, oct. 12}
34 %
35 % \maketitle
36 %
37 % This package provides command +\centerlastline+, which sets
38 % paragraph style\footnote{Paragraph style like
39 % \texttt{\string\centering}, \texttt{\string\raggedright} or
40 % \texttt{\string\raggedleft}.} to typeset with no indentation and
41 % last line centered, an arrangement known as \emph{spanish
42 % paragraph}. It is a not-so-frequent composition, useful to finish a
43 % large paragraph of text, at the end of chapters, prologues, back
44 % cover of books, etc. It can be used as an environment
45 % +centerlastline+.
46 %
47 % In command form +\centerlastline+, user must take care that the text
48 % ends with a new paragraph (either a blank line or a +\par+), to
49 % ensure that the paragraph style +\centerlastline+ is active at the
50 % end of the paragraph. In environment form, this is automatic.
51 %
52 % Below an example of
53 % such paragraph\ldots\bigskip
54 %
55 % \begin{centerlastline}
56 % \color{blue}\lipsum[1]
57 % \end{centerlastline}\bigskip
58 %
59 % \noindent \ldots{} produced with\bigskip
60 %
61 % \noindent
62 % +\begin{centerlastline}+\\
63 % + \color{blue}\lipsum[1]+\\
64 % +\end{centerlastline}+\medskip
65 %
66 % \noindent or\medskip
67 %
68 % \noindent +{\centerlastline+\\+ \color{blue}\lipsum[1]\par}+
69 %
70 % \clearpage
71 % \section*{Code}
72 %
73 % Identidication of the package.
74 % \begin{macrocode}
75 \NeedsTeXFormat{LaTeX2e}
76 \ProvidesPackage{centerlastline}[2020/10/12 v1.0 Last line centered (spanish par.)]
77 % \end{macrocode}
78 %
79 % \DescribeMacro{\centerlastline}
80 % Implementation of +\centerlastline+ based on +\centerlastline+ from
81 % ``memoir'' class. Definition with +\providecommand+ to avoid error
82 % if loaded with ``memoir'' class.
83 % \begin{macrocode}
84 \providecommand{\centerlastline}{%
85 \parindent=0pt
86 \leftskip=0pt plus 1fil
87 \rightskip=0pt plus -1fil
88 \parfillskip=0pt plus 2fil}
89 % \end{macrocode}
90 %
91 % Ending enviromnment with +\par+ to ensure paragraph style keeps
92 % effect until last paragraph.
93 % \begin{macrocode}
94 \def\endcenterlastline{\par}
95 % \end{macrocode}
96 % \Finale
97 %
98 \endinput
99 %
100 %% \CharacterTable
101 %% {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
102 %% 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
103 %% Digits \0\1\2\3\4\5\6\7\8\9
104 %% Exclamation \! Double quote \" Hash (number) \#
105 %% Dollar \$ Percent \% Ampersand \&
106 %% Acute accent \' Left paren \( Right paren \)
107 %% Asterisk \* Plus \+ Comma \,
108 %% Minus \- Point \. Solidus \/
109 %% Colon \: Semicolon \; Less than \<
110 %% Equals \= Greater than \> Question mark \?
111 %% Commercial at \@ Left bracket \[ Backslash \\
112 %% Right bracket \] Circumflex \^ Underscore \_
113 %% Grave accent \` Left brace \{ Vertical bar \|
114 %% Right brace \} Tilde \~}