Re: [O] org-babel, gnuplot and buffer-wide header arguments

2013-06-13 Thread Carlos Russo

My life is suddenly much easier :-)
Thanks!

On 2013-06-13 05:45:07 +, Eric Schulte said:


Carlos Russo mestre.adamas...@gmail.com writes:


Hi

it seems that org-babel-gnuplot only recognizes a few header arguments.
I would like to set the following on top of the buffer:

#+PROPERTY: term pdfcairo enhanced mono size 8cm,6cm font Helvetica

in order to control the appearance of a bunch of figures generated by gnuplot
#+begin_src gnuplot :exports result :file file.pdf
plot ...
#+end_src

Basically, I would like to avoid writing the :term property all the time:

#+begin_src gnuplot :exports result :file file.pdf :term pdfcairo
enhanced mono size 8cm,6cm font Helvetica
plot ...
#+end_src

It seems that this requires a modification to ob-gnuplot.el.
Any hints on how to do this?



I've just pushed up a fix.  Take a look at commit 1720613 in the
repository to see what was required to make this change.  In this case
it was very simple.

Best,



Thanks,
Carlos







[O] org-babel, gnuplot and buffer-wide header arguments

2013-06-12 Thread Carlos Russo

Hi

it seems that org-babel-gnuplot only recognizes a few header arguments.
I would like to set the following on top of the buffer:

#+PROPERTY: term pdfcairo enhanced mono size 8cm,6cm font Helvetica

in order to control the appearance of a bunch of figures generated by gnuplot
#+begin_src gnuplot :exports result :file file.pdf
plot ...
#+end_src

Basically, I would like to avoid writing the :term property all the time:

#+begin_src gnuplot :exports result :file file.pdf :term pdfcairo 
enhanced mono size 8cm,6cm font Helvetica

plot ...
#+end_src

It seems that this requires a modification to ob-gnuplot.el.
Any hints on how to do this?

Thanks,
Carlos





[O] org-babel and gnuplot

2013-06-07 Thread Carlos Russo
Hi

I was trying a  gnuplot source block, and was stricken by No org-babel-execute 
function for gnuplot! when I tried to execute the block.
I made sure the variable org-babel-load-languages contained (gnuplot . t) , so 
I was quite puzzled.

It turns out that I needed to explicitly add 
(require 'ob-gnuplot)
to my .emacs file.

According to the documentation, this line should not be needed for org-mode 
8.03 (my current version).
It this a bug in the documentation?

Cheers,
Carlos


[O] Multiple (natural) languages in a single org-file

2012-03-01 Thread Carlos Russo
Hi

Is there a way to accommodate more than one natural language (e.g.
english and portuguese) in a single org-file?

I often prepare presentations in org-mode and export them using LaTeX's
beamer class. There is usually little text and quite some math.
Often I need to recycle an older presentation but using a different
language, i.e. sometimes I prepare something in english, but later I
will need to recycle it using english.

So far, I get around this by defining a custom LaTeX command:
#+LATEX_HEADER: \newcommand{\pt}[1]{} \newcommand{\en}[1]{#1}
or
#+LATEX_HEADER: \newcommand{\pt}[1]{#1} \newcommand{\en}[1]{}

I use this command to write stuff like
* \en{Example: sum of two numbers}\pt{Exemplo: soma de dois números}
\en{Example 1}\pt{Exemplo 1}
\[
3 = 2 + 1
\]
\en{Example 2}\pt{Exemplo 2}
\[
0 = 1 + e^{i\pi}
\]


I then export to pdf. Switching between languages is a matter of
changing the LaTeX header and exporting again.

Is there a more elegant way of doing this? I would like to be able to
export to HTML and ODT...

Carlos




Re: [O] Multiple (natural) languages in a single org-file

2012-03-01 Thread Carlos Russo
Oops,

it seems I missed the thread multilingual presentation with org
started earlier this month, my apologies for coming back to this topic.

I would like to add that the idea of using a special markup (using some
symbol) that would accept an argument (the language) would be cool.

I'm thinking something like
en: This shows up only in the english version
pt: Hey! This is not portuguese!
Or even a compound statement
pt: Português en: Englishfr: Français

Carlos




[O] LaTeX export: how to customize date format?

2012-01-09 Thread Carlos Russo
Hello,

Is there a way to customize how a date is exported into LaTeX?
Google couldn't help me on this.

For example, if an org file contains a timestamp 2012-01-09 Mon, I'm
getting an italicized version in the .tex file, i.e. \textit{2012-01-09
Mon}.

I would like to be able to change how dates are displayed in a global
way. In particular, I'm interested in automatically formatting the dates
in my documents using \usepackage[option]{isodate}?

So, in other words, I'd like to tell orgmode that it should output the
following
\printdate{2012-01-09}
or
\date-range{2012-01-01}{2012-01-09}
for date ranges.

I could use then use
#+LATEX_HEADER: \usepackage[option]{isodate}
to quickly change the date format, which could produce results as
diverse as:
Jan 9, 2012
January 9, 2012
Janvier 9, 2012
2012/01/09
2012/09/01
and so on...

Any hints on how to do this?

Cheers,
Carlos








Re: [O] LaTeX export: how to customize date format?

2012-01-09 Thread Carlos Russo
Thanks, it seems that
(setq org-export-latex-timestamp-markup \\printdate{%s})
does half of the job already.

 Er.. forget this sentence -- perhaps my subconscious is trying
 to tell me there are too many variables in Org now :) 


