Re: processing of babel blocks and select_tags

2022-02-18 Thread Jeremie Juste
Hello Eric,

On Friday, 18 Feb 2022 at 11:57, Eric S Fraga wrote:
> TL;DR: can I have org completely ignore src blocks in non-selected
> sections during export without using COMMENT?

If I change eval: no_export to :eval no, Only the =Description= section
is evaluated and exported. That said, I have often search in vain of a way of
using tags to prevent evaualtion of code chuck. I have resorted to use
either property at the heading or file level to control the execution
of code chunks.

 ** Subheading
   :PROPERTIES:
   :header-args:julia::eval no
   :END:



Another option would be to store what is needed in as a variable in a
session and use =:eval no= before exporting, but it might not be very
practical for a book.

I have a small helper function that toggle eval yes or no at the file
level, if it is of any help.

HTH,

Jeremie

* toggle eval yes.

(defun toggle-global-eval ()
  "toggle :eval yes :evalno  "
  (interactive)
  (save-excursion
  (beginning-of-buffer)
  (search-forward-regexp ":eval ")
  (kill-word 1)
  (setq wd (car kill-ring))
  (if (equal "yes" wd)  
 (insert "no")
  (insert  "yes"))
  (org-ctrl-c-ctrl-c))
  (save-buffer)
  (message "global :eval was %s" wd)
  )




* file tag.org
#+title: org babel and select tags
#+select_tags: current

* Introduction
This section has some code that should not be evaluated on export.

#+name: introblock
#+begin_src julia :eval no
  a = [1, 2, 3]
#+end_src

* Description  :current:
I am writing this section right now.

* Conclusions
This will be worked on later.
#+name: conclusionblock
#+begin_src julia :eval no
  a = [4, 5, 6]
#+end_src





Is It Possible To Target ID And Classes With Org Mode Exports?

2022-02-18 Thread Samuel Banya
Hey there,

I'm curious, is it possible to specify a 'ID' or 'Class' attribute for a 
specific header, or link that you create in Org Mode?

Asking since I'm in the process of modifying a CSS stylesheet for a site, but 
would want more granular control to possible make containers with ID or 
classes, but it doesn't look possible in Org Mode by default.

Thanks,

Sam

Re: Question Regarding Creating HTML Style Buttons With Org Mode

2022-02-18 Thread Samuel Banya
To clarify, did you evaluate that code block on the org mode docs itself?

I ask because if I try to evaluate it, aka 'C-c C-c' on the '#begin_src' block, 
nothing happens.

And after I export the Org Doc to HTML, it still gives me that same error as 
before.

