0

Using the Beamer article and presentation options I coded the following:

Quadrant \presentation{\Romanbar{1}\xspace}\article{I\xspace} (lagging) 
and \presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}  (leading)

And with either option this incorrectly produces:

Quadrant
I
(lagging) and 
IV
(leading)

because I need everything in one line.

I also tried coding the following commands, but this also fails:

\newcommand\Roma{\presentation{\Romanbar{1}\xspace}\article{I\xspace}}
\newcommand\Romb{\presentation{\Romanbar{2}}\article{I\hspace{-1pt}I}}
\newcommand\Romc{\presentation{\Romanbar{3}}\article{I\hspace{-1pt}I\hspace{-1pt}I}}
\newcommand\Romd{\presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}}

Is there a workaround?

MWE:

\documentclass[10pt]{article}
\usepackage{beamerarticle}
\setjobnamebeamerversion{main.beamer}
\usepackage{xspace}
\usepackage{romanbar}
\usepackage{parskip}

\newcommand\Roma{\presentation{\Romanbar{1}\xspace}\article{I\xspace}}
\newcommand\Romb{\presentation{\Romanbar{2}}\article{I\hspace{-1pt}I}}
\newcommand\Romc{\presentation{\Romanbar{3}}\article{I\hspace{-1pt}I\hspace{-1pt}I}}
\newcommand\Romd{\presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}}

\begin{document}
Quadrant \presentation{\Romanbar{1}\xspace}\article{I\xspace} (lagging) 
and \presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}  (leading)

vs

Quadrant {I\xspace} (lagging) 
and {I\hspace{-1pt}V}  (leading)

\end{document}

On overleaf gives:

enter image description here

The Beamer MWE:

\documentclass[9pt, %handouts,
ignorenonframetext]{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[landscape,a4paper,border shrink=5mm]\pgfpageslogicalpageoptions{1}{border code=\pgfusepath{stroke}}\pgfpageslogicalpageoptions{2}{border code=\pgfusepath{stroke}}

\setjobnamebeamerversion{main.beamer}
\usepackage{xspace}
\usepackage{romanbar}
\usepackage{parskip}

\newcommand\Roma{\presentation{\Romanbar{1}\xspace}\article{I\xspace}}
\newcommand\Romb{\presentation{\Romanbar{2}}\article{I\hspace{-1pt}I}}
\newcommand\Romc{\presentation{\Romanbar{3}}\article{I\hspace{-1pt}I\hspace{-1pt}I}}
\newcommand\Romd{\presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}}

\begin{document}
\begin{frame}{Frame Title}
    

Quadrant \presentation{\Romanbar{1}\xspace}\article{I\xspace} (lagging) 
and \presentation{\Romanbar{4}}\article{I\hspace{-1pt}V}  (leading)

vs

Quadrant \Romanbar{1} (lagging) 
and \Romanbar{4}  (leading)

\end{frame}
\end{document}

gives:

enter image description here

6
  • 1
    please provide aan example that produces the output shown, where is \Romanbar defined? Possibly unrelated \xspace appears mis-used here. Jul 28 at 17:08
  • @DavidCarlisle Sorry tried \xspace to fix the issue.
    – skvery
    Jul 28 at 18:24
  • I have defined \newcommand{\rom}[1]{\Romanbar{#1}} as a placeholder in the mean time.
    – skvery
    Jul 28 at 18:37
  • \mbox{Quadrant \presentation{\Romanbar{1}}\article{I} (lagging) and \presentation{\Romanbar{4}}\article{I\hspace{-1pt}V} (leading)} ? Jul 28 at 21:39
  • @DavidCarlisle I have many more to do and would prefer a replacement using \rom{1} ... \rom{4}. The solution suggested is too specific.
    – skvery
    Jul 28 at 23:54
1

You only need \only<mode>

\iftrue% \iftrue or \iffalse
    \documentclass{beamer}
\else
    \documentclass{article}
    \usepackage{beamerarticle,pgfkeys}
\fi

\usepackage{romanbar}

\pgfkeys{
    /skvery/rom/.cd,
    1/.initial={I},
    2/.initial={I\!I},
    3/.initial={I\!I\!I},
    4/.initial={I\!V},
    5/.initial={V},
    6/.initial={V\!I},
}
\def\skveryrom#1{\preORart{\Romanbar{#1}}{\pgfkeysvalueof{/skvery/rom/#1}}}
\def\preORart#1#2{\only<presentation>{#1}\only<article>{#2}}

\begin{document}
    \begin{frame}{Two mode Roman numbers}
        Roman one \skveryrom{1}
        \pause
        Roman two \skveryrom{2}
        \pause
        Roman three \skveryrom{3}
        \pause
        Roman four \skveryrom{4}
        \pause
        Roman five \skveryrom{5}
        \pause
        Roman six \skveryrom{6}
    \end{frame}
\end{document}

⬆️ in presentation mode

⬆️ in article mode

1
  • Can you define the macro so that I can use \roma{1} or \roma{4} in the text?
    – skvery
    Aug 1 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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