[Tex/LaTex] Full width section titles in tufte-latex

fullwidthsectioningtufte

I am using tufte-latex and would like my section titles to use the full width of the page in the case that I use a fullwidth environment for the next block of text. However, when I try to compile this example:

\documentclass{tufte-book}
\usepackage{lipsum}

 \begin{document}

\begin{fullwidth}
\section{This is the Title of my Section, Which I Will Make Very Long to Demonstrate the Problem I Have Using Fullwidth}
\lipsum
\end{fullwidth}
\end{document}

I get the following error:

LaTeX Error: Something's wrong–perhaps a missing \item

However, if I run the code like this, it works, but gives me a too-narrow section header.

\documentclass{tufte-book}
\usepackage{lipsum}

 \begin{document}

\section{This is the Title of my Section, Which I Will Make Very Long to Demonstrate the Problem I Have Using Fullwidth}
\begin{fullwidth}
\lipsum
\end{fullwidth}

\end{document}

too-narrow section header

Best Answer

I think it's a bad idea for readability and consistency, but if you really must stretch the section heading across the full page, the following should work:

\documentclass{tufte-handout}

\titleformat{\section}%
  [display]% shape
  {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}\normalfont\Large\itshape}% format applied to label+text
  {\thesection}% label
  {1em}% horizontal separation between label and title body
  {}% before the title body
  [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body

\usepackage{lipsum}% provides filler text

\begin{document}

\section{This is a lengthy section heading to demonstrate it sprawls across the entire page width}

\begin{fullwidth}
\lipsum
\end{fullwidth}

\end{document}

Note also that the fullwidth environment is not designed two work across page boundaries and it may break in some cases. (The block of text will be offset horizontally on the page.)