On Fri, Feb 18, 2022, at 3:51 PM, Juan Manuel Macías wrote:
> Juan Manuel Macías writes:
> 
> > If you evaluate the `org-ling-set-parameters' expression that I gave
> > you, you should get when exporting to html:
> >
> > 
> >  > formaction="http://www.sambanya.com/artgallery.html;>Art Gallery Page 
> > Link
> > 
> 
> P.S.: I forgot to tell you that if you want to visit the link also from the
> Org file itself, you must add this parameter to org-link-set-parameters:
> 
> :follow (lambda (path) (browse-url path))
> 
> Best regards,
> 
> jm
> 


Re: Unable to get current or via use-package

2022-02-18 Thread João Pedro de Amorim Paula
On 18 February 2022 18:32, João Pedro de Amorim Paula 
 wrote:

> I ended up not posting the link[1] I referred to in the first e-mail,

Welp, seems like I did it again... But no harm done this time, all the
necessary code was attached anyway :P

Forgetfully,

-- 
João Pedro de Amorim Paula
IT undergraduate at Universidade Federal do Rio Grande do Norte (UFRN)


Re: Unable to get current or via use-package

2022-02-18 Thread João Pedro de Amorim Paula
On 17 February 2022 16:00, "Loris Bennett"  wrote:

> What exactly would you like me to test?

I ended up not posting the link[1] I referred to in the first e-mail,
but since then I got back home and tested the functions provided there
seem to be doing what I expected. With it, I can force Emacs to download
a built-in package from ELPA and use it, instead of the built-in
version. I was afraid that I was only downloading it, but Emacs wasn't
actually loading it, but I couldn't test it because I have Emacs
28.0.91, which contains the latest versions of all the built-in packages
that are also in ELPA.

Given that, I have compiled Emacs 27 and ran it with the attached
init.el, and running M-x org-version tells me

Org mode version 9.5.2 (9.5.2-gfbff08 @ .../.emacs.d/elpa/org-9.5.2/)

It seems that calling my (require-package 'pkg 'force) is getting the
latest ELPA version available for built-in packages and using that
programatically, without having to use the Package List interface.

Regards,

-- 
João Pedro de Amorim Paula
IT undergraduate at Universidade Federal do Rio Grande do Norte (UFRN)



init.el
Description: application/emacs-lisp


Re: ob-powershell fixes, looking for original author

2022-02-18 Thread Monstara
Thanks a bunch, contacted him right away!

Mois


On Fri, Feb 18, 2022 at 4:13 PM John Kitchin 
wrote:

> I guess the author is here:
> https://list.orgmode.org/186354732.20201118123...@essential-it.be/
>
>
> John
>
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Fri, Feb 18, 2022 at 7:28 AM Monstara  wrote:
>
>> I already made a pull request. The repo has not been touched for about
>> five years, though.
>>
>> On Fri, Feb 18, 2022 at 1:56 PM John Kitchin 
>> wrote:
>>
>>> Try posting an issue on the original repo?
>>>
>>> On Fri, Feb 18, 2022 at 2:02 AM Monstara  wrote:
>>>
 Hello, I found an incomplete implementation
  of ob-powershell and fixed
 it .
 However, the original did not have a license, so it is not possible to
 proceed further, e.g. put it up on melpa.
 Is the original author here on the list? I think they do not have a
 contact address on github. Also posted on reddit to no avail.

 Regards,
 Mois

>>> --
>>> John
>>>
>>> ---
>>> Professor John Kitchin (he/him/his)
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>>
>>>


Re: Question Regarding Creating HTML Style Buttons With Org Mode

2022-02-18 Thread Juan Manuel Macías
Juan Manuel Macías writes:

> If you evaluate the `org-ling-set-parameters' expression that I gave
> you, you should get when exporting to html:
>
> 
>  formaction="http://www.sambanya.com/artgallery.html;>Art Gallery Page 
> Link
> 

P.S.: I forgot to tell you that if you want to visit the link also from the
Org file itself, you must add this parameter to org-link-set-parameters:

:follow (lambda (path) (browse-url path))

Best regards,

jm



Re: Question Regarding Creating HTML Style Buttons With Org Mode

2022-02-18 Thread Juan Manuel Macías
Samuel Banya writes:

> I tried to use this idea, but I'm not sure how to set the 'target' in
> your example:
> [[button:some target][This is a button]]
>
> For example, I tried this:
> [[button:http://www.sambanya.com/artgallery.html][Art Gallery Page
> Link]]
>
> But received this error:
> user-error: Unable to resolve link:
> "button:http://www.sambanya.com/artgallery.html;

Hi Samuel,

It's strange... I have tried your link, and it works fine for me. I have
made this video capture:

https://cloud.disroot.org/s/SaHR7jenTWxFWZt

