CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/centeredline

Author:  Jean-Francois Burnol
Package: centeredline
Version: 1.1 (2019/05/03)
License: LPPL 1.3c
Copyright (C) 2019 Jean-Francois Burnol
<jfbu at free dot fr>


After \usepackage{centeredline} one can use


to get the argument centered, in a better way than with \centerline:

  1. \verb or other catcode changes inside the argument 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 list environment.

Material whose natural width exceeds the linewidth will get properly centered too.

The macro itself may be encountered in paragraph or in vertical mode. It places the argument inside a \hbox (inside an extra simple group).


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.


  • v1.0 (2019/04/27): First release.
  • v1.1 (2019/05/03): Improved description (this file).


This Work may be distributed and/or modified under the conditions of the Project Public License 1.3c. This version of this license is in


and the latest version of this license is in


and version 1.3 or later is part of all distributions of 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.

Download the contents of this package in one zip archive (1.9k).

centeredline – A macro for centering lines

This package provides a macro \centeredline{...} which allows to conveniently center a line inside a paragraph while allowing usage therein of \verb or other macros changing catcodes.

It works nicely in list environments, and material whose natural width exceeds the current linewidth will get properly centered too.

Version1.1 2019-05-03
LicensesThe Project Public License 1.3c
Copyright2019 Jean-Fran├žois Burnol
MaintainerJean-Fran├žois Burnol
Contained inTeX Live as centeredline
MiKTeX as centeredline
Guest Book Sitemap Contact Contact Author