I have the following page which I am trying to get the first line to be centered without affecting the other text. However, using \centerline{}
seems to ignore the page margin and does not wrap text to fit the original margin.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\centerline{\textbf{\large{Appendix \hypertarget{Appendix}{F}: Construction of the Managerial Performance Indicator (MSI)}}}
\vspace{0.5 cm}
This text is just for the example
\end{document}
Best Answer
The macro
\centerline
comes from Plain TeX and its behavior is exactly what you see: it centers without wrapping text and without respecting the margin.The macro is not supported in LaTeX; it exists just for historical reasons. If one knows how to properly use it, well; otherwise, it's better to leave it alone.
Perhaps you are looking for
Technical note.
Here is the definition of
\centerline
:and here is the definition of
\@@line
:Oh, well, what's
\hb@xt@
?So
\centerline{text}
is the same as typingwhich has some peculiar properties:
\hsize
(the current width for typesetting paragraphs), it will stick out in the margins by the same amount at left and right.