| 1 |
<!-- --> |
| 2 |
|
| 3 |
Author: Jean-Francois Burnol |
| 4 |
Package: centeredline |
| 5 |
Version: 1.2 (2022/10/10) |
| 6 |
License: LPPL 1.3c |
| 7 |
Copyright (C) 2019, 2022 Jean-Francois Burnol |
| 8 |
<jfbu at free dot fr> |
| 9 |
|
| 10 |
# DESCRIPTION # |
| 11 |
|
| 12 |
After `\usepackage{centeredline}` one can use |
| 13 |
|
| 14 |
\centeredline{....} |
| 15 |
|
| 16 |
to get the argument centered, without ending the current paragraph, and |
| 17 |
without adding extra vertical spacing, in a better way than if using |
| 18 |
`\centerline`: |
| 19 |
|
| 20 |
1. `\verb` or other catcode changes inside the argument are allowed, |
| 21 |
2. The centering (with respect to the surrounding text paragraph) will |
| 22 |
be as expected if this all happens inside an item from a LaTeX list |
| 23 |
environment. |
| 24 |
3. One does not need to use `\newline` before and after (or at least |
| 25 |
leave a space token after). Doing so does not hurt, though. |
| 26 |
|
| 27 |
The macro itself may be used while in paragraph or in vertical mode. |
| 28 |
Like `\centerline`, if used in vertical mode, it does not enter |
| 29 |
paragraph mode. |
| 30 |
|
| 31 |
The macro places its argument in a `\hbox` and assignments done inside |
| 32 |
the argument see thus their scope limited to the line. |
| 33 |
|
| 34 |
The macro is usable from inside a (paragraph mode) table cell. |
| 35 |
|
| 36 |
It can be nested (for example the argument is a `tabular` or a `\parbox` |
| 37 |
and inside it another `\centeredline` is used). |
| 38 |
|
| 39 |
Material whose natural width exceeds the line width will get properly |
| 40 |
centered too, the extra width going into the margins (or into the |
| 41 |
neighboring cells, if used in a paragraph mode table cell). |
| 42 |
|
| 43 |
|
| 44 |
# CHANGE LOG # |
| 45 |
|
| 46 |
Initial statement: |
| 47 |
|
| 48 |
I have used this macro since 2013 and it has served me well. |
| 49 |
|
| 50 |
I am making it public as is, without any re-thinking about whether it may |
| 51 |
have some limitations which I somehow did not encounter in my personal usage. |
| 52 |
Suggestions for improvements are welcome, and will be recorded although I do |
| 53 |
not expect to update the package anytime soon. |
| 54 |
|
| 55 |
- v1.0 (2019/04/27): First release. |
| 56 |
- v1.1 (2019/05/03): Improve this README. |
| 57 |
- v1.2 (2022/10/10): |
| 58 |
* make the macro usable in table cells |
| 59 |
(thanks to Antoine Missier for pointing out this limitation; |
| 60 |
see his package `spacingtricks` for another centering macro) |
| 61 |
* avoid an extra empty line if the macro is used following a `\\` |
| 62 |
or a `\newline` (but why should it be? ;-) ) |
| 63 |
(thanks to Kroum Tzanev for a related discussion) |
| 64 |
|
| 65 |
|
| 66 |
# LICENSE # |
| 67 |
|
| 68 |
This Work may be distributed and/or modified under the |
| 69 |
conditions of the LaTeX Project Public License 1.3c. |
| 70 |
This version of this license is in |
| 71 |
|
| 72 |
> <http://www.latex-project.org/lppl/lppl-1-3c.txt> |
| 73 |
|
| 74 |
and the latest version of this license is in |
| 75 |
|
| 76 |
> <http://www.latex-project.org/lppl.txt> |
| 77 |
|
| 78 |
and version 1.3 or later is part of all distributions of |
| 79 |
LaTeX version 2005/12/01 or later. |
| 80 |
|
| 81 |
The Author of this Work is: |
| 82 |
|
| 83 |
> Jean-Francois Burnol `<jfbu at free dot fr>` |
| 84 |
|
| 85 |
This Work consists of the file `centeredline.sty` and |
| 86 |
accompanying `README.md`. |