# Change environment's width

I'm writing my homework and I would like to change the environment's dimensions of

\documentclass[10pt,spanish]{article}

% INICIO PAQUETES

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[strict]{changepage} % para cambiar dimensiones (recomendado en la web)
\usepackage{fancyhdr}
\usepackage{mathrsfs}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm} % gracias a este paquete podemos enlistar los teoremas

\let\UPproof\proof\def\proof{\small\UPproof}

\newtheorem{teo}{Teorema}[section]
\newtheorem{pro}{Proposici\'on}[section]
\newtheorem{cor}{Corolario}[section]
\newtheorem{lem}{Lema}[section]
\newtheorem{mydef}{Definici\'on}[section]

\textwidth 19cm
\topmargin -2cm
\textheight 23cm
\oddsidemargin -1,2cm
\parindent 0em
\parskip 2ex

\title{Un título}
\date{Una fecha}
\begin{pro} This tense is false.
\end{pro}
\begin{proof}
Because yes, yes.
\end{proof}
\end{document}


I want to make it (the "box" where the proof is being written) an x % smaller than the original "box" where the proposition is, but I don't know how to do it so if someone can help me, I'd be grateful.

• Something like \let\UPproof\proof\def\proof{\small\UPproof} placed in the preamble should do. It would certainly be easier to answer your question if you provided a minimal working example (MWE).
– yo'
Oct 17, 2015 at 19:45
• @yo' I said I don't know how to change it so, I don't know what to show you my "minimal working example". (I knew someone else was going to tell me something similar). I'm sorry :( Oct 17, 2015 at 19:51
• What do you mean by "x % smaller". You don't mean the actual font-size, but rather the width that the proof environment takes up with respect to the \textwidth or text block containing other text, correct
– Werner
Oct 17, 2015 at 19:56
• yo', your code works pretty cool! @Werner yes I wanted to mean the lengths of the "box" where the proof is being written (it was my misstake, I'm sorry!) Oct 17, 2015 at 19:59
• Have a look at the changepage package :) Oct 17, 2015 at 20:02

Wrap the proof environment from amsthm inside an adjustwidth environment (from changepage) with suitable margin adjustments:

\documentclass{article}
\usepackage{amsthm,letltxmacro,changepage}
\usepackage{lipsum}% Just for this example

\LetLtxMacro\oldproof\proof
\let\endoldproof\endproof
\renewenvironment{proof}[1][\proofname]
\oldproof[#1]}
{\endoldproof
\begin{document}

\lipsum[1]

\begin{proof}
\lipsum*[2]
\end{proof}

\lipsum[3]

\end{document}


The margin adjustments above are both 2em inward from the text block margins.

• Just from a typographical point of view, it would look better with some vertical space above and below.
– yo'
Oct 17, 2015 at 20:58
• @yo' can you, please, cite this? Oct 17, 2015 at 21:12
• I have the following error "Too deeply nested"... googling for solve it. Oct 17, 2015 at 21:16
• DONE!! THANK YOU and THANKS to all for the help! I learned a lot of new things! Oct 17, 2015 at 21:17
• @touhami I can't cite any official source. But note that pull quotes, centered titles, displayed equations, lists etc. -- everything that gets a different horizontal alignment -- is in general separated by vertical space.
– yo'
Oct 17, 2015 at 21:24

I had the same need, but with an background color. This post is from 9 years ago but maybe someone could need too.

use mdframe, like the next example:

newcounter{definicion}[section]
\newenvironment{definicion}[1]
{
\begin{flushright}
\refstepcounter{definicion}\par\medskip \noindent \textbf
{\textit{#1}.} - Definición \thesection.\thedefinicion
\end{flushright}
\begin{center}
\begin{mdframed}[userdefinedwidth=0.75\textwidth,
align=center, linewidth=0pt, backgroundcolor=lightgray]
\smallskip
}
{
\smallskip
\end{mdframed}
\end{center}
}


This is an screenshot from the pdf output:

You can defime widht, color background and more. even the centering, not of text but the frame. See the CTAN page mdframed.