Pages

mparticle and mpreport

The mparticle and mpreport LaTeX document classes are attempts at a more modern layout for articles and reports. See my dissertation or my master's thesis for examples of documents formatted with mpreport.

The latest changes:

Using longtable with mpreport

There are apparently a number of people who are using the longtable package with mpreport and who would like to have the longtable captions look like the other captions. My current suggestion is to put the following in the preamble of your document:

\makeatletter
\setlength\LTleft{0pt}
\setlength\LTright{0pt}

\renewcommand{\LT@makecaption}[3]{%
  \LT@mcol\LT@cols l{%
    \settoheight{\mp@capht}%
    {\parbox[b]{.9\mp@margwd}{\raggedleft\sffamily\slshape\small#1{#2}: #3}}%
    \hspace{-\mp@margwd}%
    \vspace{-\mp@capht}%
    \parbox[t]{.9\mp@margwd}{\raggedleft\sffamily\slshape\small#1{#2}: #3}%
  }
}
\makeatother

This worked fine in my tests, but I haven't tried it with “real” tables. If you're using this definition, successfully or not, I'd appreciate feedback.

Using listings with mpreport

If you want the captions of listings created with the listings package to appear in the margin, try this definition in the preample of your document:

\makeatletter
\renewcommand{\lst@MakeCaption}[1]{
  \lst@ifdisplaystyle
  \ifx #1t%
  \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
  \expandafter\refstepcounter
  \fi {lstlisting}%
  \ifx\lst@label\@empty\else \label{\lst@label}\fi
  \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
  \global\let\lst@name\lst@arg \global\let\lstname\lst@name
  \lst@ifnolol\else
  \ifx\lst@@caption\@empty
  \ifx\lst@caption\@empty
  \ifx\lst@intname\@empty \else \def\lst@temp{ }%
  \ifx\lst@intname\lst@temp \else
  \addcontentsline{lol}{lstlisting}\lst@name
  \fi\fi
  \fi
  \else
  \addcontentsline{lol}{lstlisting}%
  {\protect\numberline{\thelstlisting}\lst@@caption}%
  \fi
  \fi
  \fi
  \ifx\lst@caption\@empty\else
  \lst@IfSubstring #1\lst@captionpos
  {\begingroup \let\@@vskip\vskip
    \def\vskip{\afterassignment\lst@vskip \@tempskipa}%
    \def\lst@vskip{\nobreak\@@vskip\@tempskipa\nobreak}%
    \par\@parboxrestore\normalsize\normalfont % \noindent (AS)
    \ifx #1t\allowbreak \fi
    \ifx\lst@title\@empty
    \settoheight{\mp@capht}%
    {\parbox[b]{.9\mp@margwd}{\raggedleft\sffamily\slshape\small%
        \lst@makecaption\fnum@lstlisting\lst@caption}}%

    \hspace{-\mp@margwd}%
    \vspace{-\mp@capht}%
    \parbox[t]{.9\mp@margwd}{\raggedleft\sffamily\slshape\small%
      \lst@makecaption\fnum@lstlisting\lst@caption}%

    % \lst@makecaption\fnum@lstlisting\lst@caption % (AS)
    \else
    \lst@maketitle\lst@title % (AS)
    \fi
    \ifx #1b\allowbreak \fi
    \endgroup}{}%
  \fi
  \fi
}
\makeatother

mapcodes

mapcodes is a LaTeX package that allows to use various 8-bit codesets in LaTeX documents (similar to inputenc, but it works better in some situations, IMHO):