Take the 2-minute tour ×
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.

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?

share|improve this question
    
add comment

3 Answers

\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}
share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

Try this:

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

\begin{head}
text
\end{head}

\end{document}
share|improve this answer
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  Torbjørn T. Apr 21 '13 at 6:59
add comment

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.