1

I use the class article with two sides. I also use a dozen of \marginpar per page to place my QED symbol in "the margin" or rather, on the right of the page. The code is from this website:

\newcommand{myqed}{\unskip\removelastskip\marginpar{qed}}

\makeatletter
\patchcmd{\@addmarginpar}{\ifodd\c@page}{\ifodd\c@page\@tempcnta\m@ne}{}{}
\makeatother
\reversemarginpar

and it puts my \marginpar always on the right of the page.

The problem is that the floats mess with the footnotes and their numbers=> my footnotes are on the wrong pages (4 pages later on, sometimes in the next section...)

So a solution would be to create a command for my QED symbol which changes the type of the marginpars. Sometimes \marginnote is recommanded for this problem but I do not know how to make it always display the note on the right of the page. \marginnote seems not to place the note on the same line as the text: it is one line below the text and I cannot remove the vspace with \unskip\removelastskip.

This is my example, it does generate the problem with the footnote since this one is hard to replicate:

\documentclass[twoside,a4paper]{article}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage{parskip}


\setlength{\oddsidemargin}{20mm}
\setlength{\evensidemargin}{40mm}

\newenvironment{trivlist2}
{\begin{list}
{}
{
\setlength{\labelwidth}{0ex}
\setlength{\leftmargin}{0ex}
\setlength{\labelsep}{0ex}
\setlength{\itemindent}{1\parindent}
\setlength{\listparindent}{1\parindent}
\setlength{\itemsep}{0ex}
\setlength{\topsep}{0.5\parskip plus 0\parskip minus 0.5\parskip}
%\setlength{\topsep}{0ex}
\setlength{\parsep}{0ex}
%useless only \topsep counts anyway as there is no \[ ]\ alone in an environment
\setlength{\partopsep}{\parskip}
}}
{\end{list}}


\makeatletter

\renewcommand\]{%
%\relax
\ifmmode%
%\par
%\vgl@\nointerlineskip
\nopagebreak%
\endgroup%
\hfill%
$ %$%
\endgroup%
%\@endparpenalty\postdisplaypenalty
\end{trivlist2}%
\@endparpenalty\postdisplaypenalty%
\else \@badmath%
\fi}%

\renewcommand\[{%
%\relax%
\ifmmode\@badmath%
\else%
%\dotfill
\@beginparpenalty\predisplaypenalty%
\begin{trivlist2}%
%\@beginparpenalty\predisplaypenalty
\item[]%
\leavevmode%
\begingroup%
$ %$%
\displaystyle%
\hfill%
\begingroup%
%\par
%\vgl@\nointerlineskip
\nopagebreak%
\fi}

\makeatother



\usepackage{marginnote}

\newcommand{\qed}{%
\unskip\removelastskip%
%\marginpar{%
%%\hspace*{-0.5\marginparsep}%
%\makebox[0pt][c]{$\heartsuit$}%
%}
\marginnote[$\heartsuit$]{$\diamondsuit$}
\par
}

%%%put the marginpar always on the right page
%\usepackage{etoolbox}
%\makeatletter
%\patchcmd{\@addmarginpar}{\ifodd\c@page}{\ifodd\c@page\@tempcnta\m@ne}{}{}
%\makeatother
%\reversemarginpar



\begin{document}
blabla,
\[
A \hspace{0.5\textwidth}  B
\]
\qed

blabla,
\[
A \hspace{0.5\textwidth}  B
\]
\hfill blabla.
\qed



\begin{align*}
\alpha \colon T &\longrightarrow A \\
t &\longmapsto \# t \hspace{0.8\textwidth} B
\end{align*}
\qed


\lipsum[33]
\qed


\newpage

blabl,
\[
A \hspace{0.5\textwidth}  B
\]
\qed

blabla,
\[
A \hspace{0.5\textwidth}  B
\]
\hfill blabla.
\qed



\begin{align*}
\alpha \colon T &\longrightarrow A \\
t &\longmapsto \# t \hspace{0.8\textwidth} B
\end{align*}
\qed


\lipsum[33]
\qed

\end{document}

I redefine the \[ and \] (just the list used is modified) to apply my own spacing around them. Involuntarily, It places the qed symbol right in front of the line for the displays. This is desired of course. My problem is that with \marginnote I lose this feature plus the position on the right.

  • Please post a minimal working example (MWE) showing your set-up – Andrew Swann May 1 '14 at 9:59
  • You can use \marginnote[{\makebox[0pt][l]{\hspace{\dimexpr \textwidth+2\marginparsep}qed}}]{qed} to get the qed always on the right of the page but without an example it is impossible to say what you should do about the vertical placement. Perhaps the optional voffset can help. See the documentation. – Ulrike Fischer May 1 '14 at 10:07
  • added an example. – user50260 May 1 '14 at 13:26
  • It is odd, the trick from Ulrike works well in my document if \setlength{\evensidemargin}{\oddsidemargin} is set; but if the two margins are different, I lose the symbol on the left pages. The trick makes the symbol appears on the left pages of the example though – user50260 May 1 '14 at 14:09
  • \marginnote is below the \lipsum as this uses a \par. Test better with normal text. And if you want the qed beside the math, put it in the math e.g. with \text{\qed} or \tag*{qed}. I can't reproduce your problems with evensidemargin. Make an example. And please notify my if you want that I see your changes. – Ulrike Fischer May 2 '14 at 11:47

Your Answer

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