Org babel java: adding class path

2021-03-23 Thread Jarmo Hurri


Greetings.

I need to add an additional classpath to the call of
org-babel-java-command to make sure my program is able to load a
database driver. But, as it is now, org babel java already uses
classpath option -cp, and in the case of multiple -cp options, only the
last one is retained:

https://stackoverflow.com/questions/45291354/specifying-multiple-cp-or-classpath-entries-on-java-command-line

So what is the correct way to do achieve this in org babel?

>From the command line, in linux, multiple class paths would separated by
a colon ":"

java -classpath "/usr/share/java/hsqldb.jar:." Main

Have fun and stay safe,

Jarmo




Re: straight.el and org info pages?

2021-03-23 Thread Gustav Wikström
Hmm, I've had problems getting straight.el to install org-mode itself. That was 
on windows though. And that issue was fixed recently 
(https://github.com/raxod502/straight.el/issues/707)

I do recall some discussions on building docs long ago and that it wasn't 
possible due to some design issues. Not sure if that problem remains, or if I 
recall correctly even.

/G

Get Outlook for iOS

From: Greg Minshall 
Sent: Wednesday, March 24, 2021 3:56:36 AM
To: Gustav Wikström 
Cc: emacs-orgmode@gnu.org 
Subject: straight.el and org info pages?

Gustav,

> Straight.el is worth looking into for this. Has served me well for
> similar use cases.

have you (or anyone else?) had problems getting straight.el to build and
install the info pages for Org mode?

cheers, Greg


Re: trivial software engineering'ish question: switching org's

2021-03-23 Thread Greg Minshall
Maxim,

also, thanks.  i do use (something like) your suggestion when i just
want to try once or twice.

: emacs -Q -L /path/to/your/org-mode/folder/lisp -l org

(from Ihor R, last December.)

cheers, Greg



Re: straight.el and org info pages?

2021-03-23 Thread Richard Kim
Greg Minshall  writes:

> Gustav,
>
>> Straight.el is worth looking into for this. Has served me well for
>> similar use cases.
>
> have you (or anyone else?) had problems getting straight.el to build and
> install the info pages for Org mode?
>
> cheers, Greg

For me (info "(org)") brings up org mode info page located in
org-plus-contrib package installed by straight.el. Thus it appears that
straight.el has no problem building info pages for org mode.

I use straight.el along with spacemacs.




Re: "Org" source blocks and minted

2021-03-23 Thread Timothy


Hi Michael,

> I want to include an "org" source block in a document as an example, and
> have it formatted with minted.
>

Juan mentioned an Org lexer exists, but another approach that may be of
interest is using Emacs' own font-lock. I wrote a package that's like
HTMLize but works with LaTeX and currently have it sitting in my config.

I plan on submitting a patch to Org at some point on this, but for now:
- https://github.com/tecosaur/engrave-faces
- https://tecosaur.github.io/emacs-config/config.html#pretty-code-blocks

Sample output: all the code blocks in
https://tecosaur.github.io/emacs-config/config.pdf

Since this uses Emacs' font-lock, this means that you can use any
language that you have a syntax-highlighting-mode for :)

--
Timothy



Re: "Org" source blocks and minted

2021-03-23 Thread Juan Manuel Macías
Hi Mike,

Michael Gauland  writes:

> I want to include an "org" source block in a document as an example,
> and have it formatted with minted. Unfortunately, minted doesn't seem
> to recognize "org" as a language,and the block is missing in the
> resulting PDF. For the moment, I've changed this to a "text" source
> block, but it would be nice to have syntax highlighting in the export.
>
> Have any of you done this, or something similar?
>
> Kind regards,
> Mike
>

You can write your own pygments lexer:

https://pygments.org/docs/lexerdevelopment

But it seems that someone already did the work of writing a lexer for
Org Mode: 

https://github.com/or/pygments-orgmode-lexer

Best regards,

Juan Manuel 




straight.el and org info pages?

2021-03-23 Thread Greg Minshall
Gustav,

> Straight.el is worth looking into for this. Has served me well for
> similar use cases.

have you (or anyone else?) had problems getting straight.el to build and
install the info pages for Org mode?

cheers, Greg



"Org" source blocks and minted

2021-03-23 Thread Michael Gauland
I want to include an "org" source block in a document as an example, and
have it formatted with minted. Unfortunately, minted doesn't seem to
recognize "org" as a language,and the block is missing in the resulting
PDF. For the moment, I've changed this to a "text" source block, but it
would be nice to have syntax highlighting in the export.

