Re: [O] How to do proper folding and semantic markup

2016-03-31 Thread Eduardo Mercovich
Hi Christian. 

>> ... place the abstract and #+LATEX: commands for frontmatter before the
>> first exported headline, e.g.,
>> #+BEGIN_abstract
>>   [Abstract here]
>> #+END_abstract

> Originally my fault for pointing out that this was possible (for latex
> and html backends, anyway) without any special abstract handling. :-)
> https://lists.gnu.org/archive/html/emacs-orgmode/2010-11/msg00046.html

No fault at all, on the contrary. This collective knowledge is built by
everyone that participates. :)

> [...] If these matter to you (I gather that you have to write long
> abstracts), you may need to use the ignore trick Thomas Dye referred
> to.

I'll do, as that solution has the best of both worlds. :)

> You can name a block and reference it by name.
> #+name: theabstract
> #+begin_abstract
>   ...
> #+end_abstract
> See [[theabstract][the abstract]].

This linking capacity is great and I'm using it a lot.

The only detail remaining here that I'm still searching is how to
include the table/figure # also with the link. This is because if
someone prints the report, the link becomes unusable without a number.

An example would be:

--8<---cut here---start->8---
Lorem ipsum... 

#+CAPTION: A beautiful caption for this table. 
#+NAME: table:tablename
#+ATTR_LATEX: :environment longtable
[the table]

A lot of text, going pages long.

In this paragraph, there is a [[tablename][link to the table]]. 
--8<---cut here---end--->8---

This renders the link perfectly, but in the linked text  there is no further reference. How can the (automagically added)
number be included, like in .

I'm sure it's there but even having read the manual I still lack the
emacspeak to find it, or maybe to understand that I already read over
it. :)

Anyway, Have a great day... 


-- 
eduardo mercovich 

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación.



Re: [O] How to do proper folding and semantic markup

2016-03-31 Thread Eduardo Mercovich
Aloha Tom. 

>> I'm using org-mode as a writer and it is simply fantastic. One of the
>> things I enjoy more is the folding. [...]
>> However, I don't know how to integrate that with some semantic markup
>> and the latex exporter at the same time (BTW, org+latex=awesomness!).
>> I'll use the abstract as example, but the same idea is valid for other
>> semantic markup like front, main and backmatter. [...]

