Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Loris Bennett
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] How to handle an inline multiline noweb reference

2018-11-29 Thread Eric S Fraga
On Thursday, 29 Nov 2018 at 15:18, Samuel Wales wrote:
> it still feels like variables to me.  

I agree.  It's not the *same* as a pipe but does meet some of the requirements 
for some use cases...  I think expecting behaviour like pipes is possibly too 
much given the single threaded nature of much of emacs?
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442



Re: [O] How to handle an inline multiline noweb reference

2018-11-29 Thread Eric S Fraga
On Thursday, 29 Nov 2018 at 15:16, Samuel Wales wrote:
> On 11/28/18, Eric S Fraga  wrote:
>> The output (or more generally the results) of one src block is passed
>> directly as input to another using the :post argument.
>
> that helps.
>
> i'm not familiar with many languages.  shell and lisp work best for
> me, but in this case saying that clarifies.
>
> not sure where *this* comes in.  perhaps it is a variable in the
> second block being sent to the first block?

*this* is replaced by the results of the block that has the :post argument so, 
in this example, the results (i.e. the output) of the test block are placed in 
the x variable for the doubleit block.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442



Re: [O] [SOLVED]

2018-11-29 Thread Nick Dokos
Uwe Brauer  writes:

 "Berry," == Berry, Charles  writes:
>
>> I cannot reproduce your export issue with org 9.1.14.
>> You need to provide more details.
>
> Sorry for the noise. I just realised that a very very long time ago I
> installed a function  remove-src-blk-export, which, uhh, removes source
> blocks. 
>
> I removed that function and everything works as expected.

I was going to ask who produced that unfamiliar-looking "%% [removed
source block]" :-) Glad you figured it out.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] How to handle an inline multiline noweb reference

2018-11-29 Thread Samuel Wales
it still feels like variables to me.  if you did a shell example with
1000 lines, would those be piped in?  or would the variable contain
1000 lines?  i don't understandt he difference between post and just a
variable.

onte: i am only telling you this to improve documentation if you feel
like it.  i don't need this now.  just want to let you know that it is
not speakign to me.



Re: [O] How to handle an inline multiline noweb reference

2018-11-29 Thread Samuel Wales
On 11/28/18, Eric S Fraga  wrote:
> The output (or more generally the results) of one src block is passed
> directly as input to another using the :post argument.

that helps.

i'm not familiar with many languages.  shell and lisp work best for
me, but in this case saying that clarifies.

not sure where *this* comes in.  perhaps it is a variable in the
second block being sent to the first block?

> #+begin_src org
>   ,#+name: doubleit
>   ,#+begin_src octave :results output :var x=[0.1]
>   disp(2*x)
>   ,#+end_src
>
>   ,#+name: test
>   ,#+begin_src octave :post doubleit(x=*this*)
> 2*3.14
>   ,#+end_src
>
>   ,#+results: test
>   :  12.560
> #+end_src
>
> HTH,
> eric
>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442
>


-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] selective tangling?

2018-11-29 Thread Eric S Fraga
On Thursday, 29 Nov 2018 at 08:10, John Kitchin wrote:
> Are there any ways to selectively tangle blocks?

I cannot help but wanted to thank you for this little bit of magic:

> I usually put a :var a=(org-babel-tangle) header in the sh block,
> which makes sure the files are tangled, and then runs the shell

as I'm always forgetting to tangle...  So easy but so
effective.  Thanks!

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545



Re: [O] copy/paste headlines from org-indent-mode to text mode: invisible stars remain invisible

2018-11-29 Thread Alain . Cochard


 > You may want to add `face' to `yank-excluded-properties'.

Great.  Thanks a lot.
-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 



Re: [O] copy/paste headlines from org-indent-mode to text mode: invisible stars remain invisible

2018-11-29 Thread Nicolas Goaziou
Hello,

alain.coch...@unistra.fr writes:

