# minipage right margin

I want to start a minipage, with the regular left-indentation, but to have its right margin adjusted with regular page right margin. An example of discrepancy:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\noindent\emph{Here is the regular text:}
\par\smallskip\noindent
\blindtext

\par\medskip

\noindent\emph{And here is the minipage:}
\par\smallskip

\begin{minipage}{\textwidth}
\blindtext
\end{minipage}
\end{document}

-

eTeX-Solution

Use

\begin{minipage}{\dimexpr\textwidth-\parindent\relax}


to subtract the regular indentation.

At this point I want to post the comment of Martin Scharrer:

\dimexpr awaits the expression directly without the square brackets{ }. It is a lower level (e-)TeX primitive, not a LaTeX macro. The \relax terminates the expression explicitly. It might work without it, but otherwise you have the risk that \dimexpr takes also some code following the expression inside the environment or macro as part of the expression.

package calc

Use

\usepackage{calc}
...
\begin{minipage}{\textwidth-\parindent}


to subtract the regular indentation.

LaTeX

Use

\newlength{\mywidth}
\setlength{\mywidth}{\textwidth}
...
\begin{minipage}{\mywidth}


to subtract the regular indentation.

TeX

Use

\newdimen\mywidth
\mywidth=\textwidth

Thanks :-) I understand that \dimexpr enables to write length expressions after it. Shouldn't it have {}, like \dimexpr{\textwidth-\parindent}? and what does the relax'' do? –  Andro Oct 3 '11 at 10:19
@Andro: No, \dimexpr awaits the expression directly without the { }. It is a lower level (e-)TeX primitive, not a LaTeX macro. The \relax terminates the expression explicitly. It might work without it, but otherwise you have the risk that \dimexpr takes also some code following the expression inside the environment or macro as part of the expression. –  Martin Scharrer Oct 3 '11 at 10:34