[O] ditaa and plantuml exports source code?

2017-01-31 Thread Andreas Hirczy
Hi!

Exports from my org files show unwanted source blocks from ditaa in
export. I created a simple example:

###
#+NAME: TEST
#+BEGIN_SRC ditaa :file pics/test.png :exports results
+-+
| cBLU|
| |
|++
||cPNK|
|||
+++
#+END_SRC
###

which translates to ,
including both source and result. The documentation at
 states that
":exports results" is the default for ditaa anyway.

I am rather secure, this worked as intended some time ago; but I get
this behaviour now with at least the following exporters:

 - html
 - latex
 - ODT

I found the same problem with plantuml - see
 for
an example.

Is there anybody who experiences the same behaviuor?

My version of org is
Org mode version 9.0.4 (release_9.0.2-129-g2ac798.dirty @ 
/afs/itp.tugraz.at/user/ahi/.emacs.d/org-mode/lisp/)

Best regards
Andreas
-- 
Andreas Hirczy   https://itp.tugraz.at/~ahi/
Graz University of Technology   phone: +43/316/873-   8190
Institute of Theoretical and Computational Physicsfax: +43/316/873-10 8190
Petersgasse 16, A-8010 Grazmobile: +43/664/859 23 57




Re: [O] ditaa problems?

2016-11-15 Thread Eric S Fraga
On Tuesday, 15 Nov 2016 at 16:26, Peter Davis wrote:
> I'm trying to include a ditaa diagram in a document, but the diagram is
> not drawing correctly. I've attached the source file and the resulting
> png. As you can see, the box around fieldGroup1 is not being drawn for
> some reason. Other boxes appear to be correct.
>
> Any clues? Am I missing something?

I don't think so.  In any case, I don't think it's an org problem.

Your code doesn't work on my system either, although the resulting png
output is different: fieldGroup1 works but some of the ones inside do
not.  In my experience, ditaa is rather fragile.  Leaving bigger gaps
between all edges (top, bottom, sides) and contents, I have found, often
works better.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0-3-g4c4e84



Re: [O] ditaa problems?

2016-11-15 Thread Peter Davis
Eric S Fraga  writes:

> On Tuesday, 15 Nov 2016 at 16:26, Peter Davis wrote:
>> I'm trying to include a ditaa diagram in a document, but the diagram is
>> not drawing correctly. I've attached the source file and the resulting
>> png. As you can see, the box around fieldGroup1 is not being drawn for
>> some reason. Other boxes appear to be correct.
>>
>> Any clues? Am I missing something?
>
> I don't think so.  In any case, I don't think it's an org problem.
>
> Your code doesn't work on my system either, although the resulting png
> output is different: fieldGroup1 works but some of the ones inside do
> not.  In my experience, ditaa is rather fragile.  Leaving bigger gaps
> between all edges (top, bottom, sides) and contents, I have found, often
> works better.

Thanks, Eric. I did try leaving bigger gaps, but still no joy.

I've sent the file and the png to the ditaa developer on
SourceForge. I'll report back if I find out anything.

Thanks!
-pd



[O] ditaa problems?

2016-11-15 Thread Peter Davis
I'm trying to include a ditaa diagram in a document, but the diagram is
not drawing correctly. I've attached the source file and the resulting
png. As you can see, the box around fieldGroup1 is not being drawn for
some reason. Other boxes appear to be correct.

Any clues? Am I missing something?

Thank you!
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com


containers-ditaa.org
Description: Binary data


Re: [O] ditaa and plantuml in PATH

2016-03-28 Thread briangpowell .
I remember looking into NixOS years ago and it was very interesting--also
looked into "GNU Stow" and it may help you
with PATH problems: https://www.gnu.org/software/stow

GNU Stow comes with NixOS:
https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/misc/stow

On Mon, Mar 28, 2016 at 1:18 PM, Nick Dokos  wrote:

> Alexey Shmalko  writes:
>
> > Hi!
> >
> > I use NixOS and ditaa is globally installed. That means I have ditaa
> > executable in PATH but no easy way to find a ditaa.jar file. There is
> > no way to instruct org-ditaa to use the specified executable (it
> > requires java and path to the ditaa jar file). Note also that I don't
> > have java in PATH.
> >
> > I would like org-ditaa to use ditaa executable from the PATH. Same
> > goes for org-plantuml.
> >
>
> Does setting org-babel-ditaa-java-cmd to "ditaa" help? Maybe in
> combination with setting org-ditaa-jar-path to nil or ""?
>
> --
> Nick
>
>
>


Re: [O] ditaa and plantuml in PATH

2016-03-28 Thread Nick Dokos
Alexey Shmalko  writes:

> Hi!
>
> I use NixOS and ditaa is globally installed. That means I have ditaa
> executable in PATH but no easy way to find a ditaa.jar file. There is
> no way to instruct org-ditaa to use the specified executable (it
> requires java and path to the ditaa jar file). Note also that I don't
> have java in PATH.
>
> I would like org-ditaa to use ditaa executable from the PATH. Same
> goes for org-plantuml.
>

Does setting org-babel-ditaa-java-cmd to "ditaa" help? Maybe in
combination with setting org-ditaa-jar-path to nil or ""?

--
Nick




[O] ditaa and plantuml in PATH

2016-03-28 Thread Alexey Shmalko
Hi!

I use NixOS and ditaa is globally installed. That means I have ditaa
executable in PATH but no easy way to find a ditaa.jar file. There is
no way to instruct org-ditaa to use the specified executable (it
requires java and path to the ditaa jar file). Note also that I don't
have java in PATH.

I would like org-ditaa to use ditaa executable from the PATH. Same
goes for org-plantuml.

Regards,
Alexey Shmalko



Re: [O] ditaa source gets disappeared by exporting html

2014-10-11 Thread Eric S Fraga
On Saturday, 11 Oct 2014 at 12:13, ishi soichi wrote:
 emacs 24.3
 org-mode 8.2.6

 When I run org-html-export-to-html the following code,


 #+begin_src ditaa :file ditaa-seqboxes.png
 +--+   +-+   +-+   +-+
 |{io}  |   |{d}  |   |{s}  |   |cBLU |
 | Foo  +---+ Bar +---+ Baz +---+ Moo |
 |  |   | |   | |   | |
 +--+   +-+   +--+--+   +-+
 |
/-\  |  +--+
| |  |  | c1AB |
| Goo +--+---=--+ Shoo |
\-/ |  |
+--+
 #+end_src


 it successfully produces an image, which is visible in the exported
 html.
 But the original source of the org file becomes,

 #+RESULTS:
 [[file:ditaa-seqboxes.png]]

 In other words, the source is gone(?).

Very strange.  I have never heard of this happening to anybody with any
version of org!

In any case, your example works just fine when I export to HTML.  In
fact, the export commands should not change the original org file at
all.  The RESULTS line should only appear if you actually execute babel
on the src block.  You must be doing something more than what you are
indicating in your email.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-431-g8e1359



Re: [O] ditaa source gets disappeared by exporting html

2014-10-11 Thread ishi soichi
 thanks for your reply.

It might have been my mistake.  I have redone all org-mode configuration
written in init.el, then now it seems to be working as I wanted it to.
Though, I wasn't able to find the cause of what was happing.

Thanks anyway.


2014-10-11 17:40 GMT+09:00 Eric S Fraga e.fr...@ucl.ac.uk:

 On Saturday, 11 Oct 2014 at 12:13, ishi soichi wrote:
  emacs 24.3
  org-mode 8.2.6
 
  When I run org-html-export-to-html the following code,
 
 
  #+begin_src ditaa :file ditaa-seqboxes.png
  +--+   +-+   +-+   +-+
  |{io}  |   |{d}  |   |{s}  |   |cBLU |
  | Foo  +---+ Bar +---+ Baz +---+ Moo |
  |  |   | |   | |   | |
  +--+   +-+   +--+--+   +-+
  |
 /-\  |  +--+
 | |  |  | c1AB |
 | Goo +--+---=--+ Shoo |
 \-/ |  |
 +--+
  #+end_src
 
 
  it successfully produces an image, which is visible in the exported
  html.
  But the original source of the org file becomes,
 
  #+RESULTS:
  [[file:ditaa-seqboxes.png]]
 
  In other words, the source is gone(?).

 Very strange.  I have never heard of this happening to anybody with any
 version of org!

 In any case, your example works just fine when I export to HTML.  In
 fact, the export commands should not change the original org file at
 all.  The RESULTS line should only appear if you actually execute babel
 on the src block.  You must be doing something more than what you are
 indicating in your email.
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org
 release_8.3beta-431-g8e1359



