0

I would like to pass several arguments to \documentclass[HERE]{beamer}. I have several arguments so I don't want to write them all in there. I would like to pass a file or write them down in the preamble so it is more organised and structured.

Here is an example of the cluttered version that I currently have:

\documentclass[aspectratio=169,10pt,hyperref={backref=page, colorlinks=true,linkcolor=blue, filecolor=magenta, urlcolor=blue, citecolor=blue,}]{beamer}

What I want to achieve:

\documentclass[file.tex (or a function called "arguments")]{beamer}
%
%
%
%
% List of Arguments
arguments = {
            aspectratio=169,
            10pt,
            hyperref={backref=page,colorlinks=true,linkcolor=blue, filecolor=magenta, urlcolor=blue, citecolor=blue}
            }
4
  • 1
    Your class has to support that if you want the options passed from a file (some classes have such a mechanism). You could just use line breaks in the list of options, something like \documentclass[aspectratio=169,\n10pt\n,...]{beamer} (with \n being replaced by a newline).
    – Skillmon
    Dec 16, 2022 at 11:34
  • How can I modify the class so that It can support that? Dec 17, 2022 at 12:04
  • 1
    You don't. While in theory possible it's a bad idea to modify a class file, it only leads to incompatibilities in the long run. What you could do is define a wrapper class that you use locally, but this way sharing your documents with others will be harder. I don't really understand why the suggestion to put the options in multiple lines as shown in the comments doesn't suffice. If you absolutely want to have the options in a separate file I could provide code that loads \documentclass with the options from that file, but that doesn't lead to a better structured preamble at all.
    – Skillmon
    Dec 17, 2022 at 12:08
  • Don't worry, I would take @daleif answer! Thanks for your advice and help1 Dec 17, 2022 at 12:14

1 Answer 1

1

As @Skillmon writes in a comment simply use

\documentclass[
  aspectratio=169,
  10pt,
  hyperref={
            backref=page, 
            colorlinks=true,
            linkcolor=blue, 
            filecolor=magenta, 
            urlcolor=blue, 
            citecolor=blue,
  },
]{beamer}

This makes it a lot more readable and it is easy to outcomment a setting if needed.

1
  • Okay, this is a bit better than having them all in one line. Thanks! Dec 17, 2022 at 12:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .