6

I have a paragraph which should be emphasized using left and right skips. Thereby I recognized that it simply ignores equations in this paragraph. Is this reasonable?

\documentclass{article}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1]
{
\addtolength{\leftskip}{10em}
\addtolength{\rightskip}{10em}
\lipsum[2]
\begin{equation}
a+b=c\textrm{ is a very very very very very very long equation }a+b=c
\end{equation}
\lipsum[3]
}
\lipsum[4]
\end{document}

During testing you will register no warning. However the equation is broader than the current text's width.

Is there a way without using any environment in order to sqeeze the equation to the surrounding textwidth?

12

\leftskip and \rightskip are primitive TeX registers that should never be set directly in LaTeX or all list constructs (which is almost all display constructs) will get confused. You should copy the definition of quote in article class and set \leftmargin and \rightmargin

\documentclass{article}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1]
{
\addtolength{\leftskip}{10em}
\addtolength{\rightskip}{10em}
\lipsum[2]
\begin{equation}
\textrm{This is a long long long long long long equation}
\end{equation}
\lipsum[3]
}


\newenvironment{zz}
               {\list{}{\leftmargin10em \rightmargin\leftmargin}%
                \item\relax}
               {\endlist}

\begin{zz}
\lipsum[2]
\begin{equation}
\textrm{This is a long long long long long long equation}
\end{equation}
\lipsum[3]
\end{zz}


\lipsum[4]
\end{document}
  • And how would you write it without the environment? – strpeter Apr 12 '13 at 14:13
  • @strpeter The whole latex syntax is based on environment syntax why would you not want that? although as for most environments you can go \begingroup\zz .... \par\endzz\endgroup if you must. – David Carlisle Apr 12 '13 at 14:16
3

You have LaTeX environments quotation and quote, which emphasize in the manner that you are expecting. Equations are unbreakable, so you should break them manually.

1

Try this:

\documentclass{article}
\newenvironment{head}
  {\par\setlength{\leftskip}{1cm}\setlength{\rightskip}{1cm}\noindent\ignorespaces}
\begin{document}

\begin{head}
text
\end{head}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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