[O] ditaa source gets disappeared by exporting html

2014-10-10 Thread ishi soichi
emacs 24.3
org-mode 8.2.6

When I run org-html-export-to-html the following code,

#+begin_src ditaa :file ditaa-seqboxes.png+--+   +-+   +-+
  +-+|{io}  |   |{d}  |   |{s}  |   |cBLU || Foo  +---+ Bar +---+
Baz +---+ Moo ||  |   | |   | |   | |+--+
+-+   +--+--+   +-+
|
   /-\  |  +--+
   | |  |  | c1AB |
   | Goo +--+---=--+ Shoo |
   \-/ |  |
   +--+#+end_src


it successfully produces an image, which is visible in the exported html.
But the original source of the org file becomes,

#+RESULTS:
[[file:ditaa-seqboxes.png]]

In other words, the source is gone(?).

Is there anyway to maintain the source of the image and export the image in
html?

soichi


[O] ditaa on Mac OS X

2014-08-06 Thread SabreWolfy
This[1] ditaa example with ORg 8.2.7f under Mac OS X Mavericks fails with a
message indicating that .../elpa/contrib/scripts/ditaa.jar is not found. I
created the folder and soft-linked /usr/local/bin/ditaa to ditaa.jar and
tried again. This time the export ran, but the PDF it created contained a
large box with :file somefile_name.png inside it. I've also read this[2]
and did not find ditaa in ELPA. Suggestions?

[1] http://doc.norang.ca/org-mode.html#playingwithditaa
[2] http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ditaa.html




[O] Ditaa on Mac OS X

2014-08-06 Thread SabreWolfy
This[1] ditaa example with ORg 8.2.7f under Mac OS X Mavericks fails with a
message indicating that .../elpa/contrib/scripts/ditaa.jar is not found. I
created the folder and soft-linked /usr/local/bin/ditaa to ditaa.jar and
tried again. This time the export ran, but the PDF it created contained a
large box with :file somefile_name.png inside it. I've also read this[2]
and did not find ditaa in ELPA. Suggestions?

[1] http://doc.norang.ca/org-mode.html#playingwithditaa
[2] http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ditaa.html




[O] ditaa problem with latest org mode

2014-06-11 Thread Adrian Burd
I am wondering if anyone else running Mavericks (OSX 10.9.2) on a Mac is
also having problems with ditaa? I'm running Emacs 24.3 and org-mode 8.2.6

Whenever I try to process some ditaa source code (either via an org file or
even from the command line) using the version if ditaa that comes with org,
I get the following unpleasant error

ditaa version 0.9, Copyright (C) 2004--2009  Efstathios (Stathis) Sideris

Exception in thread main java.lang.NoSuchMethodError:
 
org.stathissideris.ascii2image.core.ConversionOptions.init(Lorg/apache/commons/cli/CommandLine;)V
at org.stathissideris.ascii2image.core.CommandLineConverter.main(Unknown
Source)

even when running with the simplest of ditaa files.

I get the same error if I use Apples Java (java 6) or Oracle's Java (java
7u60).

PlantUML code runs like a charm, so it's something in the way Java is
interacting with ditaa.

It does work on a similar Mac (in the office) running OSX 10.7 with org
mode 8.2.1, so I'm suspecting that there's something messed up with
Mavericks.

Is anyone else seeing this?

Thanks,

Adrian


Re: [O] ditaa problem with latest org mode

