emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Placement of \makeatletter with \beamer@frametextheight
@ 2018-11-28 15:09 Loris Bennett
  2018-11-28 15:37 ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Loris Bennett @ 2018-11-28 15:09 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-28 15:09 Placement of \makeatletter with \beamer@frametextheight Loris Bennett
@ 2018-11-28 15:37 ` Eric S Fraga
  2018-11-29  7:17   ` Loris Bennett
  0 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2018-11-28 15:37 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-28 15:37 ` Eric S Fraga
@ 2018-11-29  7:17   ` Loris Bennett
  2018-11-29  8:13     ` Julius Dittmar
  0 siblings, 1 reply; 13+ messages in thread
From: Loris Bennett @ 2018-11-29  7:17 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

Eric S Fraga <esflists@gmail.com> 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29  7:17   ` Loris Bennett
@ 2018-11-29  8:13     ` Julius Dittmar
  2018-11-29  8:38       ` Julius Dittmar
  0 siblings, 1 reply; 13+ messages in thread
From: Julius Dittmar @ 2018-11-29  8:13 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29  8:13     ` Julius Dittmar
@ 2018-11-29  8:38       ` Julius Dittmar
  2018-11-29  9:26         ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Julius Dittmar @ 2018-11-29  8:38 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29  8:38       ` Julius Dittmar
@ 2018-11-29  9:26         ` Eric S Fraga
  2018-11-29 13:07           ` Loris Bennett
  0 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2018-11-29  9:26 UTC (permalink / raw)
  To: Julius Dittmar; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29  9:26         ` Eric S Fraga
@ 2018-11-29 13:07           ` Loris Bennett
  2018-11-29 13:24             ` Gustavo Barros
  2018-11-29 13:47             ` Julius Müller
  0 siblings, 2 replies; 13+ messages in thread
From: Loris Bennett @ 2018-11-29 13:07 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <esflists@gmail.com> 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.
  <argument> \beamer 
                     
  l.153 \end{frame}
                   
  ! Missing number, treated as zero.
  <to be read again> 
                     @
  l.153 \end{frame}

Any thoughts?

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 13:07           ` Loris Bennett
@ 2018-11-29 13:24             ` Gustavo Barros
  2018-11-29 13:41               ` Joost Kremers
  2018-11-29 13:47             ` Julius Müller
  1 sibling, 1 reply; 13+ messages in thread
From: Gustavo Barros @ 2018-11-29 13:24 UTC (permalink / raw)
  To: Loris Bennett, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]

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 <esflists@gmail.com> 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.
>    <argument> \beamer
>                       
>    l.153 \end{frame}
>                     
>    ! Missing number, treated as zero.
>    <to be read again>
>                       @
>    l.153 \end{frame}
>
> Any thoughts?
>
> Cheers,
>
> Loris
>


[-- Attachment #2: Type: text/html, Size: 3112 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 13:24             ` Gustavo Barros
@ 2018-11-29 13:41               ` Joost Kremers
  2018-11-29 15:12                 ` Loris Bennett
  0 siblings, 1 reply; 13+ messages in thread
From: Joost Kremers @ 2018-11-29 13:41 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Loris Bennett


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 13:07           ` Loris Bennett
  2018-11-29 13:24             ` Gustavo Barros
@ 2018-11-29 13:47             ` Julius Müller
  2018-11-30  7:13               ` Loris Bennett
  1 sibling, 1 reply; 13+ messages in thread
From: Julius Müller @ 2018-11-29 13:47 UTC (permalink / raw)
  To: emacs-orgmode

Am 29.11.18 um 14:07 schrieb Loris Bennett:
> Eric S Fraga <esflists@gmail.com> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 13:41               ` Joost Kremers
@ 2018-11-29 15:12                 ` Loris Bennett
  2018-11-29 17:50                   ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Loris Bennett @ 2018-11-29 15:12 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Joost Kremers

Joost Kremers <joostkremers@fastmail.fm> 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.
  <argument> \beamer

So I went with \paperheight instead, which works fine.

Regards

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 15:12                 ` Loris Bennett
@ 2018-11-29 17:50                   ` Eric S Fraga
  0 siblings, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2018-11-29 17:50 UTC (permalink / raw)
  To: Loris Bennett; +Cc: Joost Kremers, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Placement of \makeatletter with \beamer@frametextheight
  2018-11-29 13:47             ` Julius Müller
@ 2018-11-30  7:13               ` Loris Bennett
  0 siblings, 0 replies; 13+ messages in thread
From: Loris Bennett @ 2018-11-30  7:13 UTC (permalink / raw)
  To: emacs-orgmode

Julius Müller <Julius.S.Mueller@eureca.de> 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-11-30  7:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-28 15:09 Placement of \makeatletter with \beamer@frametextheight Loris Bennett
2018-11-28 15:37 ` Eric S Fraga
2018-11-29  7:17   ` Loris Bennett
2018-11-29  8:13     ` Julius Dittmar
2018-11-29  8:38       ` Julius Dittmar
2018-11-29  9:26         ` Eric S Fraga
2018-11-29 13:07           ` Loris Bennett
2018-11-29 13:24             ` Gustavo Barros
2018-11-29 13:41               ` Joost Kremers
2018-11-29 15:12                 ` Loris Bennett
2018-11-29 17:50                   ` Eric S Fraga
2018-11-29 13:47             ` Julius Müller
2018-11-30  7:13               ` Loris Bennett

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).