# Different margins for different section headings

I would like text with a large left margin, chapter titles using a normal left margin, and section titles halfway between the two. This code:

\documentclass{memoir}
\usepackage{lipsum}

\setlrmarginsandblock{1in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\checkandfixthelayout

\begin{document}
\chapter{Chapter Title}
\lipsum[1]
\section{Section Title}
\lipsum[2]
\subsection{Sub Section Title}
\lipsum[3]
\newpage
\lipsum[4]
\section{Section Title}
\lipsum[5]
\subsection{Sub Section Title}
\lipsum[6]
\end{document}


gives this:

I want it to look like this:

(Notice in particular that the header shouldn't be in line with the paragraph text, and the extra margin for the text is always on the left, whether or not inside and outside margins differ.)

Is there a simple way?

(Document class is memoir, and I am using XeLaTeX, in case that matters.)

• Just an observation. Even though this layout can be obtained, I personally think it is distracting. Are you planning to put margin notes to fill the space that seems to be there for the shifted Section titles? This might help rebalance the otherwise zig-zag flow. – Jeffrey J Weimer Nov 9 '18 at 22:03

\documentclass[11pt]{memoir}

\usepackage{lipsum}
\usepackage{calc,environ}

%% page size and text block sizes
\setstocksize{9.25in}{6.125in}
\settrimmedsize{\stockheight}{\stockwidth}{*}
\setulmarginsandblock{0.85in}{*}{1}
\setlrmarginsandblock{0.5in}{*}{3.5}
\newlength{\margindiff}\setlength{\margindiff}{\foremargin - \spinemargin}
\newlength{\mpsep}\setlength{\mpsep}{2em}
\newlength{\mwidth}\setlength{\mwidth}{\margindiff -\mpsep}
\setmarginnotes{\mpsep}{\mwidth}{0.25\baselineskip}
\checkandfixthelayout

%% FULL PAGE
\NewEnviron{FullPage}{%
\BODY
}

%% HALF PAGE
\NewEnviron{HalfPage}{%
\BODY
}

\begin{document}

\begin{FullPage}
\chapter{First One}

This sentence shows how the text flows over the entire line of the page without having margins set on the left or right.

\end{FullPage}

\lipsum[1]

\begin{HalfPage}

\lipsum[2]

\end{HalfPage}

\end{document}


Perhaps you should consider the textblock first and adjust the division headings with respect to that. I hope that the following will help (minus any typos and plus your adjustments).

\documentclass[oneside]{memoir} % oneside to make all pages look the same
\usepackage{lipsum}
\newlength{\secprob} % a working length
\setlength{\secprob}{2in}
\setulmarginsandblock{1in}{1in}{*}
\setlrmarginsandblock{1.5\secprob}{1in}{*} % wider left margin
\checkandfixthelayout

\makeatletter
\renewcommand*{printchaptername}{\hspace{-\secprob} \chapnamefont \@chappap} % outdent chapter name
\renewcommand*{\printchaptertitle}[1]{\hspace{-\secprob} \chaptertitlefont #1} % outdent chapter title
\setsecindent{-0.5\secprob} % outdent for sections
\makepagestyle{secprob} % the page style

For more information see the manual (> texdoc memoir) chapters 6 and 7.