2014-06-11 Thread Grant Rettke
I'm on:

Emacs version: GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, NS
apple-appkit-1265.19)
of 2014-04-24 on orion
Org version: 8.2.6
java version 1.8.0_05
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
ditaa0_9.jar

And org-babel-tangle on this

#+begin_src ditaa :file ditaa-simple.png :tangle no :exports both
  +--+   +-+   +-+   +-+
  |{io}  |   |{d}  |   |{s}  |   |cBLU |
  | Foo  +---+ Bar +---+ Baz +---+ Moo |
  |  |   | |   | |   | |
  +--+   +-+   +--+--+   +-+
  |
 /-\  |  +--+
 | |  |  | c1AB |
 | Goo +--+---=--+ Shoo |
 \-/ |  |
 +--+
#+end_src

Produces a png.
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Tue, Jun 10, 2014 at 9:29 PM, Adrian Burd adrianbur...@gmail.com wrote:
 I am wondering if anyone else running Mavericks (OSX 10.9.2) on a Mac is
 also having problems with ditaa? I'm running Emacs 24.3 and org-mode 8.2.6

 Whenever I try to process some ditaa source code (either via an org file or
 even from the command line) using the version if ditaa that comes with org,
 I get the following unpleasant error

 ditaa version 0.9, Copyright (C) 2004--2009  Efstathios (Stathis) Sideris

 Exception in thread main java.lang.NoSuchMethodError:
 org.stathissideris.ascii2image.core.ConversionOptions.init(Lorg/apache/commons/cli/CommandLine;)V
 at org.stathissideris.ascii2image.core.CommandLineConverter.main(Unknown
 Source)

 even when running with the simplest of ditaa files.

 I get the same error if I use Apples Java (java 6) or Oracle's Java (java
 7u60).

 PlantUML code runs like a charm, so it's something in the way Java is
 interacting with ditaa.

 It does work on a similar Mac (in the office) running OSX 10.7 with org mode
 8.2.1, so I'm suspecting that there's something messed up with Mavericks.

 Is anyone else seeing this?

 Thanks,

 Adrian






[O] ditaa diagram not as expected

2012-08-07 Thread Richard Lewis
Hi there,

I'm preparing a document in which I discuss the CSS box model and
wanted to include a diagram, this diagram:

#+begin_ditaa boxmodel.png -S
+---=---+
|   margin  |
|  +-+  |
|  |border   |  |
|  |  +=--+  |  |
|  |  | padding   |  |  |
|  |  |  +=+  |  |  |
|  |  |  |  content|  |  |  |
|  |  |  | |  |  |  |
|  |  |  | |  |  |  |
|  |  |  +=+  |  |  |
|  |  |   |  |  |
|  |  +=--+  |  |
|  | |  |
|  +-+  |
|   |
+---=---+
#+end_ditaa

However, the diagram that org/ditaa creates is missing the third box
(counting from the outside inwards), the box between border and
padding. I tried removing the = (which would make the line solid),
but the box still did not appear. I've tried this snippet in an org
document by itself, and I've tried putting the diagram in a file by
itself and running ditaa directly. Still no middle box.

I realise this may be a ditaa rather than an org-mode problem, but can
anyone suggest anything? Particularly, does anyone else get the same
effect?

org-mode version: 7.8.11; ditaa version: 0.9; Emacs version: 24.1.1.

Thanks,
Richard



Re: [O] ditaa diagram not as expected

2012-08-07 Thread Eric Schulte
This is a ditaa issue and probably isn't affected by Org-mode.

I have had issues like this in the past with ditaa, I often find that
the solution is to leave more space between my shapes or lines.

Best,

