[O] Custom Org-Beamer Frame

2018-10-28 Thread Florian Adamsky
Hey,

I'm using org-mode 9.1.9 to prepare my slides. I'm using mtheme [1], a
modern LaTeX beamer theme. This theme supports frame footer, which is
sometimes handy if you would like to add a reference to a slide. In the
following, you will find an example use case:

,
| {%
| \setbeamertemplate{frame footer}{My custom footer}
| \begin{frame}[fragile]{Frame footer}
| Example
| \end{frame}
| }
`

I would like to archive this with org-mode with a special
environment. However, it seems that org-beamer-environments-extra only
works with headlines greater than org-beamer-frame-level. Is there any
other way to archive this? I would like to have something like this:

,
| * Section
| ** Frame
|   :PROPERTIES:
|   :BEAMER_env: footer
|   :BEAMER_envargs: My custom footer
|   :END:
|
|- Example
`

Thanks in advance!

Cheers

Links:
[1] https://github.com/matze/mtheme
--
Dr. Florian Adamsky
https://florian.adamsky.it/



[O] Confusion about org-refile-targets-verify-function

2016-02-04 Thread Florian Adamsky
Hey,

I'm using Emacs 24.5.1 and Org-mode 8.3.3 (15d591e) and try to filter
the output of my refile targets. For me, every headline that contains a
subtree with the name "tasks" is a project. Therefore, I would to filter
my refile targets to those which contains the name "tasks".

I use emacs -q and have the following configuration:

--8<---cut here---start->8---
(setq org-agenda-files (list "~/test.org" ))