> Hello.  When performing copy/paste (even with org-copy-visible) from
> org buffers with org-indent-mode turned on to buffers running, e.g.,
> fundamental or text modes, leading stars of the headlines are still
> invisible (until the file is saved and visited again).
>
> Insertions within this invisible region (minus the 1st character, plus
> the visible star) remain invisible.  In the case of a level 2
> headline, one might end up with a situation like this:
>
> text already there * headline title
>
> after which, if the cursor is put on the star, insertions just results
> in everything after (and including) the star being shifted rightward
> -- very funny.
>
> In retrospect this makes some sense to me, but, as the initial shock
> was quite intense during a few seconds, I report it in case it is not
> completely normal -- besides this does not occur if the target buffer
> is running, e.g., python or matlab or fortran modes.

You may want to add `face' to `yank-excluded-properties'.

Regards,

-- 
Nicolas Goaziou



Re: [O] Possible bug in org-mode (MELPA version as of 1018-11-25) : #+language: is not (fully) honored.

2018-11-29 Thread Nicolas Goaziou
Emmanuel Charpentier  writes:

> This is *not* *documented* (not even in the `org-latex-packages-alist''s
> docstring).

I know. I fixed `org-latex-packages-alist''s docstring two days ago.

> Also agreed, with the reservation that "invasive" didn't mean the same
> thing in the 1980s (when the core size of computers was measured in
> kilobytes) and in the 2010s (the current core measurement unit is the
> /giga/byte...).

Not invasive by its sheer size, but by the number of alterations it
generates in the LaTeX default behaviour, and the incompatibilities it
may introduce. For example there used to be issues between frenchb and
KOMA-Script.

> Again, I think that the end user should *not* have to worry with this only
> when exporting to LaTeX (or beamer or PDF). 

Ideally, that would be nice.

> If this can be handled silently when exporting to ODT, HTML or plain
> text, it should be handled silently when exporting to LaTeX.

I disagree. Packages should not be loaded /silently/.

> I do not know how to handle this. My *hunch* is that the Latex Export
> function generating the preamble should check for language

It does already, in `org-latex-guess-babel-language'.

> and if not default, add the relevant package(s) to the preamble.

Don't. Anything that is in the header should be declared.

We could try and see if Babel causes trouble by adding it to default
packages in "next" branch. I'd rather do that than inserting it
magically.



Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Eric S Fraga
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



[O] [SOLVED] (was: org babel: %% [removed source block])

2018-11-29 Thread Uwe Brauer
>>> "Berry," == Berry, Charles  writes:

   > I cannot reproduce your export issue with org 9.1.14.
   > You need to provide more details.

Sorry for the noise. I just realised that a very very long time ago I
installed a function  remove-src-blk-export, which, uhh, removes source
blocks. 

I removed that function and everything works as expected.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Possible bug in org-mode (MELPA version as of 1018-11-25) : #+language: is not (fully) honored.

2018-11-29 Thread Emmanuel Charpentier
Dear Nicolas,

Thanks a lot for bearing with my nitpicking. A couple remarks below

Le jeudi 29 novembre 2018 à 15:07 +0100, Nicolas Goaziou a écrit :

> Hello,
>
> emanuel.charpent...@gmail.com writes:
>

> > AFAICT, polyglossia is to be preferred to babel for use with
> > xelatex or
> > lualatex. I'll see if this can be accomodated.

>
> What I mean is that you can also add compiler dependant packages in
> `org-latex-packages-alist'.


This is *not* *documented* (not even in the `org-latex-packages-alist''s
docstring).

I *checked* that one can add 4-element "cells" to this list (i. e. (list
argument package, snippet-flag, list-of-compilers)), but could not *guess*
it : I'm still running /H sapiens sapiens L./ v 1.0, no telepathic
interface, no oracular coprocessor. The only way would have been to read
the source code : not exactly the first reflex of the average end-user.

> No need to change the default package list.


I dispute that, since this "special configuration" is needed for LaTeX
export *only* , and *only* with non-English #+language:s. This
"exceptional" treatment should be handled silently by org-mode (as it does
with ODT, HTML and plain text export...). But see below.

> > > it should be ("AUTO" "babel" t).

> >
> > OK. That's much clearer. And does what is intended, BTW.
> >
> > Shouldn't that be default ?(No, I don't (yet) know *how* to do
> > that..).

>
> Babel is no small package.


Agreed. And polyglossia is worse...

> I think it would be a bit invasive as
> a default package.


Also agreed, with the reservation that "invasive" didn't mean the same
thing in the 1980s (when the core size of computers was measured in
kilobytes) and in the 2010s (the current core measurement unit is the
/giga/byte...).

> However, it is a good candidate for user-defined
> packages, i.e., `org-latex-packages-alist'.


Again, I think that the end user should *not* have to worry with this only
when exporting to LaTeX (or beamer or PDF). If this can be handled silently
when exporting to ODT, HTML or plain text, it should be handled silently
when exporting to LaTeX.

I do not know how to handle this. My *hunch* is that the Latex Export
function generating the preamble should check for language, and if not
default, add the relevant package(s) to the preamble. I'll need to dive in
the source code to be more precise (not anytime soon, though...).

> > Thus introducing a serious problem : exporting to text or ODT works
> > as
> > described, whereas export to latex needs (undocumented)
> > supplementary
> > steps.
> >
> > At the very minimum, this need for further config should be
> > mentioned
> > in the docs ; preferably, a default should be proposed.

>
> See above about the default. However, please feel free to suggest
> documentation improvements, however.


I'll propose a documentation attempt. But this should be considered as a
workaround, the real solution being the implementation of automatic
handling...

Cordially yours,

--
Emmanuel Charpentier


> Regards,
>




>
>


Re: [O] org babel: %% [removed source block]

2018-11-29 Thread John Kitchin
Have you tried this with an emacs -q? Your examples work as expected in
emacs -q for me.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Nov 29, 2018 at 11:58 AM Uwe Brauer  wrote:

> >>> "Berry," == Berry, Charles  writes:
>
>> I cannot reproduce your export issue with org 9.1.14.
>> You need to provide more details.
>
> Ok, I searched already my custom settings.
>> Perhaps you have a header-arg set that you have not told us about?
>
>> What does C-c C-v C-i report when point is in each of your source
> blocks? I get
>
>> Lang: matlab
>> Properties:
>>:header-argsnil
>>:header-args:matlab nil
>> Header Arguments:
>>:cache  no
>>:exportscode
>>:hlines no
>>:noweb  no
>>:padlineno
>>:resultsnone
>>:sessionnone
>>:tangle test.m
>
>
> Her is my output
>
> The only difference I can find is the results/replace entry.
>
> Not sure what to do.
>
>
> Lang: matlab
> Properties:
> :header-argsnil
> :header-args:matlab nil
> Header Arguments:
> :cache  no
> :exportscode
> :hlines no
> :noweb  no
> :padlineno
> :resultsreplace
> :sessionnone
> :tangle test.m
>


Re: [O] selective tangling?

2018-11-29 Thread John Kitchin
I tried something like this already, for example this does what I want:


#+BEGIN_SRC ipython :tangle (if (eq tangle-tag 'one) "one.py" "no")
print('hello')
#+END_SRC

#+BEGIN_SRC text :tangle (if (eq tangle-tag 'one) "one.dat" "no")
print('hello')
#+END_SRC

#+BEGIN_SRC ipython :tangle (if (eq tangle-tag 'two) "two.py" "no")
print('hello2')
#+END_SRC

#+BEGIN_SRC makefile :tangle (if (eq tangle-tag 'two) "Makefile" "no")
build:
python two.py
#+END_SRC

Now only tangle things with a 'two
#+BEGIN_SRC emacs-lisp
(let ((tangle-tag 'two))
  (org-babel-tangle))
#+END_SRC

I didn't see a way to avoid having an intermediate variable to specify what
to tangle. This should have a check on if tangle-tag is bound to avoid an
error with regular tangle. Maybe it could be cleaned up by a function as
you describe, e.g. (selective-tangle 'two filename).

Another way I tried is this:

** example two

#+BEGIN_SRC ipython :tangle "one.py" :one
print('hello')
#+END_SRC

#+BEGIN_SRC text :tangle "one.dat" :one
print('hello')
#+END_SRC

#+BEGIN_SRC ipython :tangle "two.py" :two
print('hello2')
#+END_SRC

#+BEGIN_SRC makefile :tangle "Makefile" :two
build:
python two.py
#+END_SRC


#+BEGIN_SRC emacs-lisp
(org-babel-map-src-blocks (buffer-file-name)
  (let ((ha (read (format "(%s)" (substring-no-properties header-args)
(when (memq :two ha)
  (org-babel-tangle '(4)
#+END_SRC

#+RESULTS:
: 5235

I don't have strong feelings yet which way is better.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Nov 29, 2018 at 11:44 AM Berry, Charles  wrote:

>
>
> > On Nov 29, 2018, at 5:10 AM, John Kitchin 
> wrote:
> >
> > Are there any ways to selectively tangle blocks?
> >
> > By that I mean suppose there are a dozen src blocks in a file, but I
> want to selectively tangle only a few of them, selecting them by a tag, for
> example, or some other property. These might have mixed languages, e.g. a
> config files, a python script, and a makefile.
> >
> > The use case here is I have an org document that I use to document a
> simulation. The simulation has several config files, and a makefile, and
> there is a python script that does analysis. I like to put all of these in
> src blocks and then use a sh block to run the actual simulation command. I
> usually put a :var a=(org-babel-tangle) header in the sh block, which makes
> sure the files are tangled, and then runs the shell commands. But this
> tangles all the files in the buffer, which is usually not what I want
> (there are sometimes multiple simulations described in one file).  The
> blocks are not always in one subtree, so it isn't a matter of just
> narrowing, and they are mixed languages (text, make, python, etc.) and
> target files so I can't just target one file.
> >
> > The only mechanism for this i have come up with is to use
> org-babel-map-src-blocks to run a check on each block to see if it matches
> my tangle criteria and then run (org-babel-tangle t) on that block. This
> seems to work fine, but I thought I would check if anyone else has a better
> solution.
> >
> >
>
> Use the :tangle header arg with your check function and its args:
>
> :tangle (my-tangle-selector ...)
>
> HTH,
>
> Chuck
>
>
>
>


Re: [O] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer
>>> "Berry," == Berry, Charles  writes:

   > I cannot reproduce your export issue with org 9.1.14.
   > You need to provide more details.

Ok, I searched already my custom settings.
   > Perhaps you have a header-arg set that you have not told us about?

   > What does C-c C-v C-i report when point is in each of your source blocks? 
I get

   > Lang: matlab
   > Properties:
   >:header-argsnil
   >:header-args:matlab nil
   > Header Arguments:
   >:cache  no
   >:exportscode
   >:hlines no
   >:noweb  no
   >:padlineno
   >:resultsnone
   >:sessionnone
   >:tangle test.m


Her is my output

The only difference I can find is the results/replace entry.

Not sure what to do.


Lang: matlab
Properties:
:header-argsnil
:header-args:matlab nil
Header Arguments:
:cache  no
:exportscode
:hlines no
:noweb  no
:padlineno
:resultsreplace
:sessionnone
:tangle test.m


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Standard Format for Org Outlines?

2018-11-29 Thread David Masterson
Nicolas Goaziou  writes:

> David Masterson  writes:
>
>> Good try, but I think you got it backwards.  I pulled down a daily
>> development snapshot tarball from yesterday (not good with git yet) and
>> tried it again.  This time, it broke M-return by adding an extra blank
>> line after the header (ie. two blank lines), but still did not put in a
>> blank line after the header on C-return.
>
> Again, I need a recipe to reproduce your issue. I tried again with your
> previous example and in both cases, I get:
>
> * Header 1
>
> * 
>
> * Header 2

Hrph.  Okay, I'll dig further.  Thanks.
--
David



Re: [O] selective tangling?

2018-11-29 Thread Berry, Charles



> On Nov 29, 2018, at 5:10 AM, John Kitchin  wrote:
> 
> Are there any ways to selectively tangle blocks?
> 
> By that I mean suppose there are a dozen src blocks in a file, but I want to 
> selectively tangle only a few of them, selecting them by a tag, for example, 
> or some other property. These might have mixed languages, e.g. a config 
> files, a python script, and a makefile.
> 
> The use case here is I have an org document that I use to document a 
> simulation. The simulation has several config files, and a makefile, and 
> there is a python script that does analysis. I like to put all of these in 
> src blocks and then use a sh block to run the actual simulation command. I 
> usually put a :var a=(org-babel-tangle) header in the sh block, which makes 
> sure the files are tangled, and then runs the shell commands. But this 
> tangles all the files in the buffer, which is usually not what I want (there 
> are sometimes multiple simulations described in one file).  The blocks are 
> not always in one subtree, so it isn't a matter of just narrowing, and they 
> are mixed languages (text, make, python, etc.) and target files so I can't 
> just target one file.
> 
> The only mechanism for this i have come up with is to use 
> org-babel-map-src-blocks to run a check on each block to see if it matches my 
> tangle criteria and then run (org-babel-tangle t) on that block. This seems 
> to work fine, but I thought I would check if anyone else has a better 
> solution.
> 
> 

Use the :tangle header arg with your check function and its args:

:tangle (my-tangle-selector ...)

HTH,

Chuck






Re: [O] org babel: %% [removed source block]

2018-11-29 Thread Berry, Charles
I cannot reproduce your export issue with org 9.1.14.

You need to provide more details.

Perhaps you have a header-arg set that you have not told us about?

What does C-c C-v C-i report when point is in each of your source blocks? I get

Lang: matlab
Properties:
:header-argsnil
:header-args:matlab nil
Header Arguments:
:cache  no
:exportscode
:hlines no
:noweb  no
:padlineno
:resultsnone
:sessionnone
:tangle test.m


for the first.

HTH,

Chuck

> On Nov 29, 2018, at 3:38 AM, Uwe Brauer  wrote:
> 
> 
> Hi 
> 
> I have the following org file
> #+BEGIN_SRC matlab :tangle test.m :padline no :results none
> function [ll x]=mitest(A0,x0)
> % initialization 
> format long
> epsi=1.e-3;
> nit=0;
> nmaxit=200;
> Delta=10;
> A=A0;
> while Delta>epsi & nitnit=nit+1; % counter
> #+END_SRC
> 
> The basic idea is.
> That we do.
> We also will
> 
> #+BEGIN_SRC matlab :tangle test.m :padline no
>y=A*x0;
> end
> #+END_SRC
> 
> Now org-babel-tangle works nicely, but when I try to export the org file
> to latex via org-export-dispatch
> 
> I obtain a latex file in which the source code is removed. 
> 
> What do I miss??
> 
> 
> I am asked in the export process whether I want to evaluate the code,
> which I don't since it is a simple function not a code to be evaluated.
> 
> 
> 





Re: [O] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > Maybe you need :exports and not :export.
   > John

I tried also lisp

#+begin_src elisp :tangle test.el  :exports code :padline no 
(require 'ob-ipython)

(setq org-confirm-babel-evaluate t)   ;don't prompt me to confirm everytime I 
want to evaluate a block

;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
#+end_src

The basic idea is.
That we do.
We also will

#+begin_src elisp  :tangle test.el :exports code  :padline no 
(defun org-babel-execute:matlab-org (body params)
  "Execute a block of matlab code with Babel."
  (org-babel-execute:octave body params 'matlab))
#+end_src

But no, when exporting to latex the source code is removed.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > Maybe you need :exports and not :export.
   > John


I also see 
Code block produced no output.
org-babel-exp process matlab at position 250...


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > Maybe you need :exports and not :export.
   > John

I tried 

#+begin_src matlab :tangle test.m  :exports code :padline no 
function [ll x]=mitest(A0,x0)
% initialization 
format long
epsi=1.e-3;
nit=0;
nmaxit=200;
Delta=10;
A=A0;
while Delta>epsi & nit

smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Loris Bennett
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] Standard Format for Org Outlines?

2018-11-29 Thread Nicolas Goaziou
Hello,

David Masterson  writes:

> Good try, but I think you got it backwards.  I pulled down a daily
> development snapshot tarball from yesterday (not good with git yet) and
> tried it again.  This time, it broke M-return by adding an extra blank
> line after the header (ie. two blank lines), but still did not put in a
> blank line after the header on C-return.

Again, I need a recipe to reproduce your issue. I tried again with your
previous example and in both cases, I get:

--8<---cut here---start->8---
* Header 1

* 

* Header 2
--8<---cut here---end--->8---


Regards,

-- 
Nicolas Goaziou



Re: [O] Possible bug in org-mode (MELPA version as of 1018-11-25) : #+language: is not (fully) honored.

2018-11-29 Thread Nicolas Goaziou
Hello,

emanuel.charpent...@gmail.com writes:

> AFAICT, polyglossia is to be preferred to babel for use with xelatex or
> lualatex. I'll see if this can be accomodated.

What I mean is that you can also add compiler dependant packages in
`org-latex-packages-alist'. No need to change the default package list.

>> it should be ("AUTO" "babel" t).
>
> OK. That's much clearer. And does what is intended, BTW.
>
> Shouldn't that be default ?(No, I don't (yet) know *how* to do that..).

Babel is no small package. I think it would be a bit invasive as
a default package. However, it is a good candidate for user-defined
packages, i.e., `org-latex-packages-alist'.

> Thus introducing a serious problem : exporting to text or ODT works as
> described, whereas export to latex needs (undocumented) supplementary
> steps.
>
> At the very minimum, this need for further config should be mentioned
> in the docs ; preferably, a default should be proposed.

See above about the default. However, please feel free to suggest
documentation improvements, however.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Cannot create html file from org [9.1.9 (release_9.1.9-65-g5e4542 @ c:/programs/emacs-26.1-x86_64/share/emacs/26.1/lisp/org/)]

2018-11-29 Thread Nicolas Goaziou
Hello,

Helge Stenström  writes:

> I try to export org file to html, using C-c C-e h o
>
> I get: defconst: Symbol's value as variable is void: css-mode-syntax-table

This variable is not used in Org base. The problem may come from
a configuration of yours.

Regards,

-- 
Nicolas Goaziou



[O] copy/paste headlines from org-indent-mode to text mode: invisible stars remain invisible

2018-11-29 Thread Alain . Cochard



Hello.  When performing copy/paste (even with org-copy-visible) from
org buffers with org-indent-mode turned on to buffers running, e.g.,
fundamental or text modes, leading stars of the headlines are still
invisible (until the file is saved and visited again).

Insertions within this invisible region (minus the 1st character, plus
the visible star) remain invisible.  In the case of a level 2
headline, one might end up with a situation like this:

text already there * headline title

after which, if the cursor is put on the star, insertions just results
in everything after (and including) the star being shifted rightward
-- very funny.

In retrospect this makes some sense to me, but, as the initial shock
was quite intense during a few seconds, I report it in case it is not
completely normal -- besides this does not occur if the target buffer
is running, e.g., python or matlab or fortran modes.   

Regards

-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 



Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Julius Müller
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] org babel: %% [removed source block]

2018-11-29 Thread John Kitchin
Maybe you need :exports and not :export.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Nov 29, 2018 at 8:20 AM Uwe Brauer  wrote:

> >>> "Eric" == Eric S Fraga  writes:
>
>> On Thursday, 29 Nov 2018 at 12:38, Uwe Brauer wrote:
>>> Now org-babel-tangle works nicely, but when I try to export the org
>>> file to latex via org-export-dispatch
>
>> I think the default is
>> :exports results
>> so you what you want is either
>> :exports both
>> or
>> :exports code
>
> Thanks, but I tried
> #+begin_src matlab :tangle test.m  :export code   :wrap latex :padline no
> function [ll x]=mitest(A0,x0)
> % initialization
> format long
> epsi=1.e-3;
> nit=0;
> nmaxit=200;
> Delta=10;
> A=A0;
> while Delta>epsi & nit nit=nit+1; % counter
> #+end_src
>
> The basic idea is.
> That we do.
> We also will
>
> #+begin_src matlab  :tangle test.m :export both  :wrap latex :padline no
> y=A*x0;
> end
> #+end_src
>
>
> And I obtain always:
> \begin{document}
>
> %% [removed source block]
> The basic idea is.
> That we do.
> We also will
>
> %% [removed source block]
> \end{document}
>


Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Joost Kremers



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

2018-11-29 Thread Gustavo Barros

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] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > On Thursday, 29 Nov 2018 at 12:38, Uwe Brauer wrote:
   >> Now org-babel-tangle works nicely, but when I try to export the org
   >> file to latex via org-export-dispatch

   > I think the default is
   > :exports results
   > so you what you want is either
   > :exports both
   > or
   > :exports code

Thanks, but I tried
#+begin_src matlab :tangle test.m  :export code   :wrap latex :padline no 
function [ll x]=mitest(A0,x0)
% initialization 
format long
epsi=1.e-3;
nit=0;
nmaxit=200;
Delta=10;
A=A0;
while Delta>epsi & nit

smime.p7s
Description: S/MIME cryptographic signature


[O] selective tangling?

2018-11-29 Thread John Kitchin
Are there any ways to selectively tangle blocks?

By that I mean suppose there are a dozen src blocks in a file, but I want
to selectively tangle only a few of them, selecting them by a tag, for
example, or some other property. These might have mixed languages, e.g. a
config files, a python script, and a makefile.

The use case here is I have an org document that I use to document a
simulation. The simulation has several config files, and a makefile, and
there is a python script that does analysis. I like to put all of these in
src blocks and then use a sh block to run the actual simulation command. I
usually put a :var a=(org-babel-tangle) header in the sh block, which makes
sure the files are tangled, and then runs the shell commands. But this
tangles all the files in the buffer, which is usually not what I want
(there are sometimes multiple simulations described in one file).  The
blocks are not always in one subtree, so it isn't a matter of just
narrowing, and they are mixed languages (text, make, python, etc.) and
target files so I can't just target one file.

The only mechanism for this i have come up with is to use
org-babel-map-src-blocks to run a check on each block to see if it matches
my tangle criteria and then run (org-babel-tangle t) on that block. This
seems to work fine, but I thought I would check if anyone else has a better
solution.


John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread 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.  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] org babel: %% [removed source block]

2018-11-29 Thread Eric S Fraga
On Thursday, 29 Nov 2018 at 12:38, Uwe Brauer wrote:
> Now org-babel-tangle works nicely, but when I try to export the org
> file to latex via org-export-dispatch

I think the default is
:exports results
so you what you want is either
:exports both
or
:exports code

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1034-gafcb1d



[O] org babel: %% [removed source block]

2018-11-29 Thread Uwe Brauer


Hi 

I have the following org file
#+BEGIN_SRC matlab :tangle test.m :padline no :results none
function [ll x]=mitest(A0,x0)
% initialization 
format long
epsi=1.e-3;
nit=0;
nmaxit=200;
Delta=10;
A=A0;
while Delta>epsi & nit

[O] Bug: Cannot create html file from org [9.1.9 (release_9.1.9-65-g5e4542 @ c:/programs/emacs-26.1-x86_64/share/emacs/26.1/lisp/org/)]

2018-11-29 Thread Helge Stenström




Remember to cover the basics, that is, what you expected to happen and

what in fact did happen.  You don't know how to make a good report?  See



 https://orgmode.org/manual/Feedback.html#Feedback



Your bug report will be posted to the Org mailing list.





I try to export org file to html, using C-c C-e h o

I get: defconst: Symbol's value as variable is void: css-mode-syntax-table

and no html file is produced.



Emacs  : GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)

of 2018-05-30

Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
c:/programs/emacs-26.1-x86_64/share/emacs/26.1/lisp/org/)



current state:

==

(setq

org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)

org-after-todo-state-change-hook '(org-clock-out-if-current)

org-metadown-hook '(org-babel-pop-to-session-maybe)

org-clock-out-hook '(org-clock-remove-empty-clock-drawer)

org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function

org-enforce-todo-dependencies t

org-odt-format-headline-function 'org-odt-format-headline-default-function

org-agenda-files '("c:/Users/erahege/OneDrive - Ericsson 
AB/sprints/R3AB/ENV/envPlan.org" "v:/diary 2018.org"

"c:/Users/erahege/OneDrive - Ericsson 
AB/sprints/R3AB/r3abPlan.org"

"c:/Users/erahege/Dropbox/org/tidplan.org")

org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default

org-plantuml-jar-path "~/plantuml.jar"

org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)

org-mode-hook '(#[0 "\300\301\302\303\304$\207"

   [add-hook change-major-mode-hook 
org-show-block-all append local] 5]

#[0 "\300\301\302\303\304$\207"

   [add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]

org-babel-result-hide-spec 
org-babel-hide-all-hashes)

org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]

org-archive-hook '(org-attach-archive-delete-maybe)

org-confirm-elisp-link-function 'yes-or-no-p

org-agenda-before-write-hook '(org-agenda-add-entry-text)

org-metaup-hook '(org-babel-load-in-session-maybe)

org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]

org-babel-pre-tangle-hook '(save-buffer)

org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)

org-babel-load-languages '((emacs-lisp . t) (plantuml . t))

org-export-backends '(ascii html md odt)

org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]

org-occur-hook '(org-first-headline-recenter)

org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines

  org-optimize-window-after-visibility-change)

org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)