Richard Lewis richardle...@fastmail.co.uk writes:

 Hi there,

 I'm preparing a document in which I discuss the CSS box model and
 wanted to include a diagram, this diagram:

 #+begin_ditaa boxmodel.png -S
 +---=---+
 |   margin  |
 |  +-+  |
 |  |border   |  |
 |  |  +=--+  |  |
 |  |  | padding   |  |  |
 |  |  |  +=+  |  |  |
 |  |  |  |  content|  |  |  |
 |  |  |  | |  |  |  |
 |  |  |  | |  |  |  |
 |  |  |  +=+  |  |  |
 |  |  |   |  |  |
 |  |  +=--+  |  |
 |  | |  |
 |  +-+  |
 |   |
 +---=---+
 #+end_ditaa

 However, the diagram that org/ditaa creates is missing the third box
 (counting from the outside inwards), the box between border and
 padding. I tried removing the = (which would make the line solid),
 but the box still did not appear. I've tried this snippet in an org
 document by itself, and I've tried putting the diagram in a file by
 itself and running ditaa directly. Still no middle box.

 I realise this may be a ditaa rather than an org-mode problem, but can
 anyone suggest anything? Particularly, does anyone else get the same
 effect?

 org-mode version: 7.8.11; ditaa version: 0.9; Emacs version: 24.1.1.

 Thanks,
 Richard


-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] ditaa diagram not as expected

2012-08-07 Thread Richard Lewis
At Tue, 07 Aug 2012 07:48:36 -0600,
Eric Schulte wrote:

 Richard Lewis richardle...@fastmail.co.uk writes:
 
  However, the diagram that org/ditaa creates is missing the third box
  (counting from the outside inwards), the box between border and
  padding. I tried removing the = (which would make the line solid),
  but the box still did not appear. I've tried this snippet in an org
  document by itself, and I've tried putting the diagram in a file by
  itself and running ditaa directly. Still no middle box.
 
  I realise this may be a ditaa rather than an org-mode problem, but can
  anyone suggest anything? Particularly, does anyone else get the same
  effect?
 
 This is a ditaa issue and probably isn't affected by Org-mode.
 
 I have had issues like this in the past with ditaa, I often find that
 the solution is to leave more space between my shapes or lines.

Oh. Well that's fixed it. I also tried various other spacing and found
all sorts of ways of breaking it. But at least one arrangement works!

Thanks,
Richard



Re: [O] ditaa

2011-08-19 Thread Henri-Paul Indiogine
Hi Eric!

2011/8/19 Eric Schulte schulte.e...@gmail.com:
 On a side note (and personal preference) I would highly recommend using
 TikZ for LaTeX documents as the finished product seamlessly integrates
 with the rest of the document and scales nicely from posted to post-card
 printings.

Yes, I agree.  I had used TikZ previously and liked it a lot.  I have
left ditaa after trying it with minimal example and still having the
problem. I do not have time to look at it any longer.

I wrote the TikZ code instead in my org file and that works very well.

Thanks,
Henri-Paul

-- 
Henri-Paul Indiogine

Curriculum  Instruction
Texas AM University
TutorFind Learning Centre

Email: hindiog...@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine



Re: [O] ditaa

2011-08-13 Thread Sebastien Vauban
Hi Henri-Paul,

Henri-Paul Indiogine wrote:
 Is anyone experiencing problems with LaTeX export + ditaa?   After a
 git pull upgrade this morning the export to LaTeX of ditaa has changed
 to hyperref.   I can post the relevant LaTeX lines if necessary.

Yes, I think it'd help if you could post a complete -- but minimal... --
example which allows us to (try to) reproduce the problem.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] ditaa

2011-08-13 Thread Nick Dokos
Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

 Hi Henri-Paul,
 
 Henri-Paul Indiogine wrote:
  Is anyone experiencing problems with LaTeX export + ditaa?   After a
  git pull upgrade this morning the export to LaTeX of ditaa has changed
  to hyperref.   I can post the relevant LaTeX lines if necessary.
 
 Yes, I think it'd help if you could post a complete -- but minimal... --
 example which allows us to (try to) reproduce the problem.
 

I just pulled

   Org-mode version 7.7 (release_7.7.64.g1bbf)

and tried on this:

--8---cut here---start-8---
* Export a picture

Need to load ob-ditaa to execute these:

#+begin_src ditaa :file image.png :cmdline -r :exports both
+-+
| cBLU|
| |
|++
||cPNK|
|||
+++
#+end_src

