completely rewrote answer with goal, that be more clear and easy to understand to OP
Zarko
• 235.6k
• 18
• 134
• 296

I'm stillEdit (3): Your questions is not sure, ifclear even its upgrades and comments. In before efforts to help you I understand question correctlytry to pointed, what and how to do or what is possible to do (from point of you of my guessing what is the problem) for solving your problem. As you respond, the answer is not what you looking for :-( ).

After while I decide to resume my efforts in form, with more explanation (without hope, that it will be recognized as helpful, more for my exercises :-)). do you mean something like this?

• remove all irrelevant part of provided MWE (layout package and macros connected with it)

• redefine definition of new commands, now the align notes content with help of added package ragged2e on smart way to the left and right text border and eliminate all presented vertical shifts (which purpose is unclear):


• add explanation how to determine distance of side and margin notes from text borders (where I assume, that distance for the side notes and margin notes have to be the same):

For above image\setmarginnotes{5mm} % distance between text border margin notes box {30mm}% width of margin notes box {3mm} % distance between two successive margin notes % note: it doesn't effect on side notes!

• add showframe packageto MWE for showing, where is the text border (since MWE use preset of the first line indent, so one line text are moved from text border for 2em (length of the indentation)

Now I change your code only in definition of left side noteadd (now in boldfacelipsum package for adding dummy text), whereby which I actually only erasehope will give better filling about position of side and margin notes and see indentation of the first line in paragraph. If you don't like to have indentation, then put in preamble flushleft\setlenght{\indent}{0pt}. Also I further simply definitions of commands for side and in edit addmargin notes.

Open stay question, if lik to have different distance from text for side notes (on the left side of page) from distance of margin notes (on the right side page). IN this case you can do the following (not showed in my MWE):

• by \setmarginnotes set minimal distance of both notes
• accordingly change definition of newcommand for notes which should have bigger distance to text. For example for \rdate

\RaggedLeft\newcommand{\rdate}[1]{\marginpar[]{% \hspace{5mm}\begin{minipage}[t]{\marginparwidth-5mm} \sffamily\footnotesize \RaggedRight #1 \end{minipage}}} from

In this case you need to add package ragged2ecalc into your document preamble. How this can look out for zero margin note distance and then shifting margin notes for 5mm to right side is below:

Complete WME is:

\newcommand\documentclass[a4paper,11pt,article,oneside]{\marginheadmemoir}[1]{\sidepar[\bfseries\footnotesize
\pagestyle{simple}
%\setlength{\parindent}{0pt} % set paragraph indentation to zero

% preset margin notes, it can be changed according to user wish
\setmarginnotes{5mm} % distance between text border margin \RaggedLeftnotes #1]{}}box


For showing where are side notes, I add package showframe.

Edit: I change your MWE as follows:

\documentclass[a4paper,11pt,article,oneside]               {memoir30mm}% width of margin notes box
\pagestyle               {simple3mm} % distance between two successive margin notes
% note: it doesn't have effect on side notes!
\setmarginnotes{0.5em}{3cm}\usepackage{2emragged2e}  % margins?for use in margin notes content align
\checkandfixthelayout\usepackage{calc}

\usepackage{ragged2eshowframe} % show page layout
\usepackage{showframelipsum}    % layoutfor dummy text

% custom sidepar, and marginpar
\RaggedLeft #1]{#1}}
\newcommand{\rdate}[1]{\normalmarginpar\marginpar\marginpar[]{\footnotesize\RaggedRight #1}}

\begin{document}

Some text:
\rdate{03.\,2015 -- 09.\,2015}
\marginhead{rule below show side note box width
\RaggedRight #1}}
\begin{document}

Contributing in \rule{\hsize}{1pt}}%
\lipsum[2]%

text long text }
\rdate{03.\,2015 -- 09.\,2015}

Monitoring... \rdate{Apr 2013 -- Dec 2013\rule{\hsize}{1pt}}
\end{document}


In it I add package ragged2e which allow more smart aligning of text in boxes. I also change left side margin definition and the way how it should be used. I hope that now I'm correctly figured pout what you like to have.Which gives:

Edit (2): The distance between text and margin notes is controlled by length \marginparsep With

  \setmarginnotes{2em}{33mm}{1em}


To summarize:

• distance between text border and side and margin notes is determined by \setmarginnotes
• vertical distance between margin notes is also determined by \setmarginnotes, however, this not determine vertical distances between side notes. If they are to close, they will overwrite each other
• to have different distance for side notes and margin notes it should be by \setmarginnotes set minimal distance, bigger can be achieved by shifting a minipage inside margin note for desired amount.
• special care for verical aligning os side and margin notes isn't necessary. IN normal circumstances (when they are not to close to each other) they will perfectly aligned to anchored line in the main text.
• side note, which is not anchored to the text, "generate" empty line in a text to which is anchored

you change distance to text on 2em, width of note to 33mm and distance between successive notes is 1em (see effect of this settings by playing with my MWE). In my MWE I change definition for \rdate and slightly simplified it.The End!

Post Undeleted by Zarko
Post Deleted by Zarko
small correction of code and added explanation about settings of margin pars
Zarko
• 235.6k
• 18
• 134
• 296

I'm still not sure, if I understand question correctly ... do you mean something like this?

For above image I change your code only in definition of left side note (now in boldface text), where I actually only erase flushleft and in edit add \RaggedLeft from package ragged2e:

\newcommand{\marginhead}[1]{\sidepar[\bfseries\footnotesize
\RaggedLeft #1]{}}


For showing where are side notes, I add package showframe.

Edit: I change your MWE as follows:

\documentclass[a4paper,11pt,article,oneside]{memoir}
\pagestyle{simple}

\setmarginnotes{0.5em}{3cm}{2em} % margins?
\checkandfixthelayout

\usepackage{ragged2e} % layout
\usepackage{showframe} % layout

% custom sidepar, marginpar
\RaggedLeft #1]{}}
\newcommand{\rdate}[1]{\normalmarginpar\marginpar{\footnotesize
\parbox{\marginparwidth}{\footnotesize               \RaggedRight #1}}}
\begin{document}

\rdate{03.\,2015 -- 09.\,2015}

Monitoring... \rdate{Apr 2013 -- Dec 2013}
\end{document}


In it I add package ragged2e which allow more smart aligning of text in boxes. I also change left side margin definition and the way how it should be used. I hope that now I'm correctly figured pout what you like to have.

Edit (2): The distance between text and margin notes is controlled by length \marginparsep With

  \setlength\setmarginnotes{\marginparsep2em}{<width>33mm}{1em}


you can change it to distance to your wish. See pages 9 -- 11 in memoir manual for details. Helpfultext on 2em, width of note to 33mm and distance between successive notes is also description in section 2.51em (HEADERS, FOOTERS AND MARGINAL NOTESsee effect of this settings by playing with my MWE) where are details how to manage marginal notes. In my MWE I change definition for \rdate and slightly simplified it.

added information, where in memoir manual is described OP' problem
Zarko
• 235.6k
• 18
• 134
• 296

I'm still not sure, if I understand question correctly ... do you mean something like this?

For above image I change your code only in definition of left side note (now in boldface text), where I actually only erase flushleft and in edit add \RaggedLeft from package ragged2e:

\newcommand{\marginhead}[1]{\sidepar[\bfseries\footnotesize
\RaggedLeft #1]{}}


For showing where are side notes, I add package showframe.

Edit: I change your MWE as follows:

\documentclass[a4paper,11pt,article,oneside]{memoir}
\pagestyle{simple}

\setmarginnotes{0.5em}{3cm}{2em} % margins?
\checkandfixthelayout

\usepackage{ragged2e} % layout
\usepackage{showframe} % layout

% custom sidepar, marginpar
\RaggedLeft #1]{}}
\newcommand{\rdate}[1]{\normalmarginpar\marginpar{
\parbox{\marginparwidth}{\footnotesize #1}}}
\begin{document}

\rdate{03.\,2015 -- 09.\,2015}

Monitoring... \rdate{Apr 2013 -- Dec 2013}
\end{document}


INIn it I add package ragged2e which allow more smart aligning of text in boxes. I also change left side margin definition and the way how it should be used. I hope that now I'm correctly figured pout what you like to have.

Edit (2): The distance between text and margin notes is controlled by length \marginparsep With

  \setlength{\marginparsep}{<width>}


you can change it to distance to your wish. See pages 9 -- 11 in memoir manual for details. Helpful is also description in section 2.5 (HEADERS, FOOTERS AND MARGINAL NOTES) where are details how to manage marginal notes.

change image again, add code and some more expalantion
Zarko
• 235.6k
• 18
• 134
• 296