2

I need to center align some text center in textpos.

A and +++ should be center align.

My minimal coding:

\documentclass{article}
\usepackage[absolute,overlay]{textpos}
\begin{document}
  \begin{textblock*}{10cm}(5cm,3cm)%
  \begin{minipage}[c]{5cm}
    \Huge A \tiny +++
    \end{minipage}
  \end{textblock*}

\end{document}

enter image description here

3
  • So you want the A and +++ to be vertically centred? – Werner Oct 25 '19 at 22:24
  • What is supposed to be centred with respect to what? – cfr Oct 25 '19 at 22:32
  • @werner, cfr: yes, A and +++ need vertically center. Thanks – latexforti Oct 25 '19 at 22:46
2

This is easiest to adjust via adjustbox's valign=c option:

enter image description here

\documentclass{article}

\usepackage{adjustbox}

\begin{document}

{\Huge A \tiny +++}

\bigskip

\adjustbox{valign=c}{\Huge A}
\adjustbox{valign=c}{\tiny +++}

\end{document}
2

You may use a tabular instead of the minipage. As added benefit, with \setlength{\tabcolsep}{0pt}, you get perfect kerning:

enter image description here

\documentclass{article}
\usepackage{array}

\usepackage[absolute,overlay]{textpos}
\begin{document}
  \begin{textblock*}{10cm}(5cm,3cm)%
    \setlength{\tabcolsep}{0pt}
    \begin{tabular}{m{0.5cm}m{0.5cm}}
    \Huge A &\vfill\tiny +++\vfill\\
    \end{tabular}
  \end{textblock*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.