If you evaluate the `org-ling-set-parameters' expression that I gave
you, you should get when exporting to html:


http://www.sambanya.com/artgallery.html;>Art Gallery Page 
Link


What version of org are you using?

(I don't have much knowledge of html or css, in any case. Just for the
basics).

Best regards,

Juan Manuel 



Re: Question Regarding Creating HTML Style Buttons With Org Mode

2022-02-18 Thread Samuel Banya
Also, how could you possible add an 'id' or 'class' attribute to an existing 
lOrg mode style hyperink?

I ask because I like your approach to just modify the stylesheet, but am 
unaware of how to actually utilize HTML's concept or 'id' or 'class' in an Org 
doc itself when using basic Org mode style hyperlinks [[link address][link 
description]]

Also, I ask because I found a similar video to just style the hyperlink in a 
similar fashion but would need to somehow assign a class or id value to the 
HTML element that's exported from the hyperlink itself:
Styling HTML Anchor Tag (Link) To Look Like A Button | CSS Tutorial 
(https://www.youtube.com/watch?v=p5nogm7ul6A) 

Thanks,

Sam

On Fri, Feb 18, 2022, at 2:59 PM, Samuel Banya wrote:
> I tried to use this idea, but I'm not sure how to set the 'target' in your 
> example:
> [[button:some target][This is a button]]
> 
> For example, I tried this:
> [[button:http://www.sambanya.com/artgallery.html][Art Gallery Page Link]]
> 
> But received this error:
> user-error: Unable to resolve link: 
> "button:http://www.sambanya.com/artgallery.html;
> 
> Thanks,
> 
> Sam
> 
> On Thu, Feb 17, 2022, at 5:10 PM, Juan Manuel Macías wrote:
>> Hi Samuel:
>> 
>> Samuel Banya writes:
>> 
>> > Is it possible to create HTML style buttons using Org Mode itself?
>> 
>> One possibility is to use a custom link. For example:
>> 
>> #+begin_src emacs-lisp
>>   (org-link-set-parameters "button"
>>:face '(:foreground "green" :underline t)
>>:export (lambda (path desc backend)
>>  (when (eq backend 'html)
>>(format "> formaction=\"%s\">%s" path desc
>> #+end_src
>> 
>> #+HTML_HEAD:  
>> .mybutton{background-color:#4CAF50;border:none;color:white;padding:15px32px;text-align:center;text-decoration:none;display:inline-block;font-size:18px;margin:4px2px;cursor:pointer;
>> 
>> [[button:some target][This is a button]]
>> 
>> NB: I have borrowed the style from here: 
>> https://www.w3schools.com/csS/css3_buttons.asp
>> 
>> Best regards,
>> 
>> Juan Manuel 
>> 
> 


Re: Question Regarding Creating HTML Style Buttons With Org Mode

2022-02-18 Thread Samuel Banya
I tried to use this idea, but I'm not sure how to set the 'target' in your 
example:
[[button:some target][This is a button]]

For example, I tried this:
[[button:http://www.sambanya.com/artgallery.html][Art Gallery Page Link]]

But received this error:
user-error: Unable to resolve link: 
"button:http://www.sambanya.com/artgallery.html;

Thanks,

Sam

On Thu, Feb 17, 2022, at 5:10 PM, Juan Manuel Macías wrote:
> Hi Samuel:
> 
> Samuel Banya writes:
> 
> > Is it possible to create HTML style buttons using Org Mode itself?
> 
> One possibility is to use a custom link. For example:
> 
> #+begin_src emacs-lisp
>   (org-link-set-parameters "button"
>:face '(:foreground "green" :underline t)
>:export (lambda (path desc backend)
>  (when (eq backend 'html)
>(format " formaction=\"%s\">%s" path desc
> #+end_src
> 
> #+HTML_HEAD:  
> .mybutton{background-color:#4CAF50;border:none;color:white;padding:15px32px;text-align:center;text-decoration:none;display:inline-block;font-size:18px;margin:4px2px;cursor:pointer;
> 
> [[button:some target][This is a button]]
> 
> NB: I have borrowed the style from here: 
> https://www.w3schools.com/csS/css3_buttons.asp
> 
> Best regards,
> 
> Juan Manuel 
> 


Re: [PATCH] c-csl : accept relative CSL filenames

2022-02-18 Thread Kaushal Modi
> It is already in the main branch, AFAIU. I assume you mean it should be
> back-ported to bugfix branch. If that's the case, I don't know. This is
> a new feature, and not a critical one: there are workarounds, as you
> found out.

Yes, sorry, I meant the bugfix branch.

> This should be available when Org 9.6 is released. I don't know when
> that will happen.

OK. It's not urgent. I can wait.

> I don't think Glenn Morris suggests using #'string-or-null-p, which
> would contradict his statement. He is pointing out that ":safe
> #'string-or-null-p" is better than ":safe t", even though but allowing
> arbitrary locations (strings in this case) is not safe anyway.

OK, I thought he referred to ":safe t" equivalent to any arbitrary
location. I don't understand how ":safe
#'string-or-null-p" can be potentially unsafe. So I will go by your judgment.

So, no action needed. Thanks! :)



Re: LaTeX letters in Org

2022-02-18 Thread Alan E. Davis
I had a set of three capture templates for memos, a number of years ago.
It was very convenient.  A letter is usually pretty much the same thing.  I
don't even know whether I have the original templates around anymore; it
should be pretty easy to implement.  IMHO, easier than dealing with all of
the header materials you are describing.  I think, anyway.

Two files were invoked: a header and a tail.  Then there were capture
template interactively filled addressee and whatever else.  One had a
letterhead.  It was, admittedly, a kludge.  A kludge that worked and saved
a lot of time.   For memos it's maybe more sensible, as they are quick
one-offs, for the most part.

Alan Davis

On Fri, Feb 18, 2022 at 9:03 AM Michael Eliachevitch <
m.eliachevi...@posteo.de> wrote:

> Hi Arne,
>
> > Alternatively add a capture-template that creates a letter. Then M-x
> > org-capture L (or such) would create a new letter prefilled with
> > everything you typically need.
>
> Thanks, weird I didn't think of it. Capture templates are awesome and
> powerful. Mostly I use them for some tasks, notes and journalling-type
> entries, not for long-form writing. But as a letters are usually short and
> writting in one session, capture-templates seem a good fit.
>
> Cheers, Michael
>
> --
> Michael Eliachevitch
> Public PGP Key:
> https://keyoxide.org/hkp/546908c782383ad0e7d894ec1b8f95c8125dce31
>
>

-- 
  "As we enjoy great advantages from the inventions of others, we *should
be glad of an opportunity to serve others* by any invention of ours, and
this we should do freely and generously."   ---Benjamin Franklin

  "This ignorance about the limits of the earth's ability to absorb
   pollutants should be reason enough for caution in the release
   of polluting substances."
   ---Meadows et al.   1972.  Limits to Growth
.
(p. 81)


Re: [PATCH] c-csl : accept relative CSL filenames

2022-02-18 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Can this commit[1] be merged into the main branch.

It is already in the main branch, AFAIU. I assume you mean it should be
back-ported to bugfix branch. If that's the case, I don't know. This is
a new feature, and not a critical one: there are workarounds, as you
found out.

This should be available when Org 9.6 is released. I don't know when
that will happen.

> I believe the behavior I see with this commit on main branch is kind
> of obvious and it should prevent this surprise failure for other users
> too.

It's obvious, but, as a new feature, it was pushed to main instead of
bugfix. Note that the error message is explicit anyway.

I'm not strictly opposed to back-porting it to bugfix, but is there
a compelling reason to break our workflow in this case?

> This works for both main and bugfix, but while doing this, I realized
> that even string values are not considered safe for this variable.
>
> Looking through git revisions, I found
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=41e67cff0d3bf27ffb57f9a230598b0385341517.
n>
> Earlier `:safe t' was added for `org-cite-csl-styles-dir'. Instead can
> we have `:safe #'string-or-null-p' as suggested by Glenn Morris in
> that commit?

I don't think Glenn Morris suggests using #'string-or-null-p, which
would contradict his statement. He is pointing out that ":safe
#'string-or-null-p" is better than ":safe t", even though but allowing
arbitrary locations (strings in this case) is not safe anyway.

Regards,
-- 
Nicolas Goaziou



Re: LaTeX letters in Org

2022-02-18 Thread Michael Eliachevitch

Hi Arne,


Alternatively add a capture-template that creates a letter. Then M-x
org-capture L (or such) would create a new letter prefilled with
everything you typically need.


Thanks, weird I didn't think of it. Capture templates are awesome and powerful. 
Mostly I use them for some tasks, notes and journalling-type entries, not for 
long-form writing. But as a letters are usually short and writting in one 
session, capture-templates seem a good fit.

Cheers, Michael

--
Michael Eliachevitch
Public PGP Key: 
https://keyoxide.org/hkp/546908c782383ad0e7d894ec1b8f95c8125dce31



Re: processing of babel blocks and select_tags

2022-02-18 Thread Eric S Fraga
Hi John,

On Friday, 18 Feb 2022 at 10:33, John Kitchin wrote:
> I guess that is just expanding the src blocks, not actually running
> them. I couldn't find where that happens though, it is early in the
> export process I think.

There are two types of lines that appear often in *Messages*:

: org-babel-exp process julia at position 65992...

: Wrote /tmp/babel-B5awWV/ob-input-0gUtuB

The first is quite straightforward although why any processing is being
done is unclear unless this just means checking the header arguments,
which would make sense.  For the second, although I am not entirely sure
what they refer to (as the tmp files disappear), I have a feeling that
this is where the problem is.  I think this refers to where data tables
are being incorporated into or processed for a src block even when not
necessary.

It's reassuring that it doesn't sound like I am doing anything silly so
I will look into the babel code to see if I can figure out how to get it
to short-circuit sooner...

> Maybe you can just use a preprocessing hook to export to org, which
> should only include the selected sections, then export that to what
> you want.

I guess that is what I was hoping #+SELECT_TAGS would do for me. ;-)

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.2-385-g37d8bc in Emacs 29.0.50



Re: processing of babel blocks and select_tags

2022-02-18 Thread John Kitchin
I guess that is just expanding the src blocks, not actually running them. I
couldn't find where that happens though, it is early in the export process
I think.

Maybe you can just use a preprocessing hook to export to org, which should
only include the selected sections, then export that to what you want.

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Fri, Feb 18, 2022 at 7:07 AM Eric S Fraga  wrote:

> Hello all,
>
> TL;DR: can I have org completely ignore src blocks in non-selected
> sections during export without using COMMENT?
>
> Longer version: I am in the process of writing a book.  I prefer to have
> all the content in one file and use SELECT_TAGS to limit the export (for
> formatting) to the current section I am working on.
>
> I have noticed that all org babel src blocks are processed in some way
> even if (a) they are not in a selected section and (b) have, for
> instance, ":eval no-export" set.  For some of these blocks, the
> processing time appears to be quite significant, e.g. if they have a
> ":var x=somebigtable", but I could be wrong about this, of course.
>
> I do not understand why these src blocks are processed at all.  Is there
> some way to stop them being processed?  I know I could "comment" out all
> other sections but that's a lot more work and messy than simply tagging
> the current section to be selected.
>
> Attached is a minimal example.  When I export, I see these messages:
>
> org-babel-exp process julia at position 162...
> org-babel-exp process julia at position 384...
>
> Thank you,
> eric
>
> --
> : Eric S Fraga, with org release_9.5.2-385-g37d8bc in Emacs 29.0.50
>


Re: LaTeX letters in Org

2022-02-18 Thread Dr. Arne Babenhauserheide

Michael Eliachevitch  writes:

> For this kind of short writing I'm always wondering whether doing it
> in org-mode is really worth it. I see a trade-of between the
> convenience of org-markup (e.g. emphasis markers, itemize lists,
> links, …), and the inconvience of adding literal latex to org-mode,
> which is just a bit more cumbersome than doing so in an actual latex
> file with a latex major mode*. Especiall since you don't use headers

For my website I added some custom commands so I can use M-x
draketo-software to start an article with a template.

Alternatively add a capture-template that creates a letter. Then M-x
org-capture L (or such) would create a new letter prefilled with
everything you typically need.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: [PATCH] c-csl : accept relative CSL filenames

2022-02-18 Thread Kaushal Modi
Hello Nicolas,

> Since you are probably busy, I implemented this on your behalf. The new
> behaviour is in main branch. Thank you.
>

Can this commit[1] be merged into the main branch. Locally on my
machine, I use org built from main and something like this was working
fine:

#+cite_export: csl cite/csl/ieee.csl

Here, "csl cite/csl/ieee.csl" is the csl path relative to the Org file.

But when the same ran on a CI where the stable Org version is used, it
failed with this error:

> Debugger entered--Lisp error: (user-error "Cannot handle relative style file 
> name: "cite/csl/...")
> signal(user-error ("Cannot handle relative style file name: "cite/csl/..."))
> user-error("Cannot handle relative style file name: %S" "cite/csl/ieee.csl")

I believe the behavior I see with this commit on main branch is kind
of obvious and it should prevent this surprise failure for other users
too.

This is my current workaround for the Org stable version:

#+cite_export: csl ieee.csl

# Local Variables:
# org-cite-csl-styles-dir: "./cite/csl/"
# End:

This works for both main and bugfix, but while doing this, I realized
that even string values are not considered safe for this variable.

Looking through git revisions, I found
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=41e67cff0d3bf27ffb57f9a230598b0385341517.

Earlier `:safe t' was added for `org-cite-csl-styles-dir'. Instead can
we have `:safe #'string-or-null-p' as suggested by Glenn Morris in
that commit?

Thanks!




[1]: 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c6186be3fd6c09a6deaa4edc1fbabbad0cb986d3



Re: ob-powershell fixes, looking for original author

2022-02-18 Thread John Kitchin
I guess the author is here:
https://list.orgmode.org/186354732.20201118123...@essential-it.be/


John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Fri, Feb 18, 2022 at 7:28 AM Monstara  wrote:

> I already made a pull request. The repo has not been touched for about
> five years, though.
>
> On Fri, Feb 18, 2022 at 1:56 PM John Kitchin 
> wrote:
>
>> Try posting an issue on the original repo?
>>
>> On Fri, Feb 18, 2022 at 2:02 AM Monstara  wrote:
>>
>>> Hello, I found an incomplete implementation
>>>  of ob-powershell and fixed it
>>> .
>>> However, the original did not have a license, so it is not possible to
>>> proceed further, e.g. put it up on melpa.
>>> Is the original author here on the list? I think they do not have a
>>> contact address on github. Also posted on reddit to no avail.
>>>
>>> Regards,
>>> Mois
>>>
>> --
>> John
>>
>> ---
>> Professor John Kitchin (he/him/his)
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>


[patch] give tables their own default placement in LaTeX export

2022-02-18 Thread Eric S Fraga
Hello,

attached is a small patch to give tables their own default placement in
LaTeX export.  Up to now, tables have used the default placement for
figures but figures and tables are very different creatures so it does
not make sense to have just one default for both.

This patch unfortunately could break documents (if people have changed
the default for figures, expecting that change to apply to tables as
well) but I see no way to avoid this.  So maybe not worth incorporating
but I leave that decision to others.

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.2-385-g37d8bc in Emacs 29.0.50
>From 77d94298beb3a1b215e7602beba46b81e827b3a1 Mon Sep 17 00:00:00 2001
From: Eric S Fraga 
Date: Fri, 18 Feb 2022 12:23:01 +
Subject: [PATCH] lisp/ox-latex.el: give tables their own placement default

* ox-latex.el (org-latex--org-table): define and use a new variable,
org-latex-default-table-position, for setting the default placement
option for the export of tables.
---
 etc/ORG-NEWS |  5 +
 lisp/ox-latex.el | 11 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 5a94e737e..506161937 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -100,6 +100,11 @@ argument.
 
 ** Miscellaneous
 
+*** Tables now have separate default placement option for LaTeX export
+
+Tables and figures now have separate settings for the default
+placement in LaTeX export.
+
 *** Styles are customizable in ~biblatex~ citation processor
 
 It is now possible to add new styles or modify old ones in ~biblatex~
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 5dda9b3ab..48efc7d98 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -120,6 +120,7 @@
 (:latex-caption-above nil nil org-latex-caption-above)
 (:latex-classes nil nil org-latex-classes)
 (:latex-default-figure-position nil nil org-latex-default-figure-position)
+(:latex-default-table-position nil nil org-latex-default-table-position)
 (:latex-default-table-environment nil nil org-latex-default-table-environment)
 (:latex-default-quote-environment nil nil org-latex-default-quote-environment)
 (:latex-default-table-mode nil nil org-latex-default-table-mode)
@@ -753,6 +754,14 @@ environment."
   :package-version '(Org . "9.0")
   :safe #'stringp)
 
+(defcustom org-latex-default-table-position "htbp"
+  "Default position for LaTeX tables."
+  :group 'org-export-latex
+  :type 'string
+  :version "26.1"
+  :package-version '(Org . "9.0")
+  :safe #'stringp)
+
 (defcustom org-latex-inline-image-rules
   `(("file" . ,(rx "."
(or "pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg")
@@ -3274,7 +3283,7 @@ Return new environment, as a string."
 		  (t nil
 	 (placement
 	  (or (plist-get attributes :placement)
-	  (format "[%s]" (plist-get info :latex-default-figure-position
+	  (format "[%s]" (plist-get info :latex-default-table-position
 	 (center? (if (plist-member attributes :center)
 		  (plist-get attributes :center)
 		(plist-get info :latex-tables-centered)))
-- 
2.30.2



Re: Pandoc and nested emhases

2022-02-18 Thread Juan Manuel Macías
Hi Maxim,

Max Nikulin writes:

> So formally this feature of pandoc is a bug (due to different kind of
> parser). It is the reason why a corpus of tests should exist in a
> format that can be easily imported from various programming languages.

Your conclusions seem logical to me. It may sound a bit surrealistic to
think that Pandoc is doing it wrong precisely for doing it "right", but...
if from Org's point of view this is not something specified in its
syntax, then here Pandoc makes a mistake parsing Org's syntax. All this
is very curious, indeed. I confess that before I did not see the need for
those corpus of tests very clearly, but this case has opened my mind.

Best regards,

Juan Manuel 



Re: ob-powershell fixes, looking for original author

2022-02-18 Thread Monstara
I already made a pull request. The repo has not been touched for about five
years, though.

On Fri, Feb 18, 2022 at 1:56 PM John Kitchin 
wrote:

> Try posting an issue on the original repo?
>
> On Fri, Feb 18, 2022 at 2:02 AM Monstara  wrote:
>
>> Hello, I found an incomplete implementation
>>  of ob-powershell and fixed it
>> .
>> However, the original did not have a license, so it is not possible to
>> proceed further, e.g. put it up on melpa.
>> Is the original author here on the list? I think they do not have a
>> contact address on github. Also posted on reddit to no avail.
>>
>> Regards,
>> Mois
>>
> --
> John
>
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>


Re: LaTeX letters in Org

2022-02-18 Thread Michael Eliachevitch

Hi Bill,

On 2022-01-29 at 12:39 -05, William Denton  wrote:


I wrote up how to use Org to write letters with the LaTeX letter class. Here's
the link in case anyone's interested:

https://www.miskatonic.org/2022/01/28/latex-letters-in-org/


Cool, I'll try to remember this for when I write my next letter. You write


I found it safest to use the #+latex: way of including LaTeX fragments. It 
doesn’t mess up the syntax highlight or the exporting.


When I have multiple lines of latex, I prefer including a latex export block 
over multiple `#+latex` lines, e.g.

   #+begin_export latex
   \closing{Sincerely,}
   \ps{P.S.  I need not tell you this is a secret.  Good-night again.}
   \end{letter}
   #+end_export

If you have `org-src-fontify-natively' to `t', this will even get you latex-syntax 
highlighting within the block, or if you find that too distracting, you can set that 
variable to `nil'. Sometimes it's useful to edit the latex-block in your latex major 
mode via `org-edit-export-block' ().

Currently the number of org export options you need is not too high, but if it 
grows you can move boilerplate of the letter itself via either `#+setupfile:` 
or just including a separate latex file. I'm think if there's a way to adapt 
the latex class

For not using the title, via not set `#+options: title:nil' ?

For this kind of short writing I'm always wondering whether doing it in 
org-mode is really worth it. I see a trade-of between the convenience of  
org-markup (e.g. emphasis markers, itemize lists, links, …), and the 
inconvience of adding literal latex to org-mode, which is just a bit more 
cumbersome than doing so in an actual latex file with a latex major mode*. 
Especiall since you don't use headers anyway. If I do some writing where the 
transition between notes to the final product is fluid, then it's a no-brainer 
and I would do so from org immediately. But because I just enjoy writing in 
org-mode so much more, I would probably also do it like you from now on.

* I can use auctex in latex export blocks, but I don't think latex language 
servers like digestif (https://github.com/astoff/digestif) work well with them.

Cheers,
Michael

--
Michael Eliachevitch
Public PGP Key: 
https://keyoxide.org/hkp/546908c782383ad0e7d894ec1b8f95c8125dce31



Re: Pandoc and nested emhases

2022-02-18 Thread Max Nikulin

On 18/02/2022 07:47, Juan Manuel Macías wrote:


Otherwise, if you export to LaTeX with pandoc (v. 2.14.2), the result is
(to my surprise) correct:

str="/lorem /ipsum/ dolor/"
pandoc -f org -t latex <<< $str
\emph{lorem \emph{ipsum} dolor}


2.5-3build2 from Ubuntu-20.04 works in the same way.

I like such behavior:

echo "/lorem =ip/ sum= dolor/" | pandoc -f org -t latex
\emph{lorem \texttt{ip/\ sum} dolor}

I know at least one more persons who will be happy as well:
https://list.orgmode.org/87pmtqp79s@web.de/T/#u 
mid:87pmtqp79s@web.de

(tracked as a confirmed bug at https://updates.orgmode.org/)

printf '/lorem\nipsum [[https://orgmode.org/,service][dolor]] ipsum/\n' 
| pandoc -f org -t latex

\emph{lorem ipsum \href{https://orgmode.org/,service}{dolor} ipsum}


Another (more abstract) doubt that arises, although I am not an expert
in matters of grammar and specifications. If nested emphases of the same
category are not possible in Org, should this be understood as a bug or
a feature? What implication does it have if a external parser, like
Pandoc, parses them just "fine"?


Nicolas Goaziou explicitly stated that current behavior is correct, see 
"[Patch] to correctly sort the items with emphasis marks in a list". 
Tue, 20 Apr 2021 22:37:31 +0200. mid:874kg0ae0k@nicolasgoaziou.fr

https://list.orgmode.org/874kg0ae0k@nicolasgoaziou.fr/

Nicolas confirmed it when I posted a similar example later in the 
following discussion:


Ihor Radchenko. c47b535bb origin/main org-element: Remove dependency on 
‘org-emphasis-regexp-components’

Thu, 18 Nov 2021 20:25:33 +0800. mid:87tug93b2a.fsf@localhost
https://list.orgmode.org/87tug93b2a.fsf@localhost/

My intuition says that the current parser behaviour is not correct. It
would make more sense to prioritise link over italics. However, it would
require a major change in the parser - instead of a single pass, the
parser may parse different types of objects sequentially.


Nicolas Goaziou. c47b535bb origin/main org-element: Remove dependency on 
‘org-emphasis-regexp-components’

Thu, 18 Nov 2021 13:35:19 +0100. mid:87y25l8wvs@nicolasgoaziou.fr
https://list.orgmode.org/87y25l8wvs@nicolasgoaziou.fr/

I disagree. Priority should be given to the first object being started.
This is, IMO, the only sane way to handle syntax.


And once more in response to my message:

Nicolas Goaziou. org parser and priorities of inline elements.
Sat, 27 Nov 2021 20:02:31 +0100. mid:87mtlppgl4@nicolasgoaziou.fr
https://list.orgmode.org/87mtlppgl4@nicolasgoaziou.fr/

I don't see any incentive to change the order objects are parsed, once
you know how Org does it. This is just a red herring. What is useful,
however, is to fontify them the way Org sees them.


So formally this feature of pandoc is a bug (due to different kind of 
parser). It is the reason why a corpus of tests should exist in a format 
that can be easily imported from various programming languages.





processing of babel blocks and select_tags

2022-02-18 Thread Eric S Fraga
Hello all,

TL;DR: can I have org completely ignore src blocks in non-selected
sections during export without using COMMENT?

Longer version: I am in the process of writing a book.  I prefer to have
all the content in one file and use SELECT_TAGS to limit the export (for
formatting) to the current section I am working on.

I have noticed that all org babel src blocks are processed in some way
even if (a) they are not in a selected section and (b) have, for
instance, ":eval no-export" set.  For some of these blocks, the
processing time appears to be quite significant, e.g. if they have a
":var x=somebigtable", but I could be wrong about this, of course.

I do not understand why these src blocks are processed at all.  Is there
some way to stop them being processed?  I know I could "comment" out all
other sections but that's a lot more work and messy than simply tagging
the current section to be selected.

Attached is a minimal example.  When I export, I see these messages:

org-babel-exp process julia at position 162...
org-babel-exp process julia at position 384...

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.2-385-g37d8bc in Emacs 29.0.50


tag.org
Description: Lotus Organizer


Re: ob-powershell fixes, looking for original author

2022-02-18 Thread John Kitchin
Try posting an issue on the original repo?

On Fri, Feb 18, 2022 at 2:02 AM Monstara  wrote:

> Hello, I found an incomplete implementation
>  of ob-powershell and fixed it
> .
> However, the original did not have a license, so it is not possible to
> proceed further, e.g. put it up on melpa.
> Is the original author here on the list? I think they do not have a
> contact address on github. Also posted on reddit to no avail.
>
> Regards,
> Mois
>
-- 
John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu