left left \- | \- right


enter image description here I would like to make | to be centered, which is not according to the page number, and the relative position of the rest text doesn't change.

I don't see a way to do this, Center line based on only part of text suggests \parbox but it would ignore the relative position of the line.

  • 1
    Perhaps \makebox[0pt][r]{left left \ }|\makebox[0pt][l]{ \ right}? BTW, what are the \- meant for?
    – GuM
    Nov 6, 2017 at 1:33

1 Answer 1


The first thing that comes to my mind is

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.


    \makebox[0pt][r]{left left left \ }|\makebox[0pt][l]{ \ right}


Note that \- denotes a “discretionary hyphen”, not some kind of horizontal space.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .