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.

The questions and answers regarding wide paragraphs are rather popular. What I would like to have is a new kind of "element" in my documents which would allow me to display wide paragraphs which can contain text, picture or tables... The layout is shown on the picture. My own solution is rather trivial - it works but it has two major issues:

  • It throws ton of overfull hboxes
  • It could "mix" with marginpar text (puts it one above the other)

The Look and Feel of new element

-------------
|         | |
|         | |
|         | |
|-----------|
|new element|
|-----------|
|         | |
-------------

%PREAMBLE STUFF
\newlength{\wideparwidth} %The width of our new element
\setlength{\wideparwidth}{\textwidth}        %Initializing to textwidth...
\addtolength{\wideparwidth}{\marginparsep}   %adding marginsep...
\addtolength{\wideparwidth}{\marginparwidth} %adding marginparwidth

\newcommand{\widepar}[1]{\parbox{\wideparwidth}{#1}} %The actual command

%USAGE
\begin{document}
...
\widepar{The text which appears in the very wide paragraph...}
...
\end{document}

Is anybody aware of some existing package where such layout is supported? If not, please give me some tip how I could prevent marginpar text to overlap (I assume this is not trivial). And the last but not the least, how could I make "overfull hbox" ignored (for this element only)?

share|improve this question
    
You can avoid the overfull hbox warnings by using \makebox[\textwidth]{...} as shown in my answer to Place figures side by side, spill into outer margin. No idea about the marginpars. –  Martin Scharrer Apr 18 '11 at 13:05
    
Thanks a lot for your comment! Unfortunately, I really do want to make paragraph which is as wide as textwidth+marginsep+margin so I can't stick to textwidth... Actually my major headache here is potential overlapping of this "element" and marginpars... Shell see maybe some idea comes over the net. Thanks a lot anyway! –  Zoran Apr 18 '11 at 13:24
    
Read the linked answer! You use \makebox[\textwidth]{...} and then place something wider than \textwidth inside. This way the overfull hbox warnings are avoided. –  Martin Scharrer Apr 18 '11 at 13:29
    
Oops! May bad! I'm getting your point now. Think, I have one issue less now. Thanks again! –  Zoran Apr 18 '11 at 13:44
add comment

2 Answers

You can use the tufte-book class which has a fullwidth environment or you can roll your own adjustmargins environment. The image below is from a document of mine using this class. The class will take care for most of the problems with marginpars.

enter image description here

If you want to roll your own, just add a comment and I will post the code.

Edit (posted minimal)

\documentclass{article} 
\usepackage[utf8]{inputenc} 
\usepackage{lipsum,ifmtarg}
\begin{document}
\lipsum[1]
\makeatletter
\newenvironment{adjustmargins}[2]{%
  \begin{list}{}{%
    \topsep\z@%
    \listparindent\parindent%
    \parsep\parskip%
   \@ifmtarg{#1}{\setlength{\leftmargin}{\z@}}%
   {\setlength{\leftmargin}{#1}}%
   \@ifmtarg{#2}{\setlength{\rightmargin}{\z@}}%
   {\setlength{\rightmargin}{#2}}%
}
\item[]}{\end{list}}

\newenvironment{adjustmargins*}[2]{%
 \begin{list}{}{%
 \topsep\z@%
 \listparindent\parindent%
 \parsep\parskip%
 \checkoddpage
 \ifoddpage % odd numbered page
 \@ifmtarg{#1}{\setlength{\leftmargin}{\z@}}%
 {\setlength{\leftmargin}{#1}}%
 \@ifmtarg{#2}{\setlength{\rightmargin}{\z@}}%
 {\setlength{\rightmargin}{#2}}%
 \else % even numbered page
 \@ifmtarg{#2}{\setlength{\leftmargin}{\z@}}%
 {\setlength{\leftmargin}{#2}}%
 \@ifmtarg{#1}{\setlength{\rightmargin}{\z@}}%
 {\setlength{\rightmargin}{#1}}%
\fi
}
\item[]}{\end{list}}

\makeatother

\begin{adjustmargins}{-.5in}{-1.0in}
\vfill
\rule{17.2cm}{.4pt}

There are no engineers in the hottest parts of hell, because the existence of a 'hottest part' implies a temperature difference, and any marginally competent engineer would immediately use this to run a heat engine and make some other part of hell comfortably cool.  This is obviously impossible.
\end{adjustmargins}

\end{document}
share|improve this answer
    
Hello, thank you for this superb idea! Please, post some sample code if possible. That would be great. –  Zoran Apr 18 '11 at 19:03
    
@Zoran have a look at this tex.stackexchange.com/questions/6402/… and the code above. –  Yiannis Lazarides Apr 18 '11 at 19:38
    
Perfect, thanks! –  Zoran Apr 19 '11 at 6:50
add comment

Besides using \makebox (as has been suggested in the comments), you can use the adjustwidth environment from the changepage package.

share|improve this answer
    
Hello! I didn't know about this package. Thanks a lot for the hint! I've tried it out and it really does the job - except that marginpars (which were wider "above") are still not hesitating to mix with wider text body which follows... I have the feeling this is almost unsolvable... How should marginpar know that I'm "pushing" wider text paragraph into it. In my eyes, an acceptable compromise would be to limit the positioning of that wide paragraphs to the end of the page (preferably above the footer) - laying below text body and margin occupying the whole plenty width... But how to do it??? –  Zoran Apr 18 '11 at 14:23
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.