Have any of you done this, or something similar?

Kind regards,
Mike


SymPy equations + displayed equation + label = difficult?

2021-03-23 Thread autofrettage
Hi all,

I have tried to use SymPy in Org Mode code blocks, export LaTeX
expressions to displayed equations, and refer to those with
labels. My current solution is ugly, which has left me with a
strong feeling that there must be a better way.

Sensitive Org Mode users are warned. Here comes a brief
description of my current solution.

* The equation is defined inside a SymPy block, e.g.:

   a, R, L = symbols('\\alpha R L')
   equ = Eq(R, L * sin(a))

* The LaTeX representation for equ, and the rest of the LaTeX
  code needed for producing a displayed equation, with a label,
  are generated with the Python function expequ:

  #+BEGIN_SRC python :session :results none :exports none
  def expequ(expr, label):
 # will write out code for export of SymPy equation
 expression = latex(expr, mode="plain")
 print("""
 \\begin{equation}
\\label{%(label)s}
%(expr)s
 \\end{equation}""" % {'expr': expression, 'label': label})
  #+END_SRC

* At the place where I want to display equ, I call expequ like
  this:

  #+HEADER:  :results output latex overwrite :exports results
  #+BEGIN_SRC python :session
 expequ(equ2,"equ:labeltest")
  #+END_SRC

* ...which yields:

  #+RESULTS:
  #+BEGIN_EXPORT latex
  \begin{equation}
 \label{equ:labeltest}
 R = L \sin{\left(\alpha \right)}
  \end{equation}
  #+END_EXPORT

How many painfully obvious solutions have I missed?

Yours
Rasmus




Re: Bug: Fontificaton and hiding inside code and verbatim markup

2021-03-23 Thread Sebastian Miele
Sebastian Miele  writes:

> according to both, org-element-parse-buffer and
> worg/dev/org-syntax.org,
>
>   ~file:aa~
>   ~a *a* a~
>   =a /a/ a=
>
> does not have link, bold or emphasize objects inside the code or
> verbatim objects.  However, the fontification of Org makes it look like
> that.  Also, the emphasis markers inside code or verbatim objects are
> hidden, when org-hide-emphasis-markers is t.

I am using Org from the current master in Emacs 27.1.



Bug: Fontificaton and hiding inside code and verbatim markup

2021-03-23 Thread Sebastian Miele
Hello!

according to both, org-element-parse-buffer and
worg/dev/org-syntax.org,

  ~file:aa~
  ~a *a* a~
  =a /a/ a=

does not have link, bold or emphasize objects inside the code or
verbatim objects.  However, the fontification of Org makes it look like
that.  Also, the emphasis markers inside code or verbatim objects are
hidden, when org-hide-emphasis-markers is t.

Best wishes
Sebastian



Re: noweb syntax clashing with shell here document syntax

2021-03-23 Thread Sebastian Miele
Hi Immanuel,

Immanuel Litzroth  writes:

> You can choose which delimiters signal noweb.
> see the documentation of org-babel-noweb-wrap-start and
> org-babel-noweb-wrap-end.

Thank you!  That indeed should make my problem solvable in a perfect
way.

Best wishes
Sebastian



Re: Items with emphasis marks are not sorted properly in a list

2021-03-23 Thread Juan Manuel Macías
Hello again:

I think I have found where the problem is. On line 7 of
`org-sort-remove-invisible' there are two spurious spaces (in the `format'
expression):

7org-emph-re (lambda (m) (format " %s " (match-string 4 m)))

When the spaces are removed, then the items with emphasis marks are
sorted correctly in the list:

7org-emph-re (lambda (m) (format "%s" (match-string 4 m)))

Can this be a fix? Or were those spaces there for any other reason?

Best regards,

Juan Manuel 

Juan Manuel Macías  writes:

> Hi,
>
> Consider this list:
>
> - vol.
> - adj.
> - /circa/
> - /vid./
>
> If I evaluate `(org-sort-list t ?a)', it seems that `org-sort-list'
> doesn't sort correctly items that contain an emphasis mark:
>
> - /circa/
> - /vid./
> - adj.
> - vol.
>
> I don't know if there is any solution to this, or if I'm doing something 
> wrong...
>
> Best regards,
>
> Juan Manuel 
>