[en]
LaTeX-package 'mpgmpar' - allows \marginpars in minipages and other boxes

Author:  Paul Ebermann <Paul-Ebermann@gmx.de>
License: LPPL 1.3b or later, maintained
         (see http://www.latex-project.org/lppl/).

All Documentation (other than this file) is in german.

The package needs the package ifthen (which is a required
component of LaTeX anyway).
The typesetting of the documentation needs 'pauldoc' (from the
same author).

The package comes as .dtx + .ins.
Run "latex mpgmpar.ins" to create the style file (and maybe put
it to texmf/tex/latex/paul/, if your docstrip is configured
accordingly), run (after that and maybe updating your TeX hash)
"latex mpgmpar.dtx" to create the documentation.

 Usage
-------

Put \usepackage{mpgmpar} in your document preamble.

Then you can use the environment 'minipagewithmarginpars',
which works like minipage (but default align ist 't'),
in which \marginpar-commands are allowed, when the environment
is not used inside another box.

Example:

   \begin{minipagewithmarginpars}{5cm}
	  Hello World. \marginpar{a margin note.}
   \end{minipagewithmarginpars}

You may want to create similar environments yourself,
for example to have boxed minipages. For this you
may use the internal commands \mpgmpar@savemarginpars
(inside a group) and \mpgmpar@restoremarginpars (after
this group, at a place where marginpars are allowed).

Try this:

  \makeatletter
  \newbox\boxed@box
  \newenvironment{boxedpage}[1]{%
     \begin{lrbox}{\boxed@box}%
       \begin{minipage}[t]{#1}
       \mpgmpar@savemarginpars
  }{%
       \end{minipage}%
     \end{lrbox}%
     \mpgmpar@restoremarginpars
  }%
  \makeatother


  This ist a \begin{boxedpage}{4cm} boxed page with \marginpar{margin paragraphs}
  \end{boxedpage}.

Environments created this way may be nested, the marginpars
then appear around the outest one.

----------------
[de]
LaTeX-Paket 'mpgmpar' - Randnotizen auch in Minipages

Autor:  Paul Ebermann (Paul-Ebermann@gmx.de).
Lizenz: LPPL 1.3b oder spter, mit Maintenance-Status
        "maintained". Siehe http://www.latex-project.org/lppl/.

Geschrieben fr den eigenen Gebrauch
(-> http://www.math.hu-berlin.de/~ebermann/alg-script/),
aber vielleicht ist es auch fr andere von Nutzen.

Das Paket greift auf das Paket ifthen (Bestandteil jeder
LaTeX-Distribution) zurck.
Zum Setzen der Dokumentation wird das Paket 'pauldoc'
(vom selben Autor) bentigt.

Das Paket kommt als .dtx + .ins.
Mit "latex mpgmpar.ins" wird die .sty-Datei erstellt (und
eventuell gleich nach texmf/tex/latex/paul/ installiert,
wenn docstrip entsprechend eingerichtet ist), mit
latex mpgmpar.dtx kann (danach und eventuell nach einer
Aktualisierung der TeX-Dateidatenbank) die Dokumentation neu
erstellt werden.

Zur Verwendung siehe mpgmpar.pdf.
----------------
[eo-h]
LaTeX-pakajho 'mpgmpar' - marhenaj notoj ankau en minipage-oj
                          kaj aliaj boksoj.

Autoro:  Paulo Ebermann (Paul-Ebermann@gmx.de).
Licenzo: LPPL 1.3, 'maintained'
         (-> http://www.latex-project.org/lppl/).

Kreitaj por propra uzo, sed eble iom de ghi ankau
uzeblas por aliaj.

La dokumentaro (escepte tiu chi dosiero) estas nur en la germana
lingvo.

La pakajho bezonas la pakajhon ifthen, kiu estas necesa komponento
de LaTeX.
Por krei la dokumentadon vi krome bezonas 'pauldoc' (de la sama autoro).

La pakajho venas en .dtx + .ins.
Voku "latex mpgmpar.ins" por krei la .sty-dosieron (kaj
eble meti ghin al texmf/tex/latex/paul/, se via docstrip estis
konfigurita laue), voku "latex mpgmpar.dtx" por rekrei
la dokumentaron.

 Uzado
-------

Metu

    \usepackage{mpgmpar}

en la komencon de la dokumento (antau \begin{document}).

Poste vi povas uzi

	\begin{minipagewithmarginnotes}
	   ...
    \end{minipagewithmarginnotes}

kaj en tiu chirkauo la ordono \marginpar{} estas uzebla, se la
tuta ajho ne estas ene de alia bokso.


Por uzi \marginpar{} ankau ene de aliaj boksoj, vi povos
krei novajn versiojn de la boks-kreaj komandoj (au chirkauoj),
uzante la du ordonojn \mpgmpar@savemarginpars (ene de grupo)
kaj \mpgmpar@restoremarginpars (post la fino de tiu grupo, kiam
denove \marginpar{} estas uzebla).

Jen ekzemplo (minipage kun kadro:)

---
  \makeatletter
  \newbox\boxed@box
  \newenvironment{boxedpage}[1]{%
     \begin{lrbox}{\boxed@box}%
       \begin{minipage}[t]{#1}
       \mpgmpar@savemarginpars
  }{%
       \end{minipage}%
     \end{lrbox}%
     \mpgmpar@restoremarginpars
  }%
  \makeatother


  Tio estas \begin{boxedpage}{4cm} kadrita pagho kun \marginpar{marghena noto}.
  \end{boxedpage}
---

Tiaj chirkauojn eblas meti unu ene de alia, la marghenaj notoj aperos
apud la plej ekstera.

