0

Is it possible to globally set \includegraphics pictures to be centered horizontally on page?

I have read the manual and see some unfamiliar global settings keys: \setkeys{Gin}{width=0.75\textwidth}

0
1

\includegraphics in common with most similar LaTeX constructs such as \parbox, tabular etc, is not a display construct it is just an inline box, so positioned like a big letter, it has no mechanism to control its position. You center a graphic in the same way as you would center a word, place it in the scope of \centering or \begin{center}...\end{center}

3
  • Thanks for that explaination. I have issues with pandoc converter to word and had to delete all \center to get passed...
    – novski
    Mar 5 '19 at 22:37
  • @novski you should never use \center that is the internal implementation of \begin{center} always use the environment form or use \centering Mar 6 '19 at 7:57
  • im sorry i misslead this comment as it was \centering that led to errors in pandoc conversion.
    – novski
    Mar 15 '19 at 7:40
0

I'm assuming that your margins are symmetric on the page. If not, say so.

\documentclass{article}
\usepackage[showframe,pass]{geometry}
\usepackage{graphicx}
\begin{document}
\centerline{\includegraphics[width=.3\textwidth]{example-image}}

\centerline{\includegraphics[width=1.1\textwidth]{example-image}}
\end{document}

enter image description here

1
  • Thanks. I was hopeing for a preamble to put in my style file bus as David Carlistle lined out rhere is no such option...
    – novski
    Mar 5 '19 at 22:39

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.