1
\documentclass[10pt]{article}
\usepackage{fontspec}

\begin{document}
{\hspace*{0.5em}
\vfill
\begin{center}
left left \- | \- right
\end{center}

\end{document}

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
  • 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

2

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.



\begin{document}

\vspace*{\fill}
\begin{center}
    \makebox[0pt][r]{left left left \ }|\makebox[0pt][l]{ \ right}
\end{center}

\end{document}

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

0

You must log in to answer this question.

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