#+results:
[[file:image.png]]
--8---cut here---end---8---


It worked fine - the link became


\includegraphics[width=.9\linewidth]{image.png}


in the tex file.

Nick




Re: [O] ditaa

2011-08-13 Thread Henri-Paul Indiogine
Greetings!

This is from my .emacs

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (ditaa . t)
   .
   .
(defun my-org-confirm-babel-evaluate (lang body)
  (not (string= lang ditaa)))  ; don't ask for ditaa
(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)


This is what I obtain in the exported tex file:

\hyperref[home-henk-Dropbox-dissertation-work-flow.png]{file:/home/henk/Dropbox/dissertation/work-flow.png}


The ditaa code is between these lines:

#+CAPTION: Research work flow
#+LABEL: fig:workflow
#+begin_src ditaa :file /home/henk/Dropbox/dissertation/work-flow.png
:cmdline -r -s 1.0
..
#+end_src

If I execute the code (C-c C-c) I obtain the following:

ditaa version 0.9, Copyright (C) 2004--2009  Efstathios (Stathis) Sideris

Running with options:
round-corners
scale = 1.0
Reading file: /tmp/babel-4681Hni/ditaa-46811gs
Locale: en_CA
Dialog.bold
Rendering to file: /home/henk/Dropbox/dissertation/work-flow.png
Done in 5sec

The png file is created.  The only issue is the faulty tex code that
is generated.


I have also noticed that the editing of the org file sometimes slows
down considerably.  Maybe it has nothing to do with it, but it
happened after I started using ditaa.  I am wondering about using TikZ
instead.

Thanks,
Henri-Paul



-- 
Henri-Paul Indiogine

Curriculum  Instruction
Texas AM University
TutorFind Learning Centre

Email: hindiog...@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine



[O] ditaa

2011-08-12 Thread Henri-Paul Indiogine
Greetings!

Is anyone experiencing problems with LaTeX export + ditaa?   After a
git pull upgrade this morning the export to LaTeX of ditaa has changed
to hyperref.   I can post the relevant LaTeX lines if necessary.

Thanks,
Henri-Paul

-- 
Henri-Paul Indiogine

Curriculum  Instruction
Texas AM University
TutorFind Learning Centre

Email: hindiog...@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine



Re: [O] DITAA and Unicode characters [babel]

2011-04-25 Thread Eric Schulte
Hi Juan,

Juan Pechiar j...@pechiar.com writes:

 Hi,

 Out of the box, ob-ditaa does not work with non-ascii characters.

 I looked into the problem in order to answer a user request on
 StackOverflow (yes, there are org-mode questions posted there instead
 of here!).

 http://stackoverflow.com/questions/5758498/problem-with-ditaa-and-foreign-characters-in-org-mode


Thanks for catching questions in these other forums.


 In order for ditaa to accept UTF-8 characters in the input file, it
 must be called with the corresponding property setting:

java -Dfile.encoding=UTF-8 -jar path/to/ditaa.jar ...


I just pushed up a change to ob-ditaa which adds a new header argument,
namely :java through which options can be passed to the java command.
With that patch the following should work

#+begin_src ditaa :file ... :cmdline -e utf-8 -r -v :java -Dfile.encoding=UTF-8
  ...
#+end_src


 Attached is a dirty patch for hard-coding this property setting.

 I don't know what the proper way of setting this property should be:

  - somehow setting it system-wide (any Java guru out there?).

  - or adding a customization to ob-ditaa.el for this property

  - or adding magic to ob-ditaa so that the same encoding of the buffer
gets set to this Java property

 I can help with the implementation if given some feedback on the above
 options.


Now that there is a :java header argument for ditaa code, the following
could be put in a user's init file to set this flag for *all* ditaa code
run on their system.

