# Using titlesec in beamerarticle with a modified section command

This is further to the solution provided to my previous question about allocating short and long titles correctly to the beamer and article output of a beamerarticle.

The solution provided there works fine; however it creates a further problem because I am also using the titlesec package to modify section title formatting in the article.

titlesec is designed for \section and, having used the solution in the previous question I am now using a customized command \Section. Any idea how to make titlesec "understand" \Section?

Additions to code for the minimal working example in the previous question:

\mode<article>{
\usepackage[compact]{titlesec}
}

\only<article>{
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titlespacing{\section}{0pt}{2em}{0.5em}
}

-

You can load titlesec and make the changes to the section style before loading beamerarticle. Here is an example with a distinctively different title style:

\documentclass{article}
%\documentclass{beamer}

\usepackage{titlesec}

\titleformat{\section}
{\normalfont\Large\scshape}{\thesection}{1em}{}
\titlespacing{\section}{0pt}{2em}{0.5em}

\usepackage{beamerarticle}

\newcommand\Section[2][]{%
\section<presentation>[#1]{#2}
\section<article>{#2}
}

\usetheme{Berlin}

\begin{document}

\begin{frame}
\tableofcontents
\end{frame}
\Section[Short title 1]{First Section's Full Title}
\begin{frame}
test
\end{frame}

\end{document}


This code should be commented out if you run in beamer mode. Alternatively, put the different preambles in different files, the body and common code in e.g. main.tex and use \input{main.tex} as suggested in the beamer documetation.

As far as I can tell, titlesec doesn't tolerate being loaded after beamerarticle.

-
Thank you, very straightforward after all! – Thomas Farrar Dec 6 '12 at 7:31