Re: [O] Placement of \makeatletter with \beamer@frametextheight
Julius Müller writes: > Am 29.11.18 um 14:07 schrieb Loris Bennett: [snip (33 lines)] >> After that I tried adding the definition on the slide itself >> >> #+BEGIN_SRC latex >> >> \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother >> #+END_SRC > > Hm, src-block? I would have thought you should wrap that in an > export-block, so those commands get added to the exported document, not > quoted within as a source code. That would mean > > #+begin_export latex > \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother > #+end_export I tried that, but still got the error about \beamer being undefined. However, my understanding is that, if I am exporting to LaTeX, then BEGIN_SRC latex and BEGIN_EXPORT latex do the same thing. So if I have the following in my org file: #+BEGIN_EXPORT latex \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother #+END_EXPORT #+BEGIN_SRC latex \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother #+END_SRC I get \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother in my tex file. Cheers, Loris -- This signature is currently under construction.
Re: [O] Placement of \makeatletter with \beamer@frametextheight
On Thursday, 29 Nov 2018 at 16:12, Loris Bennett wrote: > So I went with \paperheight instead, which works fine. :-) sometimes we get caught up with complex solutions (and fail) when easy solutions exist! Glad you got it sorted in any case. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Joost Kremers writes: > On Thu, Nov 29 2018, Gustavo Barros wrote: >> Louis, >> >> a hunch, which might work. >> It seems that, if you try to set the length in your preamble, >> `\beamer@frametextheight` is not yet defined. >> So, you might try the hook `\AtBeginDocument` to see if the definition comes >> at >> a better timing. >> >> #+LATEX_HEADER: >> \newlength\mytextheight\AtBeginDocument{\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother} >> >> As I said, it's a hunch, for I haven't tested. But I think it may be it. > > Why not put the entire thing inside \AtBeginDocument? > > To the OP: \paperheight does seem to be available in Beamer. Couldn't you use > that? Using #+LATEX_HEADER: \newlength\mytextheight\AtBeginDocument{\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother} also leads to the error ! Undefined control sequence. \beamer So I went with \paperheight instead, which works fine. Regards Loris -- This signature is currently under construction.
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Am 29.11.18 um 14:07 schrieb Loris Bennett: > Eric S Fraga writes: > >> On Thursday, 29 Nov 2018 at 09:38, Julius Dittmar wrote: >>> Am 29.11.18 um 09:13 schrieb Julius Dittmar: Am 29.11.18 um 08:17 schrieb Loris Bennett: >> #+latex_header: >> \makeatletter\let\mytextheight\beamer@frametexheight\makeatother >> #+attr_latex: :height 0.75\mytextheight >>> >>> Oh, or perhaps just a typo is involved: is it really >>> \beamer@frametexheight or rather \beamer@frametextheight you are chasing >>> after? >> >> Also, you may need to define your mytextheight as a length and then use >> \setlength instead of \let. > > After correcting the typo I followed Eric's and Julius's suggestions and > I tried adding > > #+LATEX_HEADER: > \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother > > to the beginning of the Org file, but in this case > > \the\mytextheight > > is 0.0pt. That's what I suspected. You could try to wrap this line in an #+begin_export latex block (as I suggested), then it will be within the document instead of in the preamble. I usually refrain from using AtBeginDocument hooks (Gustavo Barros' suggestion) because I do not know enough about them, so I rather add the commands to a place I can see ;-) > After that I tried adding the definition on the slide itself > > #+BEGIN_SRC latex > > \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother > #+END_SRC Hm, src-block? I would have thought you should wrap that in an export-block, so those commands get added to the exported document, not quoted within as a source code. That would mean #+begin_export latex \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother #+end_export HTH, Julius
Re: [O] Placement of \makeatletter with \beamer@frametextheight
On Thu, Nov 29 2018, Gustavo Barros wrote: Louis, a hunch, which might work. It seems that, if you try to set the length in your preamble, `\beamer@frametextheight` is not yet defined. So, you might try the hook `\AtBeginDocument` to see if the definition comes at a better timing. #+LATEX_HEADER: \newlength\mytextheight\AtBeginDocument{\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother} As I said, it's a hunch, for I haven't tested. But I think it may be it. Why not put the entire thing inside \AtBeginDocument? To the OP: \paperheight does seem to be available in Beamer. Couldn't you use that? -- Joost Kremers Life has its moments
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Louis, a hunch, which might work. It seems that, if you try to set the length in your preamble, `\beamer@frametextheight` is not yet defined. So, you might try the hook `\AtBeginDocument` to see if the definition comes at a better timing. #+LATEX_HEADER: \newlength\mytextheight\AtBeginDocument{\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother} As I said, it's a hunch, for I haven't tested. But I think it may be it. Best, Gustavo. On 29/11/2018 11:07, Loris Bennett wrote: Eric S Fraga writes: On Thursday, 29 Nov 2018 at 09:38, Julius Dittmar wrote: Am 29.11.18 um 09:13 schrieb Julius Dittmar: Am 29.11.18 um 08:17 schrieb Loris Bennett: #+latex_header: \makeatletter\let\mytextheight\beamer@frametexheight\makeatother #+attr_latex: :height 0.75\mytextheight Oh, or perhaps just a typo is involved: is it really \beamer@frametexheight or rather \beamer@frametextheight you are chasing after? Also, you may need to define your mytextheight as a length and then use \setlength instead of \let. After correcting the typo I followed Eric's and Julius's suggestions and I tried adding #+LATEX_HEADER: \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother to the beginning of the Org file, but in this case \the\mytextheight is 0.0pt. After that I tried adding the definition on the slide itself: #+BEGIN_SRC latex \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother #+END_SRC but got the error ! Undefined control sequence. \beamer l.153 \end{frame} ! Missing number, treated as zero. @ l.153 \end{frame} Any thoughts? Cheers, Loris
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Eric S Fraga writes: > On Thursday, 29 Nov 2018 at 09:38, Julius Dittmar wrote: >> Am 29.11.18 um 09:13 schrieb Julius Dittmar: >>> Am 29.11.18 um 08:17 schrieb Loris Bennett: > #+latex_header: > \makeatletter\let\mytextheight\beamer@frametexheight\makeatother > #+attr_latex: :height 0.75\mytextheight >> >> Oh, or perhaps just a typo is involved: is it really >> \beamer@frametexheight or rather \beamer@frametextheight you are chasing >> after? > > Also, you may need to define your mytextheight as a length and then use > \setlength instead of \let. After correcting the typo I followed Eric's and Julius's suggestions and I tried adding #+LATEX_HEADER: \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother to the beginning of the Org file, but in this case \the\mytextheight is 0.0pt. After that I tried adding the definition on the slide itself: #+BEGIN_SRC latex \newlength\mytextheight\makeatletter\setlength\mytextheight{\beamer@frametextheight}\makeatother #+END_SRC but got the error ! Undefined control sequence. \beamer l.153 \end{frame} ! Missing number, treated as zero. @ l.153 \end{frame} Any thoughts? Cheers, Loris -- This signature is currently under construction.
Re: [O] Placement of \makeatletter with \beamer@frametextheight
On Thursday, 29 Nov 2018 at 09:38, Julius Dittmar wrote: > Am 29.11.18 um 09:13 schrieb Julius Dittmar: >> Am 29.11.18 um 08:17 schrieb Loris Bennett: #+latex_header: \makeatletter\let\mytextheight\beamer@frametexheight\makeatother #+attr_latex: :height 0.75\mytextheight > > Oh, or perhaps just a typo is involved: is it really > \beamer@frametexheight or rather \beamer@frametextheight you are chasing > after? Also, you may need to define your mytextheight as a length and then use \setlength instead of \let. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Am 29.11.18 um 09:13 schrieb Julius Dittmar: > Am 29.11.18 um 08:17 schrieb Loris Bennett: >>> #+latex_header: >>> \makeatletter\let\mytextheight\beamer@frametexheight\makeatother >>> #+attr_latex: :height 0.75\mytextheight Oh, or perhaps just a typo is involved: is it really \beamer@frametexheight or rather \beamer@frametextheight you are chasing after? HTH, Julius
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Hi Loris, I don't know beamer enough to propose an elegant solution. Nonetheless I have ideas what might go wrong here. Am 29.11.18 um 08:17 schrieb Loris Bennett: >> #+latex_header: >> \makeatletter\let\mytextheight\beamer@frametexheight\makeatother >> #+attr_latex: :height 0.75\mytextheight First, \let copies the at-the-moment-of-definition version of \beamer@frametexheight to \mytextheight. This happens in the preamble. I expect beamer to set up things like frame height at the begin of the document (exactly the \begin{document} line), not earlier. Thus at the point of that \let, that length isn't what you want yet. Solution to this: #+begin_export latex \makeatletter... #+end_export Second, \let creates a macro whereas it then is used as a length for the figure. I doubt that is possible. If that's the reason, you might try #+begin_export latex \newlength\mytextheight \makeatletter \setlength\mytextheight{\beamer@frametexheight} \makeatother #+end_export Perhaps this gives you a starting point to further play with it. HTH, Julius
Re: [O] Placement of \makeatletter with \beamer@frametextheight
Hi Eric, Eric S Fraga writes: > On Wednesday, 28 Nov 2018 at 16:09, Loris Bennett wrote: >> Hi, >> >> I want to specify the size of a graphic in an Beamer presentation >> generated from my org file. The following >> >> #+ATTR_LATEX: :height 0.75\textheight >> >> works, but >> >> #+ATTR_LATEX: :height 0.75\beamer@frametextheight >> >> I get the error >> >> ! Undefined control sequence. >> \Gin@@eheight ->0.5\beamer >> @frametextheight >> >> I assume I need to insert a \makeatletter at the appropriate point. >> Where would that be? > > You might find it easier to create your own variable in the header of > the LaTeX file and use that directly, as in (untested): > > #+latex_header: > \makeatletter\let\mytextheight\beamer@frametexheight\makeatother > > ... > > #+attr_latex: :height 0.75\mytextheight Thanks, but with that I get ! Undefined control sequence. \Gin@@eheight ->0.75\mytextheight However, the tex file looks OK: ... \usepackage[sfdefault]{Fira Sans} \makeatletter\let\mytextheight\beamer@frametexheight\makeatother \definecolor{mFubMainGreen}{HTML}{99CC00} ... \begin{center} \includegraphics[height=0.75\mytextheight]{../../common/resources.png} \end{center} ... Any ideas what might still be going wrong? Cheers, Loris -- This signature is currently under construction.
Re: [O] Placement of \makeatletter with \beamer@frametextheight
On Wednesday, 28 Nov 2018 at 16:09, Loris Bennett wrote: > Hi, > > I want to specify the size of a graphic in an Beamer presentation > generated from my org file. The following > > #+ATTR_LATEX: :height 0.75\textheight > > works, but > > #+ATTR_LATEX: :height 0.75\beamer@frametextheight > > I get the error > > ! Undefined control sequence. > \Gin@@eheight ->0.5\beamer > @frametextheight > > I assume I need to insert a \makeatletter at the appropriate point. > Where would that be? You might find it easier to create your own variable in the header of the LaTeX file and use that directly, as in (untested): #+latex_header: \makeatletter\let\mytextheight\beamer@frametexheight\makeatother ... #+attr_latex: :height 0.75\mytextheight -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442
[O] Placement of \makeatletter with \beamer@frametextheight
Hi, I want to specify the size of a graphic in an Beamer presentation generated from my org file. The following #+ATTR_LATEX: :height 0.75\textheight works, but #+ATTR_LATEX: :height 0.75\beamer@frametextheight I get the error ! Undefined control sequence. \Gin@@eheight ->0.5\beamer @frametextheight I assume I need to insert a \makeatletter at the appropriate point. Where would that be? Cheers, Loris -- This signature is currently under construction.