# graphicx includegraphics globally centered

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}

\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}

• Thanks for that explaination. I have issues with pandoc converter to word and had to delete all \center to get passed... 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. Mar 15 '19 at 7:40

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}


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