Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Why does this code give me a badbox?

\documentclass[a4paper, 10pt, notitlepage]{article}
\begin{document}

\begin{minipage}[t]{1.0 \textwidth}
aaaaaaaaaaaaaaaaaaaaaaa
\end{minipage}

\end{document}

I'd like to understand the problem and not just fix it.

share|improve this question

1 Answer

up vote 9 down vote accepted

Your minipage of width \textwidth starts a new paragraph and therefore is indented by the amount of \parindent (15pt in article), so it spills over into the right margin by that amount. An easy fix is to add \noindent before the minipage.

\documentclass[a4paper, 10pt, notitlepage]{article}

\begin{document}

\noindent \verb|\parindent|: \the\parindent

\noindent aaaaaaaaaaaaaaaaaaaaaaa

\begin{minipage}[t]{1.0 \textwidth}
aaaaaaaaaaaaaaaaaaaaaaa
\end{minipage}

\noindent\begin{minipage}[t]{1.0 \textwidth}
aaaaaaaaaaaaaaaaaaaaaaa
\end{minipage}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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