Re: org beamer strange behaviour

2023-10-10 Thread Ihor Radchenko
Guillaume MULLER  writes:

> Running it, I got these "errors":
> 221 low   Unknown source block language: 'latex'
> 252 low   Unknown source block language: 'bibtex'
> 268 low   Unknown source block language: 'latex'
> 282 low   Unknown source block language: 'sh'
> 329 low   Unknown source block language: 'bibtex'
> 434 low   Unknown source block language: 'latex'
>
> ...which is very strange as I have the following lines in my config.org file:
>
>;; sh code in org-mode!
>(setq org-babel-sh-command "bash")
>(org-babel-do-load-languages
> 'org-babel-load-languages
> '((shell . t))) ; this line activates Bash
>
>;; LaTeX code in org-mode!
>(org-babel-do-load-languages
> 'org-babel-load-languages
> '((latex . t))) ; this line activates LaTeX

`org-babel-do-load-languages' also unloads everything not listed in the
second argument. So, your config first loads shell and then unloads it,
while loading latex. Possibly, you also have yet another call that will
load something else, unloading latex.

> I also define lstlisting "keywords" for bibtex in the header (taken from some 
> StackOverflow thread; removing it does not change anything):
>
> #+BEAMER_HEADER: \def\BibTeX{Bib\TeX{}}
> #+BEAMER_HEADER:\lstdefinelanguage{BibTeX}
> #+BEAMER_HEADER: {keywords={%
> #+BEAMER_HEADER:  
> @article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
> #+BEAMER_HEADER:  
> @inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
> #+BEAMER_HEADER:  
> @manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
> #+BEAMER_HEADER:  @proceedings,@standard,@string,@techreport,@unpublished%
> #+BEAMER_HEADER:  },
> #+BEAMER_HEADER:   comment=[l][\itshape]{@comment},
> #+BEAMER_HEADER:   sensitive=false,
> #+BEAMER_HEADER: }
>
> And org is supposed to use lstlisting to render the blocks (also in my 
> config.org):
> (after! org
>(setq org-latex-src-block-backend 'listings) ;; not always the best 
> choice, but prevent DoomEmacs to go Berzerck (ask file to save to everytime) 
> when using lstlistings-specific commands in org/beamer files
>;;(setq org-export-allow-bind-keywords 1) ;; allows binding of emacs/lisp 
> vars directly in .org files VERY INSECURE!!!
> )

Then, you can ignore this particular warning. Note that you will not be
able to execute "bibtex" blocks though - Org does not know how, which is
what the warning is about.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org beamer strange behaviour

2023-10-10 Thread Ihor Radchenko
Guillaume MULLER  writes:

> I'm writing a lot of my courses in Org with a final export to Beamer/PDF.
>
> Recently, I tried to improve the slides for a course I gave last year. When I 
> opened the org file, I got a very weird coloring, as if a section was not 
> closed correctly. You can find the org file and a screenshot of the rendering 
> here:
> https://seafile.emse.fr/d/f689a4318aff4e12a72e/
>
> What's VERY strange to me is that whatever (sub)sections of the org original 
> file I extract and yank/paste in another org file, then everything is OK...
>
> Any idea what could be wrong?

I cannot reproduce.
The screenshot looks like a problem with font-lock though.
You can try M-x font-lock-debug-fontify to check if there are errors.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org beamer strange behaviour

2023-10-10 Thread Fraga, Eric
I had a look at your file and it displays just fine on my system.
-- 
: Eric S Fraga, with org release_9.6.6-418-g294a4d in Emacs 30.0.50


Re: org beamer strange behaviour

2023-10-09 Thread Guillaume MULLER



On 10/9/23 17:09, Fraga, Eric wrote:

I haven't looked at your file but do consider running org-lint on the
file to see if it picks up anything.


Thanks! I didn't know about org-lint!!!

Running it, I got these "errors":
   221 low   Unknown source block language: 'latex'
   252 low   Unknown source block language: 'bibtex'
   268 low   Unknown source block language: 'latex'
   282 low   Unknown source block language: 'sh'
   329 low   Unknown source block language: 'bibtex'
   434 low   Unknown source block language: 'latex'

...which is very strange as I have the following lines in my config.org file:

  ;; sh code in org-mode!
  (setq org-babel-sh-command "bash")
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((shell . t))) ; this line activates Bash

  ;; LaTeX code in org-mode!
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((latex . t))) ; this line activates LaTeX


I also define lstlisting "keywords" for bibtex in the header (taken from some 
StackOverflow thread; removing it does not change anything):

#+BEAMER_HEADER: \def\BibTeX{Bib\TeX{}}
#+BEAMER_HEADER:\lstdefinelanguage{BibTeX}
#+BEAMER_HEADER: {keywords={%
#+BEAMER_HEADER:  
@article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
#+BEAMER_HEADER:  
@inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
#+BEAMER_HEADER:  
@manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
#+BEAMER_HEADER:  @proceedings,@standard,@string,@techreport,@unpublished%
#+BEAMER_HEADER:  },
#+BEAMER_HEADER:   comment=[l][\itshape]{@comment},
#+BEAMER_HEADER:   sensitive=false,
#+BEAMER_HEADER: }

And org is supposed to use lstlisting to render the blocks (also in my 
config.org):
(after! org
  (setq org-latex-src-block-backend 'listings) ;; not always the best choice, 
but prevent DoomEmacs to go Berzerck (ask file to save to everytime) when using 
lstlistings-specific commands in org/beamer files
  ;;(setq org-export-allow-bind-keywords 1) ;; allows binding of emacs/lisp 
vars directly in .org files VERY INSECURE!!!
)



--
Guillaume MULLER


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: org beamer strange behaviour

2023-10-09 Thread Fraga, Eric
I haven't looked at your file but do consider running org-lint on the
file to see if it picks up anything.

-- 
: Eric S Fraga, with org release_9.6.6-418-g294a4d in Emacs 30.0.50


org beamer strange behaviour

2023-10-09 Thread Guillaume MULLER

Hi,

I'm writing a lot of my courses in Org with a final export to Beamer/PDF.

Recently, I tried to improve the slides for a course I gave last year. When I 
opened the org file, I got a very weird coloring, as if a section was not 
closed correctly. You can find the org file and a screenshot of the rendering 
here:
https://seafile.emse.fr/d/f689a4318aff4e12a72e/

What's VERY strange to me is that whatever (sub)sections of the org original 
file I extract and yank/paste in another org file, then everything is OK...

Any idea what could be wrong?

--
Guillaume MULLER


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature