Re: `org-emphasize' missing in the manual

2024-04-22 Thread Arash Esbati
Ihor Radchenko  writes:

> Makes sense.
> Would you be interested to submit a patch?
> You will need to modify doc/org-manual.org file in Org repository.
> See https://orgmode.org/worg/org-contribute.html

Thanks for your response.  I'm not really familiar with Org development,
but I hope the attached change fits the bill.  Please feel free to
adjust when necessary.

Best, Arash
>From 91704900ff6b0a299b9cba71124b984366489dac Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Tue, 23 Apr 2024 07:36:18 +0200
Subject: [PATCH] doc/org-manual.org: Document `org-emphasize'

* doc/org-manual.org (Emphasis and Monospace): Document the
command `org-emphasize'.

Link: https://lists.gnu.org/archive/html/emacs-orgmode/2024-04/msg00381.html
---
 doc/org-manual.org | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index ca1c9b482..aa18f7514 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11233,7 +11233,17 @@ but not any simpler
 You can make words =*bold*=, =/italic/=, =_underlined_=, ==verbatim==
 and =~code~=, and, if you must, =+strike-through+=.  Text in the code
 and verbatim string is not processed for Org specific syntax; it is
-exported verbatim.
+exported verbatim.  Org provides a single command as entry point for
+inserting the marker character.
+
+- {{{kbd(C-c C-x C-f)}}} (~org-emphasize~) ::
+
+  #+kindex: C-c C-x C-f
+  #+findex: org-emphasize
+  Prompt for a marker character and insert or change an emphasis.  If
+  there is an active region, change that region to a new emphasis.  If
+  there is no region, just insert the marker characters and position
+  the cursor between them.
 
 #+vindex: org-fontify-emphasized-text
 To turn off fontification for marked up text, you can set
-- 
2.44.0



Re: [DOC] Mismatch on doc regarding position of src block switches

2024-04-22 Thread João Pedro
Em segunda, 22/04/2024 às 18:12 (GMT), Ihor Radchenko  
escreveu:

> Thanks for reporting!
> Fixed, on bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a9275d5fd

Wonderful, thanks for the quick fix as well!

> We deliberately limit the number of details in the syntax spec.
> For now, we just say that lesser blocks can have arbitrary DATA at the
> begin line.

Ah ok, I was wondering whether that was intentional or not!

Cheers,

-- 
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)


Re: orgmode tables

2024-04-22 Thread Leo Butler

Beyond what Mark and Ihor have written, you can insert the column in the
table as you did, and then use M- or M- to move it. That
works for me with:

(insert (emacs-version))
GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo 
version 1.18.0)
 of 2024-02-26, modified by Debian

(insert (org-version))
9.6.23

and either terminal emacs (in an xterm) or gui emacs.

Leo

‘M-’ (‘org-table-move-column-left’)
 Move the current column left.

‘M-’ (‘org-table-move-column-right’)
 Move the current column right.

‘M-S-’ (‘org-table-delete-column’)
 Kill the current column.

‘M-S-’ (‘org-table-insert-column’)
 Insert a new column at point position.  Move the recent column and
 all cells to the right of this column to the right.


On Mon, Apr 22 2024, Jude DaShiell  wrote:

> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
> point in the last column of the table and do that, I'll get a column to
> the left which will be blank.  What I tried to ask is if I put point in
> the last column of the table what can I do to have a new column appear to
> the right of where point exists?
>
>
> --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
>
> On Mon, 22 Apr 2024, Leo Butler wrote:
>
>> (info "(org)Built-in Table Editor")
>>
>> ‘M-S-’ (‘org-table-insert-column’)
>>  Insert a new column at point position.  Move the recent column and
>>  all cells to the right of this column to the right.
>>
>> Leo
>>
>> On Mon, Apr 22 2024, Jude DaShiell  wrote:
>>
>> > when making a table in orgmode, I forgot to add three columns to the
>> > table.  What command or commands would I use to add columns to a table?
>> >
>> >
>> > --
>> >  Jude 
>> >  "There are four boxes to be used in defense of liberty:
>> >  soap, ballot, jury, and ammo.
>> >  Please use in that order."
>> >  Ed Howdershelt 1940.

Re: columnview dynamic block - different time summing behaviour for EFFORT and CLOCKSUM

2024-04-22 Thread Alexander Adolf
Ihor Radchenko  writes:

> [...]
> Calling `org-columns--clean-item' is a must to create a valid table.

True.

Additionally, it would seem advisable to call `org-quote-vert' on the
data, too, as `org-columns--clean-item' does not take care of vertical
bars? This is done in a previous step in `org-columns--capture-view',
however, so that the vertical bars get converted to "\vert" before the
formatting function gets called.

`org-link-heading-search-string', and `org-link-make-string' (both
called from the formatting function _after_ `org-columns--clean-item')
OTOH take care of the link's path and description parts being
appropriate for a link.

Thus, we have both layers of safeguarding: "link-safe" data is generated
from "table-safe" data.

> [...]
>> 2) Considering what happens when I do `org-store-link' and
>>`org-insert-link', it would seem more advisable to:
>> [...]
>
> I do not recall seeing `org-store-link' in the patches you submitted.
> So, I am not sure what you are talking about. May you elaborate?
> [...]

Apologies for not having been clear enough. With "when I do" I wanted to
refer to the "cleanup" of headline text when using `org-store-link' and
`org-insert-link' interactively.

I have moved the link generation to the formatting function as
mentioned. This also removes the need for any new function parameters,
since the formatting function receives the dynamic block's parameter
list, which contains a :link property when set in the #+BEGIN line.

Kindly find updated patches below. I hope to have succeeded in
addressing all your comments; that was my intention at least.


Many thanks and looking forward to your thoughts,

  --alexander


>From a36dba46a63d7d879bf2faf3c4c885b9ea3e28ad Mon Sep 17 00:00:00 2001
From: Alexander Adolf 
Date: Sun, 14 Apr 2024 18:14:05 +0200
Subject: [PATCH 1/2] lisp/org-colview.el: Add formatter parameter to colview
 dynamic block

* lisp/org-colview.el (org-dblock-write:column view): Factor out the
existing formatting code to new function
`org-columns-dblock-write-default', and honour new dblock parameter
:formatter for specifying a different formatting function.
(org-columns-dblock-write-default): New function with current
formatting code.
(org-columns--capture-view): Amend docstring to better explain the
format of the data being passed to the formatting function.
(org-clock-clocktable-formatter): New option to define a global
default formatting function, defaulting to the current behaviour.
* doc/org-manual.org (Capturing column view): Describe new :formatter
parameter.
* etc/ORG-NEWS (New option ~org-columns-dblock-formatter~): Announce
new option.
(=colview= dynamic block supports custom formatting function):
Describe new custom formatting function feature.
---
 doc/org-manual.org  |  7 +++
 etc/ORG-NEWS| 29 +
 lisp/org-colview.el | 41 +++--
 3 files changed, 71 insertions(+), 6 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index d24230568..000783772 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6014,6 +6014,13 @@ This dynamic block has the following parameters:
   Specify a column attribute (see [[*Column attributes]]) for the dynamic
   block.
 
+- =:formatter= ::
+
+  #+cindex: @samp{formatter}, dynamic block parameter
+  #+vindex: org-columns-dblock-formatter
+  A function to format column view data and insert it into the buffer.
+  See the option ~org-columns-dblock-formatter~.
+
 The following commands insert or update the dynamic block:
 
 - ~org-columns-insert-dblock~ ::
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index dbf849422..84ea7cde9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -999,6 +999,16 @@ even though it does not have its own ID.  By giving files top-level id
 properties, links to headlines in the file can also be made more
 robust by using the file id instead of the file path.
 
+*** New option ~org-columns-dblock-formatter~
+
+=colview= dynamic blocks now understand a new ~:formatter~ parameter
+to use a specific function for formatting and inserting the contents
+of the dynamic block. This new option can be used to set the global
+default formatting function that will be used for =colview= dynamic
+blocks that do not specify any ~:formatter~ parameter. Its default
+value (the new function ~org-columns-dblock-write-default~) yields the
+previous (fixed) formatting behaviour.
+
 ** New features
 *** ~org-paste-subtree~ now handles =C-u= and =C-u C-u= prefix arguments specially
 
@@ -1035,6 +1045,25 @@ Example:
 : | PROYECTO EMACS |
 : #+END:
 
+*** =colview= dynamic block supports custom formatting function
+
+The =colview= dynamic block understands a new ~:formatter~ parameter,
+which specifies a user-supplied function to format and insert the data
+in the dynamic block.
+
+A global default formatting function for =colview= dynamic blocks can
+be set via the new option ~org-columns-dblock-formatter~ which
+defaults to the 

Re: orgmode tables

2024-04-22 Thread Ihor Radchenko
Jude DaShiell  writes:

> Doesn't work here.  Just makes the terminal beep.

Using terminal Emacs?
Be aware that terminals cannot emulate certain key bindings, including
modifier + arrow keys. See https://orgmode.org/manual/TTY-Keys.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: orgmode tables

2024-04-22 Thread Jude DaShiell
Thanks Mark, that solution just caught me a mouse!


--
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.

On Mon, 22 Apr 2024, Mark Barton wrote:

> I always forget the command to add columns, so I usually just modify the 
> header row to add them to the end by using the "|" character to separate 
> them. Once I press tab, then Org will correct the table.
>
> started with two columns
> | one | two |
> |-+-|
> |   1 |   2 |
>
> add two more to the header line
> | one | two | three | four|
> |-+-|
> |   1 |   2 |
>
> press tab to have org correct the table.
> | one | two | three | four |
> |-+-+---+--|
> |   1 |   2 |   |  |
>
>
> > On Apr 22, 2024, at 12:17 PM, Jude DaShiell  wrote:
> >
> > As it happens c-s-right comes back with c-s-right is undefined.
> > This is emacs-nativecomp 29 on slint and slint is the international
> > version of slackware.
> > At this point I think orgmode could use is a tool to be run that will find
> > and let the user or installer know all of the undefined key combinations
> > in their current version of orgmode that are supposed to be defined along
> > with a percentage of the total keystrokes so a user or installer can take
> > further appropriate action.
> >
> >
> > --
> > Jude 
> > "There are four boxes to be used in defense of liberty:
> > soap, ballot, jury, and ammo.
> > Please use in that order."
> > Ed Howdershelt 1940.
> >
> > On Mon, 22 Apr 2024, Jude DaShiell wrote:
> >
> >> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
> >> point in the last column of the table and do that, I'll get a column to
> >> the left which will be blank.  What I tried to ask is if I put point in
> >> the last column of the table what can I do to have a new column appear to
> >> the right of where point exists?
> >>
> >>
> >> --
> >> Jude 
> >> "There are four boxes to be used in defense of liberty:
> >> soap, ballot, jury, and ammo.
> >> Please use in that order."
> >> Ed Howdershelt 1940.
> >>
> >> On Mon, 22 Apr 2024, Leo Butler wrote:
> >>
> >>> (info "(org)Built-in Table Editor")
> >>>
> >>> ‘M-S-’ (‘org-table-insert-column’)
> >>> Insert a new column at point position.  Move the recent column and
> >>> all cells to the right of this column to the right.
> >>>
> >>> Leo
> >>>
> >>> On Mon, Apr 22 2024, Jude DaShiell  wrote:
> >>>
>  when making a table in orgmode, I forgot to add three columns to the
>  table.  What command or commands would I use to add columns to a table?
> 
> 
>  --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
> >>
> >>
> >
>
>



Re: orgmode tables

2024-04-22 Thread Jude DaShiell
Doesn't work here.  Just makes the terminal beep.  That's on the line with
the column headings and on a first line with table values.  The table
starts at 80 characters width and after this is done ends with 80
characters width.  I've tried this with the gray arrow keys and also with
the arrow keys on the number pad and got identical results.


--
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.

On Mon, 22 Apr 2024, Dave Marquardt wrote:

> Jude DaShiell  writes:
>
> > m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
> > point in the last column of the table and do that, I'll get a column to
> > the left which will be blank.  What I tried to ask is if I put point in
> > the last column of the table what can I do to have a new column appear to
> > the right of where point exists?
>
> Try putting the point at the end of the line, *after* the last
> column. Works for me.
>
> >
> > --
> >  Jude 
> >  "There are four boxes to be used in defense of liberty:
> >  soap, ballot, jury, and ammo.
> >  Please use in that order."
> >  Ed Howdershelt 1940.
> >
> > On Mon, 22 Apr 2024, Leo Butler wrote:
> >
> >> (info "(org)Built-in Table Editor")
> >>
> >> ‘M-S-’ (‘org-table-insert-column’)
> >>  Insert a new column at point position.  Move the recent column and
> >>  all cells to the right of this column to the right.
> >>
> >> Leo
> >>
> >> On Mon, Apr 22 2024, Jude DaShiell  wrote:
> >>
> >> > when making a table in orgmode, I forgot to add three columns to the
> >> > table.  What command or commands would I use to add columns to a table?
> >> >
> >> >
> >> > --
> >> >  Jude 
> >> >  "There are four boxes to be used in defense of liberty:
> >> >  soap, ballot, jury, and ammo.
> >> >  Please use in that order."
> >> >  Ed Howdershelt 1940.
>
>
>



Re: orgmode tables

2024-04-22 Thread Dave Marquardt
Jude DaShiell  writes:

> As it happens c-s-right comes back with c-s-right is undefined.
> This is emacs-nativecomp 29 on slint and slint is the international
> version of slackware.
> At this point I think orgmode could use is a tool to be run that will find
> and let the user or installer know all of the undefined key combinations
> in their current version of orgmode that are supposed to be defined along
> with a percentage of the total keystrokes so a user or installer can take
> further appropriate action.

So is there some reason you're pressing C-S-Right? This key wasn't
discussed in this thread before now.

>
> --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
>
> On Mon, 22 Apr 2024, Jude DaShiell wrote:
>
>> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
>> point in the last column of the table and do that, I'll get a column to
>> the left which will be blank.  What I tried to ask is if I put point in
>> the last column of the table what can I do to have a new column appear to
>> the right of where point exists?
>>
>>
>> --
>>  Jude 
>>  "There are four boxes to be used in defense of liberty:
>>  soap, ballot, jury, and ammo.
>>  Please use in that order."
>>  Ed Howdershelt 1940.
>>
>> On Mon, 22 Apr 2024, Leo Butler wrote:
>>
>> > (info "(org)Built-in Table Editor")
>> >
>> > ‘M-S-’ (‘org-table-insert-column’)
>> >  Insert a new column at point position.  Move the recent column and
>> >  all cells to the right of this column to the right.
>> >
>> > Leo
>> >
>> > On Mon, Apr 22 2024, Jude DaShiell  wrote:
>> >
>> > > when making a table in orgmode, I forgot to add three columns to the
>> > > table.  What command or commands would I use to add columns to a table?
>> > >
>> > >
>> > > --
>> > >  Jude 
>> > >  "There are four boxes to be used in defense of liberty:
>> > >  soap, ballot, jury, and ammo.
>> > >  Please use in that order."
>> > >  Ed Howdershelt 1940.
>>
>>




Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-04-22 Thread Ihor Radchenko
Ihor Radchenko  writes:

> A gentle ping. This patch is still hanging in the air.

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Using search options in HTTP-style links

2024-04-22 Thread Ihor Radchenko
Joseph Turner  writes:

>> So, there is nothing stopping from creating an ad-hoc convention to
>> parse URL locators in links to PDFs or org files or whatnot.
>
> I'll need to dig a little more to see what changes would need to be made
> in order for org-store-link to store properly formatted search options
> with http: or hyper: links.  Currently, org-create-file-search-functions
> is only used when creating a file: link.

You can instead use :store link parameter. It takes precedence over
everything else in `org-store-link'.

>> However, the question about activating a major mode on web content is a
>> question to Emacs developers. It should be considered carefully, because
>> activating major modes may not be safe.
>
> hyperdrive.el activates a major mode with set-auto-mode when content is
> loaded over the network.  This behavior is on by default.  Do you have
> any advice about this?
>
> Should hyperdrive.el set untrusted-content to t?

I was mostly talking about commands like eww - I simply recall a similar
proposal being made about activating Org mode when the URL points to Org
file. That proposal has been rejected on the grounds of security. See
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58774

The case with hyperdrive.el is not the same.
You may want to discuss it on emacs-devel.

As for untrusted-content, there is no point using it now - it was
specifically introduced for Org mode. It may or may not become a part of
more general security framework in Emacs.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: orgmode tables

2024-04-22 Thread Dave Marquardt
Jude DaShiell  writes:

> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
> point in the last column of the table and do that, I'll get a column to
> the left which will be blank.  What I tried to ask is if I put point in
> the last column of the table what can I do to have a new column appear to
> the right of where point exists?

Try putting the point at the end of the line, *after* the last
column. Works for me.

>
> --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
>
> On Mon, 22 Apr 2024, Leo Butler wrote:
>
>> (info "(org)Built-in Table Editor")
>>
>> ‘M-S-’ (‘org-table-insert-column’)
>>  Insert a new column at point position.  Move the recent column and
>>  all cells to the right of this column to the right.
>>
>> Leo
>>
>> On Mon, Apr 22 2024, Jude DaShiell  wrote:
>>
>> > when making a table in orgmode, I forgot to add three columns to the
>> > table.  What command or commands would I use to add columns to a table?
>> >
>> >
>> > --
>> >  Jude 
>> >  "There are four boxes to be used in defense of liberty:
>> >  soap, ballot, jury, and ammo.
>> >  Please use in that order."
>> >  Ed Howdershelt 1940.




Re: orgmode tables

2024-04-22 Thread Mark Barton
I always forget the command to add columns, so I usually just modify the header 
row to add them to the end by using the "|" character to separate them. Once I 
press tab, then Org will correct the table.

started with two columns
| one | two |
|-+-|
|   1 |   2 |

add two more to the header line
| one | two | three | four|
|-+-|
|   1 |   2 |

press tab to have org correct the table.
| one | two | three | four |
|-+-+---+--|
|   1 |   2 |   |  |


> On Apr 22, 2024, at 12:17 PM, Jude DaShiell  wrote:
> 
> As it happens c-s-right comes back with c-s-right is undefined.
> This is emacs-nativecomp 29 on slint and slint is the international
> version of slackware.
> At this point I think orgmode could use is a tool to be run that will find
> and let the user or installer know all of the undefined key combinations
> in their current version of orgmode that are supposed to be defined along
> with a percentage of the total keystrokes so a user or installer can take
> further appropriate action.
> 
> 
> --
> Jude 
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo.
> Please use in that order."
> Ed Howdershelt 1940.
> 
> On Mon, 22 Apr 2024, Jude DaShiell wrote:
> 
>> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
>> point in the last column of the table and do that, I'll get a column to
>> the left which will be blank.  What I tried to ask is if I put point in
>> the last column of the table what can I do to have a new column appear to
>> the right of where point exists?
>> 
>> 
>> --
>> Jude 
>> "There are four boxes to be used in defense of liberty:
>> soap, ballot, jury, and ammo.
>> Please use in that order."
>> Ed Howdershelt 1940.
>> 
>> On Mon, 22 Apr 2024, Leo Butler wrote:
>> 
>>> (info "(org)Built-in Table Editor")
>>> 
>>> ‘M-S-’ (‘org-table-insert-column’)
>>> Insert a new column at point position.  Move the recent column and
>>> all cells to the right of this column to the right.
>>> 
>>> Leo
>>> 
>>> On Mon, Apr 22 2024, Jude DaShiell  wrote:
>>> 
 when making a table in orgmode, I forgot to add three columns to the
 table.  What command or commands would I use to add columns to a table?
 
 
 --
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.
>> 
>> 
> 




Re: `org-emphasize' missing in the manual

2024-04-22 Thread Ihor Radchenko
Arash Esbati  writes:

> I wonder why the function `org-emphasize' is missing in the manual.  I'm
> not an versed Org user, but it seems that this command is the entry
> point for users to mark up text.  So I suggest to add it to
>
>   12.2 Emphasis and Monospace[1],[2]
>
> incl. the keybinding "C-c C-x C-f".

Makes sense.
Would you be interested to submit a patch?
You will need to modify doc/org-manual.org file in Org repository.
See https://orgmode.org/worg/org-contribute.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Add C-u and C-u C-u prefix arguments to org-paste-subtree (was: Make org-paste-subtree more predictable and useful)

2024-04-22 Thread Ihor Radchenko
Samuel Wales  writes:

> so here i go again with new decription: i am taking an entry and putting a
> whole other entry into the middle of it at the same level like this:
>
> ===
> * a new idea i had
> regarding snicker snacks
> * jabberwoky
> some sophomoric comments on a poem
>
> more sophomoric comments
> ===
>
> becomes:
>
> ===
> * jabberwoky
> some sophomoric comments on a poem
>
> * a new idea i had
> regarding snicker snacks
>
> more sophomoric comments
> ===

Just call org-yank with prefix argument (C-u C-y):

Any prefix to this command will cause yank to be called directly with
no special treatment.  In particular, a simple C-u prefix will just
plainly yank the text as it is.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-22 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

>> What about something like
>>
>> #+cite_export: biblatex backend=bibtex,bibstyle=numeric
>>
> Just tested on a work document. It generates
> \usepackage[backend=bibtex,bibstyle=numeric]{biblatex}
> which is a perfectly valid options string for biblatex and yes,
> the PDF is generated without errors ;-)