(setq org-refile-targets '((org-agenda-files :maxlevel . 10)))

(setq org-refile-use-outline-path t)

(setq org-refile-target-verify-function (lambda ()
(string= (nth 4 (org-heading-components)) "tasks")))
--8<---cut here---end--->8---

The org-mode file test.org contains the following content:

--8<---cut here---start->8---
#+title: Test Org Mode
#+STARTUP: hidestars

* Foo
** tasks

* Bar
** Test
*** Fnord
 tasks
*** Bla
 tasks

* Fnord
** Nothing
--8<---cut here---end--->8---

The output from org-refile is:
  - tasks (test.org)
  - tasks/tasks (test.org)

I had expected that the output will be:
  - Foo/tasks
  - Bar/Test/Fnord/tasks
  - Bar/Test/Bla/tasks

What am I doing wrong? Thanks in advance!

Best regards
--
Florian Adamsky
http://florian.adamsky.it/



[O] Confusion about org-refile-targets-verify-function

2016-02-03 Thread Florian Adamsky
Hey,

I'm using Emacs 24.5.1 and Org-mode 8.3.3 (15d591e) and try to filter
the output of my refile targets. For me, every headline that contains a
subtree with the name "tasks" is a project. Therefore, I would to filter
my refile targets to those which contains the name "tasks".

I use emacs -q and have the following configuration:

--8<---cut here---start->8---
(setq org-agenda-files (list "~/test.org" ))

(setq org-refile-targets '((org-agenda-files :maxlevel . 10)))

(setq org-refile-use-outline-path t)

(setq org-refile-target-verify-function (lambda ()
(string= (nth 4 (org-heading-components)) "tasks")))
--8<---cut here---end--->8---

The org-mode file test.org contains the following content:

--8<---cut here---start->8---
#+title: Test Org Mode
#+STARTUP: hidestars

* Foo
** tasks

* Bar
** Test
*** Fnord
 tasks
*** Bla
 tasks

* Fnord
** Nothing
--8<---cut here---end--->8---

The output from org-refile is:
  - tasks (test.org)
  - tasks/tasks (test.org)

I had expected that the output will be:
  - Foo/tasks
  - Bar/Test/Fnord/tasks
  - Bar/Test/Bla/tasks

What am I doing wrong? Thanks in advance!

Best regards
--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Florian Adamsky
Dear Eric,

On Tuesday, Aug 05 2014, Eric Abrahamsen e...@ericabrahamsen.net wrote:

 Thanks for this work -- I think this is a nice feature. One concern
 about the above is that, if you're archiving many FOOs, then you'll get
 a whole bunch of duplicate A/B parent structures. There are several
 places in my agenda files where I have the exact structure in your
 example, and a *whole* lot of FOOs going in and getting archived out.
 How hard would it be to look for an existing A/B parent structure in the
 archive file, and put FOO there if it's found? Not a perfect solution,
 since you might have more than one A/B, but seems like it would help in
 a majority of cases...

if I understand you correctly, then I have already implemented that. If
I would like to archive *** Foo, the function (fa/org-struct-subtree)
returns the parent headings as a list, e.g. (*A  ** B). Inside the
archive file, I search for * A and inside that heading I search for
** B. If ** B was not found, it inserts the remaining list that was
not found and does not create a new * A again. This means if you have
*A  and ** B already in your archive file it will not add a new A/B.

A problem exists if you have the exact same structure twice in one file like
the following example:

* A
** B
*** FOO

* A
** B
*** FOO

If you would archive both *** FOO, then the archive file would look like
this:

* A
** B
*** FOO
*** FOO

In order to fix that problem we need a unique id for every heading. My
current implementation implies that at least the first heading is
unique. Then it should not be a problem.

Best regards
--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Florian Adamsky
Dear Ken,

On Tuesday, Aug 05 2014, Ken Mankoff wrote:

 This code looks useful and an improvement over the previous setup I was
 using. https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01218.html

 Can you explain what else is needed for your code to work? Currently I
 have

at the moment, I just run the function org-archive-subtree-hierarchical
interactively.

 #+BEGIN_SRC emacs-lisp
 (setq org-archive-location (concat org-directory /archive/%s_archive::))
 #+END_SRC

 But I don't see things archived as subtrees with just this. Do I need
 new/different configuration to work with your code?

No, just run M-x org-archive-subtree-hierarchical. I tried the code with
the latest org-mode version 8.3beta and with emacs -q and in both cases
it works without problems.

However, if you set the following variable to the new function, it
should work with the default keybinding for org-archive:

#+BEGIN_SRC emacs-lisp
(setq org-archive-default-command 'org-archive-subtree-hierarchical)
#+END_SRC

If you have any trouble, please give me a note.

Best
--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Florian Adamsky
Dear Ken,

On Tuesday, Aug 05 2014, Ken Mankoff mank...@gmail.com wrote:

 You are correct that M-x org-archive-subtree-hierarchical works just
 fine. But I can't get it to work with the default keybinding as you show
 above.

 C-c C-x C-s is my (the?) default keybinding for archiving
 trees/subtrees.  Is this the correct keybinding?

according to the documentation the default keybinding to archive the
current entry is C-c C-x C-a. Could you try that instead?

[...]

Best
--
Florian Adamsky
http://florian.adamsky.it/



[O] Archive subtrees hierarchical (keep the parent structure)

2014-08-04 Thread Florian Adamsky
Dear all,

some of my org-mode files are getting bigger and bigger. So, I decided
to use the archive feature to remove old stuff. However, I was not happy
with the current archive feature, because it just puts subtrees
unorganized in the archive file.

I was more looking for a way to archive a subtree, but keep the parent
structure. Means, if the point is at the subtree *** FOO in the
following example:

* A
** B
*** FOO

then it should copy the heading * A and ** B to the archive file and
then move *** Foo to it. The only thing that I found was a feature
request from Florian Lindner [fn:1]. A couple of days I was given it a
shot and tried to implement that myself. Attached you'll find my
attempt.

It is a bit hackish, but it works for me. I think the attached code
misses two features:
  1. it only copies the parent headings with tags, but ignores
  properties and stuff like that

  2. it ignores org-reverse-note-order, but that should not be too hard
  to add.

Before I work on it again, I would like to hear your comments. Have I
implemented functions that are already in org-mode? Is this feature
useful for other people? Does it in more complicated org-mode files?

Best regards

Footnotes:

[fn:1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01214.html
--
Florian Adamsky
http://florian.adamsky.it/




org-archive-subtree-hierarchical.el
Description: application/emacs-lisp


[O] Remove empty rows in a org-table

2013-10-27 Thread Florian Adamsky
Dear org-mode hackers,

in a org-mode file I copy various information to a org-table. Sometimes
there are empty rows in that org-table which I don't like. Therefore I
wrote a little function that removes empty rows from a org-mode table.

Maybe this is of any for org-mode or for other people. I would like to
hear of any improvements or better ways to do this. Maybe this already
exists in org-mode somewhere? :-)

#+BEGIN_SRC emacs-lisp
(defun fa/org-table-remove-empty-rows ()
  Removes empty rows in a org-mode table.
  (interactive)
  (save-excursion
(unless (org-table-p)
  (error
   You are not in an org-table.))
(goto-char (org-table-begin))
(let ((tbl-list (org-table-to-lisp)))
  (while
  (let ((row-list (car tbl-list)))
(cond ((and
(listp row-list)
(equal row-list (make-list (length row-list)
   (string
   (kill-line)
   (kill-line))
  (t (next-line)))
(setq tbl-list (cdr tbl-list)))
#+END_SRC

This functions does the following:

|--+--+-||--+--+-|
| test |  foo | bar || test |  foo | bar |
|--+--+-||--+--+-|
|1 |2 |   3 ||1 |2 |   3 |
|  |  | ||4 |  |   6 |
|4 |  |   6 |  --   |  | test | bla |
|  |  | ||--+--+-|
|  | test | bla ||  |2 |   4 |
|--+--+-||--+--+-|
|  |  | |
|  |2 |   4 |
|--+--+-|

--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Repeating the customization survey?

2013-10-24 Thread Florian Adamsky
Dear Carsten,

Carsten Dominik writes:

 in 2009, we ran a customization survey, to figure out which variables are 
 actually used by active Org-mode users.  The results can be seen here:

http://orgmode.org/worg/org-configs/org-customization-survey.html

[...]

 Any takers?

I would like to help. I'm not regular contributor to org-mode, so this
means I don't have deep knowledge of the internal structure of
org-mode. However, maybe this helps me to bootstrap myself into the
project. Would you be so kind to tell me the name of the function that
lists all the changed variables. Then I can play a little bit with that
and see which additional information may be useful.

Best regards
--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] A t-shirt idea;)

2013-03-27 Thread Florian Adamsky
On Wed, 27 Mar 2013 16:54:32 -0500 John Hendy wrote:

  Hi Marcin,
 
  I would buy one;)
 
  Thanks!
 
  I'm not a graphic designer, but... why not try to make one?  Does
  anyone know where to go once you have a .jpg or something with the
  design?
 
 If you do, I want some sort of Borg-ish bio-mechanical thing over one
 of the Unicorn's eyes :) Just my vote...

Shut up and take my money! :-)

-- 
Florian Adamsky
http://florian.adamsky.it/



[O] Macro expansion to control beamer template

2013-03-21 Thread Florian Adamsky
Hello,

at the moment I revise my course lectures and of course I use org-mode
for that. I was searching for an easy way to create fullframe. After
searching a bit in the mailing list, I found out that the 8.0-pre with
its new beamer exporter already has this functionality. Therefore I
switch to the current git-version. Wonderful work by the way! 

I created a beamer template file that I control with macros. My
org-mode config file has the following snippet:

(add-to-list 'org-latex-classes
(list beamer 
  (file-string (concat custom-basedir templates/beamer.tex)) 
  '(\\section{%s} .\\section*{%s}) 
  '(\\subsection{%s} . \\subsection*{%s})
  '(\\subsubsection{%s} . \\subsubsection*{%s})))


The beamer.tex file contains snippets like that:

\documentclass[xetex,aspectratio={{{BEAMERRATIO}}}]{beamer}

[...]

\newcommand{\myEmail}{\urlEMAIL}
\newcommand{\myUrl}{\urlURL}
\newcommand{\myShortConf}SHORTCONF
\newcommand{\myLongConf}LONGCONF

This does not work anymore. After searching a bit in the ml archive I
have read that the macro is not as powerful as before. The macro works
only in the org file and not in my template file. What is the best way
to work around this problem?

Thanks in Advance.

Best
-- 
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Macro expansion to control beamer template

2013-03-21 Thread Florian Adamsky
Dear Sebastien,

On Thu, 21 Mar 2013 22:10:26 +0100 Sebastien Vauban wrote:

  I created a beamer template file that I control with macros. My
  org-mode config file has the following snippet:
 
  (add-to-list 'org-latex-classes
  (list beamer 
(file-string (concat custom-basedir templates/beamer.tex)) 
'(\\section{%s} .\\section*{%s}) 
'(\\subsection{%s} . \\subsection*{%s})
'(\\subsubsection{%s} . \\subsubsection*{%s})))
 
 
  The beamer.tex file contains snippets like that:
 
  \documentclass[xetex,aspectratio={{{BEAMERRATIO}}}]{beamer}
 
  [...]
 
  \newcommand{\myEmail}{\urlEMAIL}
  \newcommand{\myUrl}{\urlURL}
  \newcommand{\myShortConf}SHORTCONF
  \newcommand{\myLongConf}LONGCONF
 
  This does not work anymore. After searching a bit in the ml archive
  I have read that the macro is not as powerful as before. The macro
  works only in the org file and not in my template file. What is the
  best way to work around this problem?
 
 Would an INCLUDE in the Org file do the work for you?
 
 Would you agree with such a solution (having to explicitly put one
 extra line in all your Org Beamer files)?

Good idea! I think I can live with one addition line, when I will
customize org-beamer-insert-options-template :) I'll give it a try
tomorrow.

Thanks for the tip!

Best
-- 
Florian Adamsky
http://florian.adamsky.it/



[O] Org-mode Talk in German

2013-02-23 Thread Florian Adamsky
Hello,

mid last year, I held a talk about Emacs Org-mode at a small hacker
conference in Germany called Gulaschprogrammiernacht (GPN12) with the
title Emacs Org-mode - der hackbare Notizblock in Plaintext (engl.
the hackable notepad in plain text).

The organization of this event recorded my talk and uploaded it to
YouTube [1]. Maybe this is a talk which can be added to the
org-mode talks page. My slides are also online [2] if anyone is
interested.

[1] https://www.youtube.com/watch?v=mUSoo4UaKBo
[2]
http://florian.adamsky.it/research/talks/gpn12/GPN12-Emacs-Org-mode.pdf
-- 
Florian Adamsky
http://florian.adamsky.it/



[O] Include single values from a org-table into a code-block

2012-12-14 Thread Florian Adamsky
Hello,

at the moment I'm drafting a paper and I would like to insert values
from a org-table into a code-block. After searching a bit a found a mail
thread from 2010 [1] which says I have to do the following:

src_emacs-lisp[:var d=test-table[3,1]]{d}

This works fine but only in non code-blocks. But I want to insert these
values in a LaTeX block, since I want to generate a pgfplot. Is there
another way to get values from a org-table? Or is it possible to combine
the above code with a Macro? In the following you'll find an example:

#+Begin_LaTeX
\begin{tikzpicture}
%% pgfplot code
\addplot coordinates {(0, src_emacs-lisp[:var d=test-table[3,1]]{d})};
\end{tikzpicture}
#+End_LaTeX

Thanks in advance.

Best,
Florian 

[1]
http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01104.html



[O] Talk about Org mode at a small hacker conference (GPN12)

2012-06-02 Thread Florian Adamsky
Hello,

I will give a talk [fn:1] next weekend about Org mode at a small hacker
conference in Germany: Gulaschprogrammiernacht 2012 [fn:2]. There will
be around 300 people and I hope I can awake enthusiasm for Org mode. My
talk will be recorded and I once I finished my slides I will put them on
my web page. Just for your information. If somebody by chance is also
there, I would love to drink a beer with you :-).

Best regards,
Florian

[fn:1] https://entropia.de/GPN12:Emacs_Org-mode
[fn:2] https://entropia.de/GPN
--
Florian Adamsky
http://florian.adamsky.it/



Re: [O] Talk about Org mode at a small hacker conference (GPN12)

2012-06-02 Thread Florian Adamsky
Dear Thorsten,

Thorsten Jolitz tjol...@googlemail.com writes:

 Florian Adamsky fa-orgm...@haktar.org writes:

 I will give a talk [fn:1] next weekend about Org mode at a small hacker
 conference in Germany

 Karlsruhe is too far away for me, unfortunately. However, I'm really
 impressed by the beautiful design of your homepage:

 ,-
 |  http://florian.adamsky.it/
 | 
 | About this site
 | 
 | I created this site with Emacs, org-mode, Git and Jekyll. I used this
 | wunderful clean design from Steve Losh and modified it a little bit. All
 | kudos belong to him.
 `-

 I visited the homepage of Steve Losh and his Mercurial repository for
 the page. Since I want to build an Org mode based homepage too, I would
 really like to 'steal' this design. Do you mind to share how you combined
 Steve Losh's design with Org mode, Git and Jekyll? Is there a public
 repo of your sites code?

Sorry, but I have to disappoint you, the integration with Org mode is
simple and not very sophisticated. I just use Org mode to write my blog
posts and then to export it to HTML. After that, I put the exported HTML
file in the _posts/ directory and commit a new stage via git. My server
automatically pulls every 30 min the repository and runs the jekyll
parser after that.

The blog post file is a simple HTML file with the a small header like
the following:

---
layout: post
title: Lorem ipsum
---

In fact nothing really special. However, if you're still interested, I
can send you my repository.

Best regards
-- 
Florian Adamsky
http://florian.adamsky.it/



[O] [PATCH] org.el: Added a new interactive function which inserts a code block

2012-05-08 Thread Florian Adamsky
Hello,

I do not always use code blocks in org-mode, but when I do, I have
forgotten the syntax :-). In order to prevent that situation I wrote a
little function which is similar to org-insert-link. I called that
function org-insert-code-block. This function reads the language per
minibuffer in and supports completion. It only allows languages which
are loaded via org-babel-load-languages.

Is this function also useful to others? I'm not a long-time Emacs lisp
hacker, so any comment is welcome. Has anyone an idea for a reasonable
keybinding for org-insert-code-block which is not already taken by
org-mode?

Thanks in advance.

Best regards,
Florian diff --git a/lisp/org.el b/lisp/org.el
index 66f9c3e..19e91c0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9145,6 +9145,21 @@ a link description or nil.
 	[[ (car link) ]])))
 
 ;;;###autoload
+(defun org-insert-code-block ()
+  Insert a code block. At the prompt, enter the language which is available.
+
+Completion can be used to insert any language which is loaded in
+org-babel-load-lanuages.
+  (interactive)
+  (setq language (completing-read
+   Code block : 
+   (mapcar 'symbol-name
+   (mapcar 'car org-babel-load-languages))
+   nil nil))
+  (insert (concat #+BEGIN_SRC  language \n\n))
+  (insert #+END_SRC)
+  (previous-line))
+
 (defun org-insert-link-global ()
   Insert a link like Org-mode does.
 This command can be called in any mode to insert a link in Org-mode syntax.