summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/centeredline
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/texmf-dist/tex/latex/centeredline
parent6984d1991b006de9836c2a9fc3cbfd913c4cd414 (diff)
centeredline (27apr19)
git-svn-id: svn://tug.org/texlive/trunk@50931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/centeredline')
-rw-r--r--Master/texmf-dist/tex/latex/centeredline/centeredline.sty32
1 files changed, 32 insertions, 0 deletions
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