Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
}
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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}

Sample output

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.

share|improve this answer
    
Thank you, very straightforward after all! –  Thomas Farrar Dec 6 '12 at 7:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.