#+begin_src emacs-lisp
  (push '(:java . -Dfile.encoding=UTF-8) org-babel-default-header-args:ditaa)
#+end_src

I wonder if there would be any downside to adding this as a default
value?  This could be added to `org-babel-default-header-args:ditaa' in
ob-ditaa.el.

Best -- Eric


 Regards,
 .j.


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] DITAA and Unicode characters [babel]

2011-04-25 Thread Juan Pechiar
On Mon, Apr 25, 2011 at 01:13:41PM -0600, Eric Schulte wrote:
 I just pushed up a change to ob-ditaa which adds a new header argument,
 namely :java through which options can be passed to the java command.
 With that patch the following should work

 #+begin_src ditaa :file ... :cmdline -e utf-8 -r -v :java 
 -Dfile.encoding=UTF-8
   ...
 #+end_src

 Now that there is a :java header argument for ditaa code, the following
 could be put in a user's init file to set this flag for *all* ditaa code
 run on their system.

 #+begin_src emacs-lisp
   (push '(:java . -Dfile.encoding=UTF-8) 
 org-babel-default-header-args:ditaa)
 #+end_src

Works perfectly! Thanks!

 I wonder if there would be any downside to adding this as a default
 value?  This could be added to `org-babel-default-header-args:ditaa' in
 ob-ditaa.el.

I think it'd be a reasonable default that will work out-of-the-box for
most users.

In case of not using UTF-8, the user can override this setting at
will as you show above.

Regards,
.j.



Re: [O] DITAA and Unicode characters [babel]

2011-04-25 Thread Eric Schulte
Juan Pechiar j...@pechiar.com writes:

 On Mon, Apr 25, 2011 at 01:13:41PM -0600, Eric Schulte wrote:
 I just pushed up a change to ob-ditaa which adds a new header argument,
 namely :java through which options can be passed to the java command.
 With that patch the following should work

 #+begin_src ditaa :file ... :cmdline -e utf-8 -r -v :java 
 -Dfile.encoding=UTF-8
   ...
 #+end_src

 Now that there is a :java header argument for ditaa code, the following
 could be put in a user's init file to set this flag for *all* ditaa code
 run on their system.

 #+begin_src emacs-lisp
   (push '(:java . -Dfile.encoding=UTF-8) 
 org-babel-default-header-args:ditaa)
 #+end_src

 Works perfectly! Thanks!

 I wonder if there would be any downside to adding this as a default
 value?  This could be added to `org-babel-default-header-args:ditaa' in
 ob-ditaa.el.

 I think it'd be a reasonable default that will work out-of-the-box for
 most users.


OK, this is now part of the default ditaa header arguments, we'll see if
anyone complains...

Best -- Eric


 In case of not using UTF-8, the user can override this setting at
 will as you show above.

 Regards,
 .j.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



[O] DITAA and Unicode characters [babel]

2011-04-24 Thread Juan Pechiar
Hi,

Out of the box, ob-ditaa does not work with non-ascii characters.

I looked into the problem in order to answer a user request on
StackOverflow (yes, there are org-mode questions posted there instead
of here!).

http://stackoverflow.com/questions/5758498/problem-with-ditaa-and-foreign-characters-in-org-mode

In order for ditaa to accept UTF-8 characters in the input file, it
must be called with the corresponding property setting:

   java -Dfile.encoding=UTF-8 -jar path/to/ditaa.jar ...

Attached is a dirty patch for hard-coding this property setting.

I don't know what the proper way of setting this property should be:

 - somehow setting it system-wide (any Java guru out there?).

 - or adding a customization to ob-ditaa.el for this property

 - or adding magic to ob-ditaa so that the same encoding of the buffer
   gets set to this Java property

I can help with the implementation if given some feedback on the above
options.

Regards,
.j.
diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index 20b5c42..dc17a4d 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -55,7 +55,7 @@ This function is called by `org-babel-execute-src-block'.
 		(cdr (assoc :file params
 	 (cmdline (cdr (assoc :cmdline params)))
 	 (in-file (org-babel-temp-file ditaa-))
-	 (cmd (concat java -jar 
+	 (cmd (concat java -Dfile.encoding=UTF-8 -jar 
 		  (shell-quote-argument
 		   (expand-file-name org-ditaa-jar-path))
 		cmdline