Как расширить логику if, перейдя от пропуска отдельных слайдов к определенным частям кадра Beamer?

Как расширить логику if, перейдя от пропуска отдельных слайдов к определенным частям кадра Beamer?

У меня есть следующая рабочая структура для исключения отдельных слайдов лекции из формы статьи лекции:

\documentclass[11pt,handout]{beamer}

\newif\iflecture

\lecturetrue

% Next three lines for article form of presentation

\lecturefalse 

\documentclass[11pt]{article}

\usepackage{beamerarticle}

\iflecture

...frames for just the lecture and not the article form

\fi

оставшиеся кадры для обоих.

Можно ли распространить эту логику на один кадр?

\begin{frame}

...content for both lecture and article, a problem for example

end article content here

...remaining content just for lecture

\end{frame}

решение1

Если вы хотите, чтобы определенный материал отображался только тогда, когда файл набран как лекция, с \lectureture, то вам нужно просто заключить его в

\iflecture <lecture only material>...\fi 

Аналогично для материала, не предназначенного для лекции, используйте:

\iflecture\else <article only material>...\fi 

Конечно, вы также можете комбинировать их:

\iflecture <lecture only material>
\else <article only material>\fi 

Другая полезная конструкция заключается в том, что вы можете передавать различные параметры в beamer или другие пакеты, используя \PassOptionsToClass. Вот полный MWE:

\newif\iflecture
\lecturefalse   % uncomment if typesetting as an article
%\lecturetrue   % uncomment if typesetting as a lecture

\iflecture\else
  \PassOptionsToClass{11pt,handout}{beamer}
\fi

\documentclass{beamer}

\begin{document}

  \iflecture
    \begin{frame}{Lecture only frame}
    A framed lecture
    \end{frame}
  \fi

  \begin{frame}
    ...content for both lecture and article, a problem for example
    \iflecture\else article content here\fi

    \iflecture ...remaining content just for lecture\fi
  \end{frame}

\end{document}

Связанный контент