> You might find Aaron Ecay's ox-extra.el in contrib useful.  It defines
> an :ignore: tag that instructs the exporter to ignore the headline it
> tags, but still export the text, etc. under the headline.
> ,
> | * Abstract :ignore:
> |
> | #+begin_abstract   
> | The abstract ...   
> | #+end_abstract 
> |
> | * Chapter 1
> `
>
> will give you an abstract before Chapter 1 and you'll still be able to
> fold it out of the way when you don't want to see it.

That's exactly what I've been searching for.

Thank you! :D

Best...


-- 
eduardo mercovich 

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación.



Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-03-31 Thread Myles English

Hi Rasmus,

Thanks for looking at this again.

Rasmus Pank Roulund writes:

> Myles,
>
> Is :with-location something you feel strongly about?  I'm not sure I find
> that it makes sense...
>
> I would like to apply the following patch on top of yours.

I think that's alright.

Just to recap: I use the "location" field, intended as a general purpose
extension field, for bank details.  Those details shouldn't be in every
letter I write and I don't want to have to enter those details every
time they are used.  For those reasons I put the bank details in
variable in a LCO file and toggle the inclusion by setting the
:LOCATION: (or :EXPORT_LOCATION) property like this:

:EXPORT_LOCATION: \usekomavar{frombank}

As long as I can still do that I don't
mind.

Myles



Re: [O] [PATCH 1/3] add id attribute to example-block on html export.

2016-03-31 Thread John Kitchin
I am not sure what those should look like or where they go. How about:

* New html id attributes on special, example and quote blocks
 If the block has a #+name: attribute assigned, then the html element
 will have an id attribute with that name in the html export. This
 enables one to create links to these elements in other places,
 e.g. text


Nicolas Goaziou writes:

> Hello,
>
> John Kitchin  writes:
>
>> This allows you to hyperlink to the block.
>
> Applied the 3 patches, with minor changes (you seem to be using an
> outdated Org so you were reverting changes made to master).
>
> Could you provide an ORG-NEWS entry for this?
>
> Thank you.
>
> Regards,


--
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] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-03-31 Thread Rasmus Pank Roulund
Myles,

Is :with-location something you feel strongly about?  I'm not sure I find
that it makes sense...

I would like to apply the following patch on top of yours.

Thanks,
Rasmus

-- 
I almost cut my hair, it happened just the other day
>From 43a26688870f6861747a1d333a5844348d3a1749 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Tue, 29 Mar 2016 18:08:09 +0200
Subject: [PATCH 1/2] ox-koma-letter: Changes to LOCATION handling

* ox-koma-letter.el (options): Parse LOCATION and remove
  :with-location and :inbuffer-with-location.
  (org-koma-letter--get-tagged-contents): Change string handling.
  (org-koma-letter--get-value): Simplify function.
  (org-koma-letter-use-location): remove
---
 contrib/lisp/ox-koma-letter.el | 63 --
 1 file changed, 24 insertions(+), 39 deletions(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index d36e817..a76033d 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -376,13 +376,6 @@ This option can also be set with the OPTIONS keyword, e.g.:
   :group 'org-export-koma-letter
   :type 'boolean)
 
-(defcustom org-koma-letter-use-location t
-  "Non-nil prints the contents of the letter's extension below the header.
-This option can also be set with the OPTIONS keyword, e.g.:
-\"location:nil\"."
-  :group 'org-export-koma-letter
-  :type 'boolean)
-
 (defcustom org-koma-letter-default-class "default-koma-letter"
   "Default class for `org-koma-letter'.
 The value must be a member of `org-latex-classes'."
@@ -436,7 +429,7 @@ e.g. \"title-subject:t\"."
 (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t)
 (:to-address "TO_ADDRESS" nil nil newline)
 (:place "PLACE" nil org-koma-letter-place)
-(:location "LOCATION" nil org-koma-letter-location)
+(:location "LOCATION" nil org-koma-letter-location parse)
 (:subject "SUBJECT" nil nil parse)
 (:opening "OPENING" nil org-koma-letter-opening parse)
 (:closing "CLOSING" nil org-koma-letter-closing parse)
@@ -453,7 +446,6 @@ e.g. \"title-subject:t\"."
 (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
 (:with-phone nil "phone" org-koma-letter-use-phone)
 (:with-place nil "place" org-koma-letter-use-place)
-(:with-location nil "location" org-koma-letter-use-location)
 (:with-subject nil "subject" org-koma-letter-subject-format)
 (:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
 (:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
@@ -472,7 +464,6 @@ e.g. \"title-subject:t\"."
 (:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
 (:inbuffer-with-phone nil "phone" 'koma-letter:empty)
 (:inbuffer-with-place nil "place" 'koma-letter:empty)
-(:inbuffer-with-location nil "location" 'koma-letter:empty))
   :translate-alist '((export-block . org-koma-letter-export-block)
 		 (export-snippet . org-koma-letter-export-snippet)
 		 (headline . org-koma-letter-headline)
@@ -767,42 +758,36 @@ a communication channel."
   (format "\\KOMAoption{fromphone}{%s}\n"
   (if (plist-get info :with-phone) "true" "false")))
  ;; Signature.
- (let* ((head-opening (plist-get info :with-headline-opening))
-	(signature (funcall heading-or-key-value
-(if head-opening 'closing nil)
-:signature
-(if head-opening 'signature nil
-   (and signature
-	(format "\\setkomavar{signature}{%s}\n" signature)))
+ (let* ((heading-val
+	 (and (plist-get info :with-headline-opening)
+		  (org-string-nw-p
+		   (org-trim
+		(org-export-data
+		 (org-koma-letter--get-tagged-contents 'closing)
+		 info)
+	(signature (org-string-nw-p (plist-get info :signature)))
+	(signature-scope (funcall check-scope 'signature)))
+   (and (or (and signature signature-scope)
+		heading-val)
+	(not (and (eq scope 'global) heading-val))
+	(format "\\setkomavar{signature}{%s}\n"
+		(if signature-scope signature heading-val
  ;; Back address.
  (and (funcall check-scope 'with-backaddress)
   (format "\\KOMAoption{backaddress}{%s}\n"
   (if (plist-get info :with-backaddress) "true" "false")))
  ;; Place.
- (let ((place-scoped (funcall check-scope 'with-place))
+ (let ((with-place-set (funcall check-scope 'with-place))
 	   (place-set (funcall check-scope 'place)))
-   (when (or (and place-scoped place-set)
-		 (and (eq scope 'buffer)
-		  (or place-scoped place-set)))
-	 (format "\\setkomavar{place}{%s}\n"
-		 (if (plist-get info :with-place) (plist-get info :place)
-		   ""
+   (and (or (and with-place-set place-set)
+		(and (eq scope 'buffer) (or with-place-set place-set)))
+	(format "\\setkomavar{place}{%s}\n"
+		(if (plist-get info :with-place) (plist-get info :place)
+		  ""
  ;; Location.
- (let ((heading-val
-	

Re: [O] Feature Request: Time Line in Lab Book

2016-03-31 Thread John Hendy
On Thu, Mar 31, 2016 at 3:12 AM, Dominik Schrempf
 wrote:
> Hello,
>

[snip]

> A possible example:
>
> * February 2016
> February 10th: Some text and stuff in February 2016.
>
> ** TODO A task to be done. Filed on February 10th.
>E.g., February 24th: Some text that should belong to the task only.
>I could not work on this task before February 18th.
>
> February 18th: Some more text belonging to February 2016 and not to the
> task.
>
> * March 2016

Like Eric, I'm a little confused of what you would want instead. The
above is great for what currently happens, but could you do a similar
example of what you want? You ask if this "feature" exists, but I'm
not sure what it would be... all I can envision as a modification to
above is:

* Feb 2016

Feb 10th: blah blah blah notes

Feb 18th: blah blah notes

** TODO filed feb 10th, but *done* on 2/24

> And so on.  Maybe this feature does already exist, but I am not aware of
> it.  I know that especially upon export, this is hard to realize,
> because all text always belongs to the previous headline.  But maybe it
> is worth thinking about it because at least to me this would be highly
> useful (e.g., having different styles in HTML export for the text under
> the task and the text of the top level, the time line).

I've wrestled with this a lot myself, at least if I put this in the
bucket of "what's the *best* way to organize an org file." To expand
on Nick's comments, something can only be in one hierarchy at a time,
and everything afterward will live in that parent/child, unless you
start a new sibling. The downside is you can't "escape" a current
sub-heading to return to "just the parent heading" again. I've not
quite wrestled with that, but moreso the desire to have one thing live
in several places at the same time. I posted some structure questions
when I migrated from TiddlyWiki in 2010; you could take a look at
these threads if you're interested:
- https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00390.html
- http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg01173.html

If your example is accurate, why not make everything it's own
headline? The notes from 2/18 wouldn't, then, "belong" to the todo
filed on 2/10 and completed on 2/24. You'd just have:

** Feb 10
blah blah
** TODO Feb 10 something
Notes about task
** Feb 18
blah blah

It seems the core of your issue is not being certain on whether or not
you want the TODO to be represented in the date tree according to
creation or completion. That, or you don't like that you have to
decouple the todo itself and your notes about it, which would lead to
separate entries, one for the todo on 2/10 and one for the notes about
what you did to complete it on 2/24. Are any of those accurate? I
think clarification would be helpful if I've missed what you're
wrestling with.

I've taken to a pure datetree for notes, with inline todos for
anything that comes up in the context of something else (and which I
want to keep in that context). So:

* Meeting about blah  :tag:
 [2016-03-31 Thu]

Notes here about thing

* TODO some task

Notes I did about this todo
* END

Otherwise, I have a separate tree just for tasks where I don't care if
they're decoupled from their context. It's just a headline called
"Tasks" which is my dumping ground for todos. My actual org file looks
like this:

* Tasks
** todo something 1
** todo something 2

* Journals
** 2016 March
*** Something
[2016-03-31 Thu]

Notes

*** Something else
[2016-03-30 Wed]

Blah

For the tasks, I often just delete them as I don't care, but for ones
where I've noted progress about them, I use C-c C-x A to archive them
in a subtree of "Tasks." Then I could search for the info in them down
the road if I want. I've also started just adding time stamps and
updates to other month's headlines if the activity is a continuation
of when it started. So maybe:

* Journals
** 2016 Feb
*** Experiment for projA
[2016-02-10 Wed]

Set up this experiment today...

[2016-03-02 Wed]
Ran a modified version of this experiment today... (and so on)

Hope that helps a little... I love thinking about org file strategies,
so please keep the thoughts coming if you'd like to discuss more!

John

>
> Thanks and best wishes,
> Dominik
>



Re: [O] problem with ob-octave (matlab)

2016-03-31 Thread John Kitchin
sometimes setting :results to raw or code can help.

I occasionally have trouble when the results get interpreted as cons
cells, and maybe some other things too (in other languages but i think
it a general problem.)

Uwe Brauer writes:

> Hello
>
> I can successfully execute
>
>
> #+BEGIN_SRC matlab
> A=[3 4; 5 6]
> b=[5;6]
> A\b
> #+END_SRC
>
> #+RESULTS:
> |  -3 |
> | 3.5 |
>
> However
> #+BEGIN_SRC matlab
> syms a b
> A=[a,b;b,a]
> eig(A)
> #+END_SRC
>
>
> Does not work
>
> I obtain
>
> executing Matlab code block...
> Wrote /tmp/babel-2948rpV/ob-input-2948ACJ
> Error reading results: (beginning-of-buffer)
> Code block produced no output.
>
>
> However the code can be executed in matlab giving
>
>
> ans =
>
>  a + b
>  a - b
>
>
> Any comments?
>
> Thanks
>
> Uwe Brauer


--
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



[O] problem with ob-octave (matlab)

2016-03-31 Thread Uwe Brauer
Hello

I can successfully execute


#+BEGIN_SRC matlab
A=[3 4; 5 6]
b=[5;6]
A\b
#+END_SRC

#+RESULTS:
|  -3 |
| 3.5 |

However 
#+BEGIN_SRC matlab
syms a b
A=[a,b;b,a]
eig(A) 
#+END_SRC


Does not work

I obtain

executing Matlab code block...
Wrote /tmp/babel-2948rpV/ob-input-2948ACJ
Error reading results: (beginning-of-buffer)
Code block produced no output.


However the code can be executed in matlab giving


ans =
 
 a + b
 a - b


Any comments?

Thanks

Uwe Brauer 




Re: [O] Feature Request: Time Line in Lab Book

2016-03-31 Thread Nick Dokos
Dominik Schrempf  writes:


> I want to write a lab book with Org mode.  Thereby my workflow is as
> follows: New stuff is appended to the bottom of the document (with time
> stamps in chronological order).  Sometimes, especially when I discuss
> something in a meeting, tasks pop up that can only be done later.  These
> tasks are filed into TODO entries.  However, new stuff is being appended
> to the end of the document before I can come back to getting these tasks
> done.  When I work on a task, I document it below this task and do not
> append it to the bottom of the document.  This new stuff should belong
> to that task and not to the top level (i.e., the time line).  New stuff
> belonging to the time line should belong to the top level and not to any
> task above it.  I want to fold tasks together with text belonging to
> them while the time line is still visible below them.  I am not sure if
> I make myself clear.
>

As Erik F. points out, a datetree capture is the way to go but...

> A possible example:
>
> * February 2016
> February 10th: Some text and stuff in February 2016.
>
> ** TODO A task to be done. Filed on February 10th.
>E.g., February 24th: Some text that should belong to the task only.
>I could not work on this task before February 18th.
>
> February 18th: Some more text belonging to February 2016 and not to the
> task.
>
> * March 2016
>
> And so on.  Maybe this feature does already exist, but I am not aware of
> it.  I know that especially upon export, this is hard to realize,
> because all text always belongs to the previous headline.  But maybe it
> is worth thinking about it because at least to me this would be highly
> useful (e.g., having different styles in HTML export for the text under
> the task and the text of the top level, the time line).
>

Exactly. If tasks are implemented as second level headlines, then you
cannot do this: an org document is a tree and the second level subtree
is done only when the next headline (at whatever level) is
encountered. So the "Some more text..." will *not* belong to February
2016; it will belong to the task.

Maybe inline tasks can be used (but I have never used them, so I hope
somebody else chimes in).

-- 
Nick




Re: [O] Feature Request: Time Line in Lab Book

2016-03-31 Thread Dominik Schrempf
Hi Eric,

thanks for your answer.  I guess drawers in general are the solution to
my problems because then I can associate text to a specific headline.  I
introduced a DESCRIPTION drawer that includes the description of my
problem/task and I log the solution or outcome into the LOGBOOK drawer
when setting the state to DONE.  The drawer names are of course
arbitrary.  I also tried to use a single LOGBOOK drawer but Org mode
always adds notes at the top in the respective drawer.  I guess this is
fine in general but not expected behavior in this setting, that's why I
use two of them.

Thanks,
Dominik

On Thu, Mar 31 2016, Eric S Fraga wrote:
> Hi Dominik,
>
> it's not entirely clear what you want but I can suggest what I do.  I
> use the following capture rule to add entries to my journal (equivalent
> to your lab book):
>
> #+begin_src emacs-lisp
>   ("j" "journal" entry
>(file+datetree+prompt "~/s/notes/journal.org")
>"* %(format-time-string \"%H:%M\") %^{Entry} %^G\n%i%?")
> #+end_src 
>
> You could have two such capture rules, one for notes and one for TODO
> items.  To add notes to the TODO items, you could use the logging
> capability so that org prompts for a note every time a TODO item changes
> state.  Have a look at org-log-state-notes-into-drawer.



Re: [O] Feature Request: Time Line in Lab Book

2016-03-31 Thread Eric S Fraga
Hi Dominik,

it's not entirely clear what you want but I can suggest what I do.  I
use the following capture rule to add entries to my journal (equivalent
to your lab book):

#+begin_src emacs-lisp
  ("j" "journal" entry
   (file+datetree+prompt "~/s/notes/journal.org")
   "* %(format-time-string \"%H:%M\") %^{Entry} %^G\n%i%?")
#+end_src 

You could have two such capture rules, one for notes and one for TODO
items.  To add notes to the TODO items, you could use the logging
capability so that org prompts for a note every time a TODO item changes
state.  Have a look at org-log-state-notes-into-drawer.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-668-g809a83



[O] Feature Request: Time Line in Lab Book

2016-03-31 Thread Dominik Schrempf
Hello,

I want to write a lab book with Org mode.  Thereby my workflow is as
follows: New stuff is appended to the bottom of the document (with time
stamps in chronological order).  Sometimes, especially when I discuss
something in a meeting, tasks pop up that can only be done later.  These
tasks are filed into TODO entries.  However, new stuff is being appended
to the end of the document before I can come back to getting these tasks
done.  When I work on a task, I document it below this task and do not
append it to the bottom of the document.  This new stuff should belong
to that task and not to the top level (i.e., the time line).  New stuff
belonging to the time line should belong to the top level and not to any
task above it.  I want to fold tasks together with text belonging to
them while the time line is still visible below them.  I am not sure if
I make myself clear.

A possible example:

* February 2016
February 10th: Some text and stuff in February 2016.

** TODO A task to be done. Filed on February 10th.
   E.g., February 24th: Some text that should belong to the task only.
   I could not work on this task before February 18th.
   
February 18th: Some more text belonging to February 2016 and not to the
task.

* March 2016

And so on.  Maybe this feature does already exist, but I am not aware of
it.  I know that especially upon export, this is hard to realize,
because all text always belongs to the previous headline.  But maybe it
is worth thinking about it because at least to me this would be highly
useful (e.g., having different styles in HTML export for the text under
the task and the text of the top level, the time line).

Thanks and best wishes,
Dominik



Re: [O] How to do proper folding and semantic markup

2016-03-31 Thread Christian Moe

Eduardo Mercovich writes:
>
> ... place the abstract and #+LATEX: commands for frontmatter before the
> first exported headline, e.g.,
> #+BEGIN_abstract
>   [Abstract here]
> #+END_abstract

Originally my fault for pointing out that this was possible (for latex
and html backends, anyway) without any special abstract handling. :-)

https://lists.gnu.org/archive/html/emacs-orgmode/2010-11/msg00046.html

> The question is: how do I use the 1st header (keeping it's folding and
> referencing in org) while at the same time expressing that it is an
> abstract?

One can fold a block manually. However, it won't be automatically folded
when a file is opened or when when cycling the whole buffer through
folding states with C-u TAB. If these matter to you (I gather that you
have to write long abstracts), you may need to use the ignore trick
Thomas Dye referred to.

You can name a block and reference it by name.

#+name: theabstract
#+begin_abstract
  ...
#+end_abstract

See [[theabstract][the abstract]].

> How (if) can be done not only before the ToC, LoF and LoT but
> after them? 

You can control placement with a #+TOC: line. Do you need to do
something more?

An OS X upgrade just nuked my unix toolchains, including latex, so I
haven't checked how things work there.

Yours,
Christian