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.

I started to create a custom theme for beamer slides, and I want to change the default aspect ratio for this theme. Of course I can use \documentclass[aspectratio=169]{beamer} in every document, but I'd like to keep everything in *.sty files. In beamer.cls I found definitions of \beamer@paperwidth and \beamer@paperheight, but setting these lengths in bemerthemeMYTHEME.sty as follows has no effect on the result.

\mode<presentation>
\setlength\beamer@paperwidth{16.00cm}
\setlength\beamer@paperheight{10.00cm}

What would be a proper way to change the default aspect ratio in *.sty? Shell I use beamerouterthemeMYTHEME.sty or bemerthemeMYTHEME.sty for this?

share|improve this question
1  
Themes really should not be changing the aspect ratio: the two are separate concepts. Can you explain a bit more what you are doing: it sounds like you are making a custom class based on beamer more than a theme. –  Joseph Wright May 3 '13 at 10:06
    
@Papiro This is not a duplicate, IMO. Based on her/his post, zeliboba already knows how to set the aspect ratio. The question here is how to set the aspect ratio after \documentclass{...}. –  Jubobs May 3 '13 at 10:10
    
I try to translate corporate PowerPoint style to beamer, they use 16:9 aspect ratio, and I do not want to keep it as an option to \documentclass. Could you please elaborate a bit more on the "concepts"? For me it is just changing the defaults, you can do it with margins, why not with paper size? –  zeliboba May 3 '13 at 10:15
    
The problem is that a lot of the document settings derive from options passed to the class (such as aspectratio=169). You could probably adjust those settings after \documentclass{...} but you would probably have to rerun a lot of lines from the class file in order to get the desired result. I had a similar problem a while back: I wanted the output to look just as if I had loaded the smaller beamer class option while keeping all my tweaks in my .sty file. It turned out to be unwieldy and I ended up simply passing smaller as an option to the class: \documentclass[smaller]{beamer}. –  Jubobs May 3 '13 at 10:28
    
So you can do two things: 1) simply pass the class option in the \documentclass{...} command; 2) as Joseph Wright suggested, modify the beamer class file to create your own, which would set the aspect ratio to a different value by default. –  Jubobs May 3 '13 at 10:38
show 2 more comments

1 Answer

up vote 5 down vote accepted

A wrapper class beamer16x9.cls can be easily written:

\ProvidesClass{beamer16x9}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}}
\ProcessOptions\relax
\LoadClass[aspectratio=169]{beamer}
\endinput

Then starting a document with

\documentclass[<options>]{beamer16x9}

is equivalent to saying

\documentclass[aspectratio=169,<options>]{beamer}

The beamer16x9.cls file should be in one of the canonical places where TeX engines look for input.

share|improve this answer
    
That's great; much easier than my approach (I'll delete it). However, the difference between typing \documentclass[<options>]{beamer16x9} and typing \documentclass[aspectratio=169,<options>]{beamer} is marginal. I would personally just resign myself to doing the latter. –  Jubobs May 3 '13 at 11:05
    
@Jubobs With a custom class you might also make other changes, for example the theme-like stuff the OP asked about. –  Joseph Wright May 3 '13 at 11:15
    
Perfect! I was looking for something like this, thanks. –  zeliboba May 3 '13 at 12:41
    
Note: this topic may be useful to understand the details of class loading tex.stackexchange.com/questions/9908/… –  zeliboba May 3 '13 at 14:05
add comment

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.