org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function

org-confirm-shell-link-function 'yes-or-no-p

org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow 
org-rmail-open :store org-rmail-store-link)

   ("mhe" :follow org-mhe-open :store 
org-mhe-store-link)

   ("irc" :follow org-irc-visit :store 
org-irc-store-link)

   ("info" :follow org-info-open :export 
org-info-export :store org-info-store-link)

   ("gnus" :follow org-gnus-open :store 
org-gnus-store-link)

   ("docview" :follow org-docview-open 
:export org-docview-export :store

org-docview-store-link)

   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)

   ("bbdb" :follow org-bbdb-open :export 
org-bbdb-export :complete org-bbdb-complete-link

:store org-bbdb-store-link)

   ("w3m" :store org-w3m-store-link) 
("file+sys") ("file+emacs")

   ("doi" :follow org--open-doi-link) 
("elisp" :follow org--open-elisp-link)

   ("file" :complete org-file-complete-link)

   ("ftp" :follow (lambda (path) 
(browse-url (concat "ftp:" path

   ("help" :follow org--open-help-link)

   ("http" :follow (lambda (path) 
(browse-url (concat "http:" path

   ("https" :follow (lambda (path) 
(browse-url (concat "https:" path

 

Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Eric S Fraga
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] In LaTeX export, can I control what heading type a headline goes to?

2018-11-29 Thread Richard Lawrence
Hi Bill,

William Denton  writes:

> Is there a way, exporting as a book, to make Org skip "part" and make a 
> top-level Org headline turn into a chapter?  Is there a built-in way, or do I 
> need to make my own class in org-latex-classes that has the structure I want?

Another simple solution that doesn't require changing the default
configuration is: just don't use top level headlines in your document!
I don't think Org will care if your highest-level headlines start with "**".

That may or may not work for your particular situation, but it seems
like a good option to keep in mind!

-- 
Best,
Richard



Re: [O] Placement of \makeatletter with \beamer@frametextheight

2018-11-29 Thread Julius Dittmar
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

2018-11-29 Thread Julius Dittmar
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