Re: Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-27 Thread Paul Johnson
On Wed, Sep 26, 2018 at 4:02 AM Jürgen Spitzmüller  wrote:
>
> Am Dienstag, den 25.09.2018, 15:08 -0500 schrieb Paul Johnson:
> > This seems like my LyX day to ask questions. Thanks for your help.
> >
> > We have some instructional web pages that have accompanying Beamer
> > slides. It is a hassle to edit the web page and the Beamer slides,
> > content goes out of sync.
> >
> > The idea hit me to write one document that can be exported as Beamer
> > Slides or as a Beamer Article.  I've explored the details quite a bit
> > and the process almost works smoothly. My preamble for slides has a
> > lot of customized settings and LyX does not gracefully convert from
> > Beamer slides to Beamer article as a result. I manually insert some
> > code... I need the \mode<> statements to adjust for the output
> > format.
> > I control input for each format with \mode{} and
> > \mode{}.  I find the back-and-forth transition mostly works.
>
> I'd suggest to use two documents: the actual beamer document that
> contains all the text and a portmanteau beamer-article file that
> basically simply \includes the beamer document. Then you can add
> specific preamble code to either document.
>
> See beamer-article.lyx in examples as a model.
>
> > However, there is one piece of conditional code where I need your
> > help. A Beamer slide document  is declared like so
> >
> > \documentclass[english]{beamer}
> >
> > Because beamer is the class, then "\mode" is immediately available.
> >
> > However, the Beamer article is declared as an article:
> >
> > \documentclass[english]{article}
> >
> > Because the \mode macro is not available yet, I am not able to
> > conditionalize setup statements for the article. I want to take the
> > "BeamerArticle" preamble code and wrap inside \mode:
>
> If you use the textclass "Article (Beamer)" (not "Article"), the
> beamerarticle package will be loaded and \mode is defined.
>
Thanks very much. I understand your suggestion and will follow it.


> HTH
> Jürgen



-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.


Re: Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-26 Thread Jürgen Spitzmüller
Am Dienstag, den 25.09.2018, 15:08 -0500 schrieb Paul Johnson:
> This seems like my LyX day to ask questions. Thanks for your help.
> 
> We have some instructional web pages that have accompanying Beamer
> slides. It is a hassle to edit the web page and the Beamer slides,
> content goes out of sync.
> 
> The idea hit me to write one document that can be exported as Beamer
> Slides or as a Beamer Article.  I've explored the details quite a bit
> and the process almost works smoothly. My preamble for slides has a
> lot of customized settings and LyX does not gracefully convert from
> Beamer slides to Beamer article as a result. I manually insert some
> code... I need the \mode<> statements to adjust for the output
> format.
> I control input for each format with \mode{} and
> \mode{}.  I find the back-and-forth transition mostly works.

I'd suggest to use two documents: the actual beamer document that
contains all the text and a portmanteau beamer-article file that
basically simply \includes the beamer document. Then you can add
specific preamble code to either document.

See beamer-article.lyx in examples as a model.

> However, there is one piece of conditional code where I need your
> help. A Beamer slide document  is declared like so
> 
> \documentclass[english]{beamer}
> 
> Because beamer is the class, then "\mode" is immediately available.
> 
> However, the Beamer article is declared as an article:
> 
> \documentclass[english]{article}
> 
> Because the \mode macro is not available yet, I am not able to
> conditionalize setup statements for the article. I want to take the
> "BeamerArticle" preamble code and wrap inside \mode:

If you use the textclass "Article (Beamer)" (not "Article"), the
beamerarticle package will be loaded and \mode is defined.

HTH
Jürgen


signature.asc
Description: This is a digitally signed message part


Re: Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-25 Thread Paul A. Rubin

On 09/25/2018 04:08 PM, Paul Johnson wrote:

This seems like my LyX day to ask questions. Thanks for your help.

We have some instructional web pages that have accompanying Beamer
slides. It is a hassle to edit the web page and the Beamer slides,
content goes out of sync.

The idea hit me to write one document that can be exported as Beamer
Slides or as a Beamer Article.  I've explored the details quite a bit
and the process almost works smoothly. My preamble for slides has a
lot of customized settings and LyX does not gracefully convert from
Beamer slides to Beamer article as a result. I manually insert some
code... I need the \mode<> statements to adjust for the output format.
I control input for each format with \mode{} and
\mode{}.  I find the back-and-forth transition mostly works.

However, there is one piece of conditional code where I need your
help. A Beamer slide document  is declared like so

\documentclass[english]{beamer}

Because beamer is the class, then "\mode" is immediately available.

However, the Beamer article is declared as an article:

\documentclass[english]{article}

Because the \mode macro is not available yet, I am not able to
conditionalize setup statements for the article. I want to take the
"BeamerArticle" preamble code and wrap inside \mode:


\mode{
\makeatletter
% Textclass specific LaTeX commands.
\usepackage{beamerarticle,pgf}
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatother
}

That fails, pdflatex error:

\mode{
The control sequence at the end of the top line of your error message
was never \def'ed.

Well, that should happen. "\mode" is an unrecognized symbol in the
article document. I can't have any \mode or
\mode settings until "\usepackage{beamerarticle}" package is
loaded.

I need to write a conditional statement like "if this document is not
a Beamer slide document, then include the following code" to fix the
problem. That's where I'm stuck at the current time.

pj

Have you tried using the other Beamer article layout (listed in the 
document settings as "Beamer Article (KOMA-script)", using the 
scrarticle-beamer.layout layout file? I just tried it, and \mode seems 
to be defined.


Paul Rubin



Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-25 Thread Paul Johnson
This seems like my LyX day to ask questions. Thanks for your help.

We have some instructional web pages that have accompanying Beamer
slides. It is a hassle to edit the web page and the Beamer slides,
content goes out of sync.

The idea hit me to write one document that can be exported as Beamer
Slides or as a Beamer Article.  I've explored the details quite a bit
and the process almost works smoothly. My preamble for slides has a
lot of customized settings and LyX does not gracefully convert from
Beamer slides to Beamer article as a result. I manually insert some
code... I need the \mode<> statements to adjust for the output format.
I control input for each format with \mode{} and
\mode{}.  I find the back-and-forth transition mostly works.

However, there is one piece of conditional code where I need your
help. A Beamer slide document  is declared like so

\documentclass[english]{beamer}

Because beamer is the class, then "\mode" is immediately available.

However, the Beamer article is declared as an article:

\documentclass[english]{article}

Because the \mode macro is not available yet, I am not able to
conditionalize setup statements for the article. I want to take the
"BeamerArticle" preamble code and wrap inside \mode:


\mode{
\makeatletter
% Textclass specific LaTeX commands.
\usepackage{beamerarticle,pgf}
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatother
}

That fails, pdflatex error:

\mode{
The control sequence at the end of the top line of your error message
was never \def'ed.

Well, that should happen. "\mode" is an unrecognized symbol in the
article document. I can't have any \mode or
\mode settings until "\usepackage{beamerarticle}" package is
loaded.

I need to write a conditional statement like "if this document is not
a Beamer slide document, then include the following code" to fix the
problem. That's where I'm stuck at the current time.

pj

-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.