Not for me.
With your latest patch, I tried to export the following to latex

#+cite_export: biblatex backend=bibtex,bibstyle=numeric
#+bibliography: bib.bib

Test [cite:@takemoto2006dissolution]

#+print_bibliography:

bib.bib:

@article{takemoto2006dissolution,
  title={Dissolution of stainless steels in molten lead-free solders},
  author={Takemoto, Tadashi and Takemoto, Masaharu},
  journal={Soldering \& surface mount technology},
  volume={18},
  number={3},
  pages={24--30},
  year={2006},
  publisher={Emerald Group Publishing Limited}
}

I am getting

\usepackage[style=backend=bibtex,bibstyle=numeric]{biblatex}

>> > BTW, I was thinking that maybe "\\`[^=]+=" may be better than matching
>> > style= anywhere in the options string...
>> > Open to discuss it...
>>
>> May you elaborate what exactly will be improved?
>>
>
> IMHO, the current solution of prepending "style=" forces the option string
> to be
> 

Re: [BUG] Some recent change broke :extend on headlines with background property [9.7-pre (release_9.6.26-1373-g5b0b7f @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]

2024-04-22 Thread StrawberryTea
Ihor Radchenko  writes:

> StrawberryTea  writes:
>
>> Hello. When I run the following code in `emacs -Q`, the background color
>> of the headline is not extended to the end of the line as expected. This
>> is a regression from the previous behavior and is caused by a recent
>> change in Org mode. I do not know which commit caused this issue.
>>
>> (straight-use-package 'org)
>>
>> (require 'org)
>> (load-theme 'leuven t)
>> ...
>
> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ad03e77b

Perfect, thank you for the quick fix!



Re: [BUG] Some recent change broke :extend on headlines with background property [9.7-pre (release_9.6.26-1373-g5b0b7f @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]

2024-04-22 Thread Ihor Radchenko
StrawberryTea  writes:

> Hello. When I run the following code in `emacs -Q`, the background color
> of the headline is not extended to the end of the line as expected. This
> is a regression from the previous behavior and is caused by a recent
> change in Org mode. I do not know which commit caused this issue.
>
> (straight-use-package 'org)
>
> (require 'org)
> (load-theme 'leuven t)
> ...

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ad03e77b

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: orgmode tables

2024-04-22 Thread Jude DaShiell
As it happens c-s-right comes back with c-s-right is undefined.
This is emacs-nativecomp 29 on slint and slint is the international
version of slackware.
At this point I think orgmode could use is a tool to be run that will find
and let the user or installer know all of the undefined key combinations
in their current version of orgmode that are supposed to be defined along
with a percentage of the total keystrokes so a user or installer can take
further appropriate action.


--
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.

On Mon, 22 Apr 2024, Jude DaShiell wrote:

> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
> point in the last column of the table and do that, I'll get a column to
> the left which will be blank.  What I tried to ask is if I put point in
> the last column of the table what can I do to have a new column appear to
> the right of where point exists?
>
>
> --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
>
> On Mon, 22 Apr 2024, Leo Butler wrote:
>
> > (info "(org)Built-in Table Editor")
> >
> > ‘M-S-’ (‘org-table-insert-column’)
> >  Insert a new column at point position.  Move the recent column and
> >  all cells to the right of this column to the right.
> >
> > Leo
> >
> > On Mon, Apr 22 2024, Jude DaShiell  wrote:
> >
> > > when making a table in orgmode, I forgot to add three columns to the
> > > table.  What command or commands would I use to add columns to a table?
> > >
> > >
> > > --
> > >  Jude 
> > >  "There are four boxes to be used in defense of liberty:
> > >  soap, ballot, jury, and ammo.
> > >  Please use in that order."
> > >  Ed Howdershelt 1940.
>
>



Re: orgmode tables

2024-04-22 Thread Jude DaShiell
m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
point in the last column of the table and do that, I'll get a column to
the left which will be blank.  What I tried to ask is if I put point in
the last column of the table what can I do to have a new column appear to
the right of where point exists?


--
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.

On Mon, 22 Apr 2024, Leo Butler wrote:

> (info "(org)Built-in Table Editor")
>
> ‘M-S-’ (‘org-table-insert-column’)
>  Insert a new column at point position.  Move the recent column and
>  all cells to the right of this column to the right.
>
> Leo
>
> On Mon, Apr 22 2024, Jude DaShiell  wrote:
>
> > when making a table in orgmode, I forgot to add three columns to the
> > table.  What command or commands would I use to add columns to a table?
> >
> >
> > --
> >  Jude 
> >  "There are four boxes to be used in defense of liberty:
> >  soap, ballot, jury, and ammo.
> >  Please use in that order."
> >  Ed Howdershelt 1940.



Re: Trailing whitespace after export snippets without a transcoder

2024-04-22 Thread Ihor Radchenko
Max Nikulin  writes:

>> I do not think that we need to handle this Org mode-wide (it will be
>> difficult and will likely cause breaking changes).
>
> I have not figured out why it may become a breaking changes and what 
> backends need blank lines inside paragraph. I would make stripping empty 
> lines default behavior with some option to disable this feature.

For example, consider an HTML exporter that aligns tags nicely and keeps
blank lines between markup blocks for readability.  If we remove such
blank lines unconditionally, it will be problematic.

>> See the attached tentative fix.
>
> Since zero width spaces are part of Org syntax, they need special treatment.

They are not a part of Org syntax, and we currently do not handle them
specially. They still work as escape-character simply because Org syntax
defines markup boundaries using a closed set of whitespace characters -
(rx (any " \t")). So, any non-tab non-space whitespace will be an
equivalent of zero-width space for all practical purposes.

>  8< 
> #+macro: empty (eval "")
>
> Some *bold*​@@comment: *@@ text.
> @@comment: line@@
> More /italic/​{{{empty}}} text.
> {{{empty}}}
> Last line.
>  >8 
>
> LaTeX export:
>  8< 
> Some \textbf{bold}​text.
> More \emph{italic}​ text.
>
> Last line.
>  >8 
>
> Notice visible space character disappeared after "bold".

I guess that I can change the condition to not include trailing space
from (rx whitespace eol) to (rx (any " \t|) eol).

See the attached updated version of the patch set.

> ... I am leaving up 
> to you to decide if empty line appeared due to a macro is a bug or a 
> feature. If I remember it correctly, your opinion is that a macro 
> expanding to multiple paragraphs is a valid one.

Yes. I do believe that we should keep macros as dumb as possible, so
that people can use them in the most flexible ways, including breaking
paragraphs, if so desired.

A more annoying one is

First line
@@comment:foo@@
last line.

vs.

First line
@@comment:foo
@@last line.

where we encounter the peculiarity of Org syntax with trailing tabs and
spaces included as part of the object, but not newlines.

But I do not see any good way to address this problem without rewriting
half of Org mode.

>From 229a563dc38e1fdfd63be2dfebb1a9e9023e44b2 Mon Sep 17 00:00:00 2001
Message-ID: <229a563dc38e1fdfd63be2dfebb1a9e9023e44b2.1713812419.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Sun, 21 Apr 2024 15:37:18 +0300
Subject: [PATCH v2 1/2] org-export-data: Handle trailing spaces when
 transcoder returns nil

* lisp/ox.el (org-export--keep-spaces): New helper function containing
logic about keeping spaces in place of removed object from
`org-export--prune-tree'.  The logic is modified to keep spaces in the
case when previous plain-string object ends with a whitespace, but not
" " or "\t".  This can happen, for example, when there is a trailing
zero-width space.  We do want to keep spaces in such scenario.
(org-export-data): When transcoder returns nil, handle
trailing spaces after an object the same way `org-export--prune-tree'
does.  Remove special handling of export snippets that unconditionally
keep their trailing spaces.
(org-export--prune-tree): Use the helper function.

Link: https://orgmode.org/list/87h6fwmgkm.fsf@localhost
---
 lisp/ox.el | 67 ++
 1 file changed, 42 insertions(+), 25 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index fc746950d..6f6689188 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1880,6 +1880,38 @@ (defun org-export-transcoder (blob info)
   (let ((transcoder (cdr (assq type (plist-get info :translate-alist)
 	(and (functionp transcoder) transcoder)
 
+(defun org-export--keep-spaces (data info)
+  "Non-nil, when post-blank spaces after removing DATA should be preserved.
+INFO is the info channel.
+
+This function returns nil, when previous exported element already has
+trailing spaces or when DATA does not have non-zero non-nil
+`:post-blank' property.
+
+When the return value is non-nil, it is a string containing the trailing
+spaces."
+  ;; When DATA is an object, interpret this as if DATA should be
+  ;; ignored (see `org-export--prune-tree').  Keep spaces in place of
+  ;; removed element, if necessary.  Example: "Foo.[10%] Bar" would
+  ;; become "Foo.Bar" if we do not keep spaces.  Another example: "A
+  ;; space@@ascii:*@@ character."  should become "A space character"
+  ;; in non-ASCII export.
+  (let ((post-blank (org-element-post-blank data)))
+(unless (or (not post-blank)
+(zerop post-blank)
+(eq 'element (org-element-class data)))
+  (let ((previous (org-export-get-previous-element data info)))
+	(unless (or (not previous)
+		(pcase (org-element-type previous)
+		  (`plain-text
+		   (string-match-p
+			(rx (any " \t") eos) previous))
+		  (_ (org-element-post-blank previous
+  ;; When previous element does 

[BUG] Some recent change broke :extend on headlines with background property [9.7-pre (release_9.6.26-1373-g5b0b7f @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]

2024-04-22 Thread StrawberryTea


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Hello. When I run the following code in `emacs -Q`, the background color
of the headline is not extended to the end of the line as expected. This
is a regression from the previous behavior and is caused by a recent
change in Org mode. I do not know which commit caused this issue.

(straight-use-package 'org)

(require 'org)
(load-theme 'leuven t)

(dolist (face '(org-level-1 org-level-2 org-level-3 org-level-4 org-level-5
org-level-6 org-level-7 org-level-8))
  (set-face-attribute face nil :extend t))

(setq org-fontify-whole-heading-line t)
(scratch-buffer)
(org-mode)
(insert "#+title: (Infty, 2) Reading Group
#+ROAM_TAGS: \"Quasicategories\"

* [2020-09-11 Fri] Links passed around in today's meeting
:PROPERTIES:
:CREATED_TIME: [2020-09-12 Sat 11:10]
:END:

** [[https://arxiv.org/abs/2006.07997][Internal enriched categories]]
:PROPERTIES:
:CREATED_TIME: [2020-09-12 Sat 11:11]
:END:

** [[https://www.i2m.univ-amu.fr/perso/dimitri.ara/files/qcatsup.pdf][Higher 
quasi-categories vs higher Rezk spaces]]
:PROPERTIES:
:CREATED_TIME: [2020-09-12 Sat 11:12]
:END:

** [[https://arxiv.org/pdf/1712.06469.pdf][∞-operads as analytic monads]]
:PROPERTIES:
:CREATED_TIME: [2020-09-12 Sat 11:13]
:END:

** [[https://arxiv.org/pdf/2002.01037.pdf][On lax transformations, adjunctions, 
and monads in (∞,2)-categories]]
:PROPERTIES:
:CREATED_TIME: [2020-09-12 Sat 11:14]
:END:

** [[https://acmbl.github.io/straight_slides.pdf][A modular proof of the 
straightening theorem]]
:PROPERTIES:
:CREATED_TIME: [2020-09-20 Sun 13:20]
:END:

* [2020-09-18 Fri 14:29] Links passed around
:PROPERTIES:
:CREATED_TIME: [2020-09-18 Fri 14:29]
:END:

** [[https://arxiv.org/abs/1502.06526][Twisted TQFTs]]
:PROPERTIES:
:CREATED_TIME: [2020-09-18 Fri 14:29]
:END:

** [[https://arxiv.org/pdf/2003.11757.pdf][Lax Gray tensor product for 
2-categories]]
:PROPERTIES:
:CREATED_TIME: [2020-09-18 Fri 14:30]
:END:

")


Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo 
version 1.18.0)
 of 2024-04-22
Package: Org mode version 9.7-pre (release_9.6.26-1373-g5b0b7f @ 
/home/st/.config/emacs/.local/straight/build-30.0.50/org/)

current state:
==
(setq
 org-special-ctrl-a/e t
 org-startup-align-all-tables t
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-clock-persist 'history
 org-indirect-buffer-display 'current-window
 org-preview-latex-image-directory 
"/home/st/.config/emacs/.local/cache/org/latex/"
 org-after-todo-state-change-hook '(parrot--todo-party)
 org-default-notes-file "/home/st/org/notes.org"
 org-directory "~/org/"
 org-list-demote-modify-bullet '(("+" . "-") ("-" . "+") ("*" . "+") ("1." . 
"a."))
 org-M-RET-may-split-line nil
 org-clock-in-resume t
 org-clock-out-remove-zero-time-clocks t
 org-roam-list-files-commands '(fd fdfind rg find)
 org-display-remote-inline-images 'download
 org-roam-db-node-include-function #[0 "\300\207" [t] 1]
 outline-minor-mode-use-buttons t
 org-roam-log-setup-hook '(org-roam--register-completion-functions-h)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-archive-subtree-save-file-p t
 org-id-locations-file "/home/st/org/.orgids"
 org-ai-talk-say-words-per-minute 210
 org-agenda-finalize-hook '(+org-exclude-agenda-buffers-from-workspace-h 
+org-defer-mode-in-agenda-buffers-h)
 org-roam-preview-function 'org-roam-preview-default-function
 org-log-done 'time
 org-agenda-window-setup 'current-window
 org-file-apps '((remote . emacs) (auto-mode . emacs) (directory . emacs) 
("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))
 org-mode-hook '(doom--setq-yas-triggers-in-field-for-org-mode-h 
turn-on-org-cdlatex er/add-org-mode-expansions
 (closure ((hook . org-mode-hook)) ( _)
  (progn
   (let ((tail '(after-change-major-mode-hook)))
(while tail
 (let ((hook (car tail)))
  (let ((tail (list #'(lambda ( _) (if (derived-mode-p 
'org-mode) (progn (setq tab-width 8)))
   (while tail (let ((func (car tail))) (add-hook hook func 
nil t) (setq tail (cdr tail)
  (setq tail (cdr tail)))
 )
)
   )
  (add-hook 'save-place-after-find-file-hook 
#'+org-make-last-point-visible-h nil t))
 +lookup--init-org-mode-handlers-h (closure (t) ( _) 
(add-hook 

Re: orgmode tables

2024-04-22 Thread Leo Butler
(info "(org)Built-in Table Editor")

‘M-S-’ (‘org-table-insert-column’)
 Insert a new column at point position.  Move the recent column and
 all cells to the right of this column to the right.

Leo

On Mon, Apr 22 2024, Jude DaShiell  wrote:

> when making a table in orgmode, I forgot to add three columns to the
> table.  What command or commands would I use to add columns to a table?
>
>
> --
>  Jude 
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.

Re: [DOC] Mismatch on doc regarding position of src block switches

2024-04-22 Thread Ihor Radchenko
João Pedro  writes:

> I've noticed that in (org)Literal Examples[0], when documenting the switches 
> for example and source blocks, it is mentioned that they should be placed at 
> the *end* of the #+BEGIN line, while both in (org)Structure of Code Blocks[1] 
> and the Org Syntax document[2] the switches are documented to be placed right 
> after the language (when appropriate), which is the correct placement for it.

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a9275d5fd

> I've also noticed that the Org Syntax for blocks (greater or lesser) don't 
> mention example blocks having optional switches.

We deliberately limit the number of details in the syntax spec.
For now, we just say that lesser blocks can have arbitrary DATA at the
begin line.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



orgmode tables

2024-04-22 Thread Jude DaShiell
when making a table in orgmode, I forgot to add three columns to the
table.  What command or commands would I use to add columns to a table?


--
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.



Re: [BUG] Agenda query trailing spaces [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2024-04-22 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Confirmed
>
> However, this behaviour seems to be partially intentional. It was
> explicitly introduced in 774964adb. So, the fix may not be
> straightforward. Someone needs to study the relevant agenda code.

Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0db82ee8f

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Feedback on the new "feature" system in org-export (was: [Pre-PATCH] Overhaul of the LaTeX preview system)

2024-04-22 Thread Ihor Radchenko
Timothy  writes:

> After months of work, Karthink and I have prepared a rather large patch-set
> completely overhauling the LaTeX preview system. I hope to have a patch set
> shortly, but in the mean time it would be good to get some more people testing
> this.
>
> To test this feature, please check out the `dev' branch of
>  (it’s the default branch). There 
> are
> also some other changes there currently, but I don’t think anything is broken.

Now, after the last blocker with odt export has been addressed, I am
starting to review the patch formally for merging upstream.

One of the new core mechanisms introduced in the patch is the
"feature" system for building export preambles. It allows building the
preambles selectively, depending on the document contents and current
export configuration.

The feature is mostly designed for use in latex/beamer export where
every additional \usepackage call adds to the compile time. Not to
mention the problem when we have to limit the latex packages we use by
default in order to not create incompatibilities with user packages.

For now, I will provide some high-level feedback:

1. After not following latex-preview feature development for a while,
   with a fresh mind, I find the basic terminology rather confusing.

   When reading the new "Export features" section of the manual, and
   looking through the code, I feel that a more appropriate name for the
   "features" would be "templates" - what you call "feature
   implementations" is, at the end, very similar to Emacs skeletons, but
   with a twist that the template order is not fixed:

   (cl-defstruct (org-export-backend (:constructor org-export-create-backend)
  (:copier nil))
 ... template-conditions templates)

2. While reading the new manual section, I have an impression that the
   feature/template system can be used in any export backend and that
   document preamble can be customized by users locally, on top of the
   backend.

   However, it is only really true for ox-latex and its derived
   backends. If one, for example, tries to use
   org-export-update-features on 'html (for example, to include some JS
   library conditionally), it will not work.

   I thus feel that the newly added section does not really belong to
   the user manual. Rather to
   https://orgmode.org/worg/dev/org-export-reference.html

3. What could make sense to expose to users (and to add to the user
   manual) is the means to customize the document preamble
   conditionally.

   Now, we have `org-latex-classes' with its awkward syntax of
   
[DEFAULT-PACKAGES]  \usepackage statements for default packages
[NO-DEFAULT-PACKAGES]   do not include any of the default packages
[PACKAGES]  \usepackage statements for packages
[NO-PACKAGES]   do not include the packages
[EXTRA] the stuff from #+LATEX_HEADER(_EXTRA)
[NO-EXTRA]  do not include #+LATEX_HEADER(_EXTRA) stuff

   I think that it could be a good idea to support an alternative syntax
   making use of feature/template system.

   Same thing for similar customizations like
   `org-cite-csl-latex-preamble' and `org-latex-engraved-preamble'

   Ideally, we should supply users with a list of templates for the most
   commonly used latex packages, formalizing LaTeX package dependencies
   and conflicts

4. The overall design of the feature/template system is solid, and we can
   extend it in case we need to. However, I am slightly concerned that
   the only user of the new system is ox-latex. I believe that we can
   test the current API better if we try to use it for real in several
   scenarios. I have the following use-cases in mind:

   + `org-latex-classes' and similar user-defined templates
   + `org-latex-template'
   + `org-beamer-template' -> this one is important as we can partially
  inherit from the latex template.
   + `org-html-template' -> something non-LaTeX

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: MathML and ODT export: inline possible?

2024-04-22 Thread Max Nikulin

On 22/04/2024 16:05, Fraga, Eric wrote:

On Friday, 19 Apr 2024 at 23:19, Max Nikulin wrote:

MathJax may be your friend. LaTeXML and katex do not add  as well.


MathJax works well but for websites; my context is that I need to
prepare a Word document to share with others.


I have not tried it, but I suggested MathJax expecting that the 
following features may be combined in a small custom CLI tool:

- MathML,
- Server-side rendering.

Concerning pandoc, perhaps it is possible to create a Lua filter to 
handle some specific cases. Again, I have seen some buzzwords in docs 
and discussions, but I have not tried it myself.


Certainly my expectations in respect to LaTeXML failed. I believed that 
a tool used for https://dlmf.nist.gov/ should be close to perfect. The 
reason might be that it is tested with browsers, but not with office 
software. LaTeX3 code appeared to be a severe performance test for engines.





Re: Trailing whitespace after export snippets without a transcoder

2024-04-22 Thread Max Nikulin

On 21/04/2024 20:00, Ihor Radchenko wrote:

Max Nikulin writes:

  A space@@ascii:*@@ character.


Hmm. We actually have a similar scenario in `org-export--prune-tree'
with a slightly different logic - only keep spaces when previous object
does not have any.


I like this idea. At first I even believed that backend-specific code 
would not be necessary.



I do not think that we need to handle this Org mode-wide (it will be
difficult and will likely cause breaking changes).


I have not figured out why it may become a breaking changes and what 
backends need blank lines inside paragraph. I would make stripping empty 
lines default behavior with some option to disable this feature.



See the attached tentative fix.


Since zero width spaces are part of Org syntax, they need special treatment.

 8< 
#+macro: empty (eval "")

Some *bold*​@@comment: *@@ text.
@@comment: line@@
More /italic/​{{{empty}}} text.
{{{empty}}}
Last line.
 >8 

LaTeX export:
 8< 
Some \textbf{bold}​text.
More \emph{italic}​ text.

Last line.
 >8 

Notice visible space character disappeared after "bold". I am leaving up 
to you to decide if empty line appeared due to a macro is a bug or a 
feature. If I remember it correctly, your opinion is that a macro 
expanding to multiple paragraphs is a valid one.






Re: Using org-latex-preview in other major modes

2024-04-22 Thread Tony Zorman
On Sun, Apr 21 2024 20:41, Karthik Chikmagalur wrote:
>> Anyways, before I put this off for much longer, there is some more code
>> attached. Live previews (and general environments) work now, and besides
>> the above mentioned points there were no new surprises waiting—at least
>> for getting the basic functionality to work.
>
> Thank you for the update!  This looks promising.  I'll test it when I
> have time.
>
>> I did notice that precompilation being a bit flaky. In the end, this
>> was the result of importing local packages; with the precompilation
>> happening somewhere in /tmp/, access to these files wasn't given.
>> haven't looked too closely into this—and it's probably a use-case
>> that's specific to LaTeX-mode—but it seems worth considering
>
> Sorry, I should have mentioned this in my original write-up.  There is a
> reason for this, as explained below.  This issue should not be happening
> in most cases though, so I'll need more details to help.
>
>> (lots of people carry one big style file around that they include in
>> all of their projects).
>
> This is true of Org mode files that are intended for LaTeX export too,
> but we avoid this problem in Org.
>
> 1. Why we precompile in /tmp:
>
>Precompilation is a blocking operation, so we want to do it as
>infrequently as possible. Imagine if LaTeX previews in every Org
>buffer/file you opened required a precompile step that blocked Emacs
>for 3 seconds.
>
>Precompiled dump files are identified by a hash that includes the
>preamble and a default-directory. If we precompile in /tmp (or some
>other fixed directory), we can reuse dump files for all Org buffers
>that have the same preamble, irrespective of where they're located.
>
>Precompiled files are stored in org-persist and don't expire for a
>long time.  So we'd like to avoid generating loads of them, and reuse
>them whenever possible.
>
>1a. Why is precompilation a blocking operation?
>
>It doesn't have to be, but including it in the async chain is a
>little annoying.  It can be made async in the future.
>
> 2. What happens if the user includes a directory-local .sty, .cls or
>other tex files in the header?
>
>When precompiling, we check the header to see if it has an \input{}
>or \include{} statement.  If it does, we assume that there are local
>dependencies and precompile it in the default-directory.  See
>org-latex-preview--create-tex-file for the implementation of this
>logic.
>
>Is there some other common way that a LaTeX file can have local
>dependencies?

\usepackage accepts relative paths, although I think it will generate a
warning since the package called will provide «pkg» instead of
.relative/path/to/«pkg». Either way, it's not uncommon to see things
like

\usepackage[opt1, opt2=lf]{style/nested/too/deeply/style}

Modulo Windows, one might check for slashes in \usepackage invocations,
since I don't think TeX packages can have those.

(Users *should* really add /path/to/«pkg» to LaTeX's search path, but
that will never happen :))

> 3. How to force precompilation to occur in the default-directory instead
>of in /tmp:
>
>Based on 1 and 2, the easiest way would be to add an \input{} or
>\include{} statement to the preamble. The current test is very
>simple, you can even place it in a LaTeX comment and it should work.

This does indeed work; thanks!

  Tony

-- 
Tony Zorman | https://tony-zorman.com/



Re: MathML and ODT export: inline possible?

2024-04-22 Thread Fraga, Eric
On Friday, 19 Apr 2024 at 23:19, Max Nikulin wrote:
> MathJax may be your friend. LaTeXML and katex do not add  as well.

MathJax works well but for websites; my context is that I need to
prepare a Word document to share with others.
 
> Actually I asked to confirm that your troubles are not with proper
> escaping of input to a converter.

I don't think so but cannot be sure.

Anyway, with the explicit .mml file, everything is good.  Thanks for
your help.

eric

-- 
: Eric S Fraga, with org release_9.6.19-1230-g407a55 in Emacs 30.0.50


`org-emphasize' missing in the manual

2024-04-22 Thread Arash Esbati
Hi all,

I wonder why the function `org-emphasize' is missing in the manual.  I'm
not an versed Org user, but it seems that this command is the entry
point for users to mark up text.  So I suggest to add it to

  12.2 Emphasis and Monospace[1],[2]

incl. the keybinding "C-c C-x C-f".

Best, Arash

Footnotes:
[1]  https://orgmode.org/manual/Emphasis-and-Monospace.html
[2]  
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/doc/org-manual.org#n11222



Re: strange export problem with a file: link

2024-04-22 Thread Fraga, Eric
On Saturday, 20 Apr 2024 at 12:25, Ihor Radchenko wrote:
> Fixed, on main.

Thank you!

-- 
: Eric S Fraga, with org release_9.6.23-1320-g1be2f9 in Emacs 30.0.50