I'm creating some text with right aligned margin note and I want to make left margin space the same as the right margin space.
My idea to align:
set \pageLeftMargin
to \pageRightMargin
+ \marginNoteLength
+ \myMarginparSep
\newlength{\marginNoteLength}
\settowidth{\marginNoteLength}{1903 - 1908}
\newcommand{\myMarginparSep}{20pt}
\newcommand{\pageRightMargin}{0in}
\newlength{\pageLeftMargin}
\setlength{\pageLeftMargin}{\dimexpr(\pageRightMargin+\marginNoteLength+\myMarginparSep)\relax}
\newlength{\marginoffset}
\setlength{\marginoffset}{\dimexpr(\pageLeftMargin-\pageRightMargin)\relax}
\geometry{
left=\pageLeftMargin,
top=1in,
right=\pageRightMargin,
bottom=1in,
marginparsep=\myMarginparSep,
marginparwidth=10in,
}
But as turned out, it doesn't work: right margin is zero while left margin is not.
How do I fix it?
%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode
\documentclass[10pt]{article}
% DOCUMENT LAYOUT
\usepackage{enumitem, geometry, calc}
\newlength{\marginNoteLength}
\settowidth{\marginNoteLength}{1903 - 1908}
\newcommand{\myMarginparSep}{20pt}
\newcommand{\pageRightMargin}{0in}
\newlength{\pageLeftMargin}
\setlength{\pageLeftMargin}{\dimexpr(\pageRightMargin+\marginNoteLength+\myMarginparSep)\relax}
\newlength{\marginoffset}
\setlength{\marginoffset}{\dimexpr(\pageLeftMargin-\pageRightMargin)\relax}
\geometry{
left=\pageLeftMargin,
top=1in,
right=\pageRightMargin,
bottom=1in,
marginparsep=\myMarginparSep,
marginparwidth=10in,
}
\usepackage{luatexja-fontspec}
\setmainfont[Numbers=OldStyle]{Linux Libertine}
\usepackage{marginnote}
\newcommand{\marginNote}[1]{\mbox{}\marginnote{\hfill \normalsize #1}}
\renewcommand*{\raggedleftmarginnote}{}
\reversemarginpar
\begin{document}
\centerline{\tikz{\draw[-] (0,0)--(29.9,0);
\foreach \i in {0,0.1,...,29.8}{\node (\i) at (\i,0) {$|$};}
}
}
\marginNote{1908 - 1911} \hfill University of Bern\\
\marginNote{1911 - 1912} \hfill University of Zürich\\
\marginNote{1912 - 1914} \hfill Charles University of Prague\\
\marginNote{1914 - 1932} \hfill Prussian Academy of Sciences, Berlin\\
\marginNote{1920 - 1930} \hfill University of Leiden\\
\marginNote{1932 - 1955} \hfill Institute for Advanced Study, Princeton
\end{document}