summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-02 22:30:47 +0000
committerKarl Berry <karl@freefriends.org>2019-05-02 22:30:47 +0000
commitee512f09c6a78085849822e5e63272a51593e41c (patch)
tree24f4fdb04543c0e7ffa3435d532acc1178425de3 /Master
parent6984d1991b006de9836c2a9fc3cbfd913c4cd414 (diff)
centeredline (27apr19)
git-svn-id: svn://tug.org/texlive/trunk@50931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/centeredline/README.md74
-rw-r--r--Master/texmf-dist/tex/latex/centeredline/centeredline.sty32
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rw-r--r--Master/tlpkg/tlpsrc/centeredline.tlpsrc0
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
5 files changed, 109 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/centeredline/README.md b/Master/texmf-dist/doc/latex/centeredline/README.md
new file mode 100644
index 00000000000..90bcac86764
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/centeredline/README.md
@@ -0,0 +1,74 @@
+<!-- -->
+
+ Author: Jean-Francois Burnol
+ Package: centeredline
+ Version: 1.0 (2019/04/27)
+ License: LPPL 1.3c
+ Copyright (C) 2019 Jean-Francois Burnol
+ <jfbu at free dot fr>
+
+# DESCRIPTION #
+
+After `\usepackage{centeredline}` you can use
+
+ \centeredline{....}
+
+to get contents centered, in a better way than with `\centerline`:
+
+1. `\verb` or other catcode changes are allowed,
+2. the centering (with respect to the surrounding text paragraph) will
+ be as expected if this all happens inside an item from a LaTeX list
+ environment,
+3. and material whose natural width exceeds the linewidth will get
+ properly centered too.
+
+The contents are executed in horizontal mode inside a group inside a
+`\hbox`.
+
+The macro itself maybe encountered in paragraph or in vertical mode. For
+example in vertical mode
+
+ \centeredline{\rule{\dimexpr-1cm+\paperwidth}{1pt}}
+ \centeredline{\rule{\dimexpr-1cm+\paperwidth}{1pt}}
+ \centeredline{\rule{\dimexpr-1cm+\paperwidth}{1pt}}
+
+will create horizontally centered on the page horizontal rules
+vertically separated by the baseline skip and ignoring the parskip.
+
+
+# HISTORY #
+
+I have used this macro since 2013 and it has served me well.
+
+I am making it public as is, without any re-thinking about whether it may
+have some limitations which I somehow did not encounter in my personal usage.
+Suggestions for improvements are welcome, and will be recorded although I do
+not expect to update the package anytime soon.
+
+
+# CHANGE LOG #
+
+- v1.0 (2019/04/27): First release.
+
+
+# LICENSE #
+
+This Work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License 1.3c.
+This version of this license is in
+
+> <http://www.latex-project.org/lppl/lppl-1-3c.txt>
+
+and the latest version of this license is in
+
+> <http://www.latex-project.org/lppl.txt>
+
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+The Author of this Work is:
+
+> Jean-Francois Burnol `<jfbu at free dot fr>`
+
+This Work consists of the file `centeredline.sty` and
+accompanying `README.md`.
diff --git a/Master/texmf-dist/tex/latex/centeredline/centeredline.sty b/Master/texmf-dist/tex/latex/centeredline/centeredline.sty
new file mode 100644
index 00000000000..7503e78ef82
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/centeredline/centeredline.sty
@@ -0,0 +1,32 @@
+%% File: centeredline.sty
+%% Version: 1.0 (2019/04/27)
+%% License: LPPL 1.3c
+%% Copyright (C) 2019 Jean-Francois Burnol <jfbu at free dot fr>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{centeredline}[2019/04/27 v1.0 centering a line my way (JFB)]
+% \centeredline: OUR OWN LITTLE MACRO FOR CENTERING LINES
+%
+% 7 mars 2013
+% \ignorespaces added June 9, 2013
+%
+% This macro allows to conveniently center a line inside a paragraph and still
+% allow usage therein of \verb or other macros changing catcodes.
+%
+% It works nicely in list environments (as it uses \linewidth, not \hsize...;
+% maybe there is an even better LaTeX parameter to use, but I don't know
+% LaTeX2e that well enough and never typeset in two-column mode.)
+%
+% Note: \centeredline is scope limiting for assignments done during execution
+% of its argument.
+%
+\newcommand*\centeredline{%
+ \ifhmode \\\relax
+ \def\centeredline@@{\hss\egroup\hskip\z@skip\ignorespaces}%
+ \else
+ \def\centeredline@@{\hss\egroup}%
+ \fi
+ \afterassignment\centeredline@
+ \let\next=}%
+\def\centeredline@
+ {\hbox to \linewidth \bgroup \hss \bgroup \aftergroup\centeredline@@}%
+\endinput
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index a99ca4ca2ea..2989439a0f9 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -141,7 +141,8 @@ my @TLP_working = qw(
cbcoptic cbfonts cbfonts-fd
cc-pl ccaption ccfonts ccicons cclicenses
cd cd-cover cdpbundl
- cell cellprops cellspace celtic censor cesenaexam cfr-initials cfr-lm
+ cell cellprops cellspace celtic censor centeredline cesenaexam
+ cfr-initials cfr-lm
changebar changelayout changelog changepage changes
chappg chapterfolder charter
chbibref cheatsheet checkcites checklistings chem-journal
diff --git a/Master/tlpkg/tlpsrc/centeredline.tlpsrc b/Master/tlpkg/tlpsrc/centeredline.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/centeredline.tlpsrc
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index c0c86e11216..9c9d8cffb4e 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -144,6 +144,7 @@ depend cdpbundl
depend cellprops
depend cellspace
depend censor
+depend centeredline
depend changebar
depend changelayout
depend changelog