I suppose this means there are no plans of creating a variable containing the 
markup associated with a date range, right :-p?

Cheers,
Carlos




[O] Headline level on org-mobile-inbox-for-pull

2011-07-29 Thread Carlos Russo
Hi

As far as I can tell from the documentation, whenever I do a M-x
org-mobile-pull, all the entries I captured with my mobile device are
eventually moved into *top-level headlines* of org-mobile-inbox-for-pull
(from-mobile.org).

Is there a way to have these entries filed as second-level headlines?

Perhaps I should give a simple example:

Currently I have org-capture configured to file all my stuff under the
file gtd.org, top-level headline * Inbox.
Whenever I take a note, it will be stored as a second-level headline,
under Inbox.

When I started using mobileorg, I was forced to keep two files:
from-mobile.org and gtd.org.

I want all my notes to go to the same place, i.e. gtd.org/Inbox, but
this doesn't seem to be possible. Is is possible to specify the headline
on org-mobile-inbox-for-pull under which stuff will be stored?

Cheers,
Carlos





Re: [O] How to attach data in clipboard directly?

2011-06-25 Thread Carlos Russo

Hello

 What I want is that emacs/orgmode understands the contents of the 
clipboard
 and creates that file for me. For instance, if it detects that the 
contents
 of the clipboard is an image or some sort of non-text format, emacs 
would
 dump the clipboard data to a file, auto-generate a filename, 
guessing the

 data type, and attach that file to my org-file via org-attach-attach.


 See Automatic screenshot insertion on Worg:

  http://orgmode.org/worg/org-hacks.html#sec-3-8

 Best regards,
Seb



Thank you for your suggestion, Seb.
The script Automatic screenshot insertion from Worg is based on 
import from Imagemagick, which operates on X buffers.


I'm actually running Aquamacs in Mac OS X (10.6), so this solution 
doesn't work for me.
Nevertheless, it's a good pointer: I was able to cook up an elisp 
function that calls an applescript to do the osx-dependent stuff.
I suppose that X11 users could use xclip or xsel instead (did not try 
it, though).


Here is the elisp bit:

(defun org-capture-clipboard-as-png ()
  Save the contents of the clipboard as a time stamped unique-named 
.png file in the

same directory as the org-buffer and insert a link to this file.
  (interactive)
  (setq filename
(concat
 (make-temp-name
  (concat (buffer-file-name)
  _
  (format-time-string %Y%m%d_%H%M%S_)) ) .png))
  (call-process ~/.emacs.d/scripts/save_clipboard.applescript nil nil 
nil filename )

  (insert (concat [[ filename ]]))
;;  (org-display-inline-images)
)

and here is the applescript bit ( save_clipboard.applescript )

#!/usr/bin/osascript
on run argv
set fn to item 1 of argv
# Check if Clipboard is empty
set blnIsClipboardEmpty to false
try
set dataClipboard to the clipboard
on error strErrorMessage number intErrorNumber
if (intErrorNumber is -25131) then
set blnIsClipboardEmpty to true
end if
end try
# Try to save clipboard contentsas png
if blnIsClipboardEmpty is false then
set d to the clipboard as «class PNGf»
set fid to open for access fn with write permission
write d to fid
close access fid
end if
end run

Sure, this is far from perfect.
I would like these scripts to
- guess data type that is in clipboard and save the data with the 
correct extension

- make the elisp script aware of the file extension
- somehow feed this to org-attach, in order to have all of the 
git-attach goodies.


but this is beyond my skills at the moment...

Any hints?






[O] How to attach data in clipboard directly?

2011-06-24 Thread Carlos Russo
Hello,

I often need to paste fragments of pictures/images to my org file.

Typically, I manually paste the fragment to a file, and then use C-c C-a m to 
attach that file to my org-file.
This is rather tedious, because there are a few steps and extra programs 
involved, and I guess there must be a better way to do this.

What I want is that emacs/orgmode understands the contents of the clipboard and 
creates that file for me.
For instance, if it detects that the contents of the clipboard is an image or 
some sort of non-text format, emacs would dump the  clipboard data to a file, 
auto-generate a filename, guessing the data type, and attach that file to my 
org-file via org-attach-attach.

I'm thinking of a org-attach-clipboard sort of command, accessible via the C-c 
C-a (org-attach) menu.

Perhaps I'm demanding too much from emacs and org-mode, but hey,  couldn't it 
be done? It would be a cool feature...
More important, _hasn't_ this been done already?

Regards,
Carlos