Page LayoutCenter, Centering Inconsistency

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
atomchoco
Posts: 5
Joined: Wed Nov 02, 2011 11:06 am

Center, Centering Inconsistency

Post by atomchoco »

Hi,

I'm having a problem in which the images and text I enter, though of the same alignment, do not align properly. I've tried \begin{center} - \end{center} tags and \centering but both exhibit the same problem.

*also, site requires me to log in repeatedly which is utterly annoying
Attachments
centering.png
centering.png (110.61 KiB) Viewed 2890 times
Last edited by localghost on Fri Dec 02, 2011 10:38 am, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Center, Centering Inconsistency

Post by localghost »

Check the log file for warnings.


Thorsten
atomchoco
Posts: 5
Joined: Wed Nov 02, 2011 11:06 am

Re: Center, Centering Inconsistency

Post by atomchoco »

Hello Thorsten,

What do you mean? Where do I find the log file? Is there a specific error I should look for to fix this?

Cheers,
Josh
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Center, Centering Inconsistency

Post by localghost »

The log file (*.log) is located in the same directory as your source file (*.tex). I'm pretty sure that you get some warnings about "overfull hboxes".
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Center, Centering Inconsistency

Post by Stefan Kottwitz »

Hi Josh,

I guess your images are too wide. If they are wider than the text width, they cannot be centered.

Either resize the bigger images, such as by

Code: Select all

\includegraphics[width=\textwidth]{filename}
or hide them with a box of smaller width, for example by

Code: Select all

\noindent\makebox[\textwidth]{\includegraphics{filename}}
see perhaps Centering wide tables or figures.

Stefan
LaTeX.org admin
atomchoco
Posts: 5
Joined: Wed Nov 02, 2011 11:06 am

Re: Center, Centering Inconsistency

Post by atomchoco »

Hello,

Thank you for your responses. I used Stefan's second solution and it worked perfectly. Again, thank you very much. :)

Cheers,
Josh
Post Reply