Dan Davison | 1 Sep 2011 05:47
Picon
Gravatar

Re: [babel] Producing figures from octave

Ethan Ligon <ligon <at> are.berkeley.edu> writes:

> Dan Davison has a brief worg tutorial on using babel with octave at
>
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-octave-matlab.html
>
Hi Ethan,

> Amongst other things, he offers the following example block for
> producing a figure:

(Actually, the example is not by me.)

> #+begin_src octave :output file :file chart.png
> figure( 1, "visible", "off" );
> sombrero;
> print -dpng chart.png
> #+end_src

:output file is wrong (there's no header arg named :output).
:file chart.png says to write the results to that file. The "results"
are whatvever the variable `ans` holds at the end of the block, and I
think that must be the file path you're seeing.

One way to write that example is:

#+begin_src octave :results file
figure( 1, "visible", "off" );
sombrero;
print -dpng chart.png;
(Continue reading)

Gustav Wikström | 1 Sep 2011 11:50
Picon

Bug in calculations with durations and time values in tables

Hello, just a small bug-report. The following does not seem right:


|    First |    Second |    Result |
|----------+-----------+-----------|
| 00:00:00 | -00:10:10 | -01:49:50 |
#+TBLFM: $3='(+ $1..$2);T

|    First |    Second | Result |
|----------+-----------+--------|
| 00:00:00 | -00:10:10 |  -0.17 |
#+TBLFM: $3='(+ $1..$2);t

|    First |    Second |    Result |
|----------+-----------+-----------|
| 00:00:00 | -02:01:00 | -03:59:00 |
#+TBLFM: $3='(+ $1..$2);T

|    First |    Second | Result |
|----------+-----------+--------|
| 00:00:00 | -02:01:00 |  -2.02 |
#+TBLFM: $3='(+ $1..$2);t


Somehow, when the result of a time-calculation with minutes and seconds goes negative the result gets an additional negative two hours added (with the minutes and seconds removed from these two hours)... This seems to be a problem when doing calculations with the suffix ;T.

;t works as intended in this respect.

Regards
Gustav
Richard Lewis | 1 Sep 2011 13:24
Picon
Gravatar

Escaping Square Brackets in LaTeX Export

Hi there,

I want to include the following in an org-mode buffer and be able to
export it to LaTeX:

#+begin_src python :exports code
s[0]
#+end_src

The problem is that org-mode treats s[0] as a footnote reference and
produces LaTeX like this:

\begin{verbatim}
s\footnote{DEFINITION NOT FOUND: 0 }
\end{verbatim}

Is it possible to escape the square brackets?

Thanks,
Richard

Erik Iverson | 1 Sep 2011 14:07
Picon

Re: Escaping Square Brackets in LaTeX Export

Richard,

On 09/01/2011 06:24 AM, Richard Lewis wrote:

> I want to include the following in an org-mode buffer and be able to
> export it to LaTeX:
>
> #+begin_src python :exports code
> s[0]
> #+end_src

This works for me with both python and R code blocks on the latest version 
pulled from git.  Which version of org-mode are you experiencing this with?

--Erik

Stefan Reichör | 1 Sep 2011 14:15
Picon

Re: Use (org-entry-properties) in a mode derived from org-mode

Hello again!

> Hi!
>
> I'd like to derive a mode from org-mode.
>
> I do something like this:
>
> (define-derived-mode derived-org-mode org-mode "dorg" "derived org-mode"
>   (message "derived-org-mode activated")
>   )
>
> When I activate the derived-org-mode, M-: (org-entry-properties) does no longer work.
>
> Using org-mode it works.
>
> When I use derived-mode-p in org-mode-p everything works:
>
>
> (defsubst org-mode-p ()
>   "Check if the current buffer is in Org-mode or a derived mode."
>   ;;(eq major-mode 'org-mode))
>   (if (derived-mode-p 'org-mode) t nil))
>
>
> I think changing org-mode-p should be the correct change to make
> deriving from org-mode work.
>
> Perhaps a (if (symbolp 'derived-mode-p) ...) is necessary to avoid
> compatibility problems.
>
> What do the org developers think of this improvement?
>

In function org-edit-src-code there is already support for derived modes from org-mode:
,----
|   (let ((mark (and (org-region-active-p) (mark)))
| 	(case-fold-search t)
| 	(info (org-edit-src-find-region-and-lang))
| 	(full-info (org-babel-get-src-block-info))
| 	(org-mode-p (or (org-mode-p) (derived-mode-p 'org-mode)))
`----

(defun org-mode-or-derived-mode-p ()
  "Check if the current buffer is in Org-mode or a derived mode."
  (if (derived-mode-p 'org-mode) t nil))

Using org-mode-or-derived-mode-p would change the function like this:
,----
| In function org-edit-src-code
|   (let ((mark (and (org-region-active-p) (mark)))
| 	(case-fold-search t)
| 	(info (org-edit-src-find-region-and-lang))
| 	(full-info (org-babel-get-src-block-info))
| 	(org-mode-p (org-mode-or-derived-mode-p))
`----

org-mode-p could be replaced step by step with org-mode-or-derived-mode-p to enhance the support for
org-mode derived modes.

I need org-mode-or-derived-mode-p instead of org-mode-p in org-entry-properties.

It would be great if org-mode-or-derived-mode-p could be added!

Thanks,
  Stefan.

Jambunathan K | 1 Sep 2011 14:28
Picon

Re: Escaping Square Brackets in LaTeX Export


> The problem is that org-mode treats s[0] as a footnote reference and
> produces LaTeX like this:

Make sure your Org version is NEWER than this post.
https://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00447.html

From the above post

,----
| Footnotes cannot live anymore in example, src, verse, latex, html and
| docbook blocks.
`----

Jambunathan K.

Richard Lewis | 1 Sep 2011 17:44
Picon
Gravatar

Re: Escaping Square Brackets in LaTeX Export

At Thu, 01 Sep 2011 17:58:00 +0530,
Jambunathan K wrote:
> 
> > The problem is that org-mode treats s[0] as a footnote reference and
> > produces LaTeX like this:
> 
> Make sure your Org version is NEWER than this post.
> https://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00447.html
> 
> From the above post
> 
> ,----
> | Footnotes cannot live anymore in example, src, verse, latex, html and
> | docbook blocks.
> `----

Thanks for the pointer. It led me to discover that some of my org-mode
libraries were coming from the Debian emacs package, and some from my
git repository. So a site-specific problem.  I've actually been caught
out by this before, so no excuse really.

Thanks,
Richard

Marvin Doyley | 1 Sep 2011 18:59
Picon

org-bable and gnuplot

Hi there,

I am planning to use gnuplot to plot some data that I have in org table. Everything is set-up correctly and gnuplot is installed my mac. Unfortunately, when I run the following org file I get a zero byte file -- everything seems to run ok, except nothing is written to the output file. Does anybody know what I am doing wrong ?

#+tblname: testing
| x |  y |
|---+----|
| 1 |  2 |
| 2 |  4 |
| 3 |  6 |
| 4 |  8 |
| 5 | 10 |
| 6 | 12 |
| 7 | 14 |
| 8 | 16 |
#+begin_src gnuplot :var data=testing :file output.eps :exports both
set title "test"
set auto x
set style data histogram
set style fill solid border -1
set boxwidth 0.9
plot data using 1:2
#+end_src

#+results:
[[file:output.eps]]
cheers
M

Darlan Cavalcante Moreira | 1 Sep 2011 19:02
Picon

How to suppress \label commands in beamer export


I'm trying to convert a presentation I've done in beamer to org-mode. I'm
going to improve this presentation and add more stuff to it. I'd like to do
it in org-mode.

However, org adds \label{sec-numbers} in the generated tex file after all
environments and this adds some blank space between the blocks in the final
presentation. I understand this extra blank space is more like a latex
issue, but I couldn't find a way to stop org-mode from creating the \label
lines.

In order to reproduce this, export the attached org file to a beamer
presentation. Notice how Block 1 and Block 2 (as well as Block 3 and
Block 4) have a lot of blank space between them. In fact, this makes Block
2 and Block 4 goes out of the frame.

Now, in the .tex file that org created, erase all the \label lines and
compile the file again. Notice how the blank space between the blocks
changes and now Block 2 and Block 4 fit nicely inside each frame.

Note: I use the overprint environment. The attached file has two lines that
must be executed in order to make overprint work. Maybe this environment
should be added to org-beamer-environments-default.

--
Darlan

Attachment (test_org_beamer.org): application/octet-stream, 4182 bytes

Tatsuhito Koya | 1 Sep 2011 19:39
Picon

Clearing checkboxes after a recurring task is done

Hello,

I have a recurring task defined something like this:

* TODO Inspect systems
DEADLINE: <2011-06-01 Wed +1m>
- [ ] Inspect System A
- [ ] Inspect System B
- [ ] Inspect System C
- [ ] Inspect System D

The variable org-enforce-todo-dependencies is set, so that I cannot change
this task to DONE until all systems are inspected.

I notice that even if I change the task to DONE, the checkboxes are still checked
although the deadline is moved forward by a month. Is there a way to automatically
clear the checkboxes when I change the task to DONE?

I checked the manual but could not find relevant information.

I am using org-mode 7.7 and GNU emacs for Windows 23.3.1.

Thank you,


Gmane