Re: [PATCH] Re: New source block results option for attaching file to node

2021-10-07 Thread Christopher M. Miles


Ryan Scott  writes:

> I've been working through a few different approaches. What's shaping up is 
> something more general, having a special value
> for directory parameters (i.e. 'attach) and auto-detection of link paths that 
> are in the attachment directory.
> The latest iterations don't move any files around, so can't actually enforce 
> the output directory. That makes it safer
> overall as with my initial patch if you were to return a path to something 
> you didn't want moved to your attachment
> directory you might get very surprising results.

I used to created a similar function extension called "ob-clojure-literate.el" 
for ob-clojure.el.
One functionality is to save plotting result image to a header argument :dir 
specified directory.
But it's a little complicated. Then later I found another solution through 
*header argument evaluation*:

#+begin_src clojure :results file link :dir "data/images" :file 
"ob-clojure-incanter-move.png" :var dir=(concat (file-name-directory 
(buffer-file-name)) "data/images/")
(use '(incanter core io charts stats))
(import '(java.io File))

(def hist (histogram (sample-normal 1000)))
(save hist "ob-clojure-incanter-move.png")
(.renameTo (File. "ob-clojure-incanter-move.png") (File. (str dir 
"ob-clojure-incanter-move.png")))
#+end_src

But this code has a disadvantage:

This solution breaks Literate Programming tangling concept by introduced 
un-reimplemented variable ~dir~.

>
> I'll post a new patch with a different approach in a little bit.
>
> On Mon, Oct 4, 2021 at 5:06 PM Christopher M. Miles  
> wrote:
>
>  Ihor Radchenko  writes: 
>
>  Greg Minshall  writes: 
>
>  i can imagine wanting to have input files and output files in separate 
> directories. (for ease in "make
>  clean", if for no other conceptual reason.) (but, probably i don't 
> understand.) 
>
>  I agree with this thought. We should separate two directories. 
>
>  Makes sense. Currently, there is :dir header arg to set working directory 
> (aka input files directory). Maybe we
>  can introduce something like :results-dir header arg to set the output 
> directory? It's value can be a directory
>  path or symbol 'attach. 
>
>  `:results file :results-dir 'attach` will be equivalent of `:results file 
> attach` in the patch proposed by Ryan
>  Scott. 
>
>  WDYT? 
>
>  I agree with this idea. Use :results-dir 'attach is better. 
>
>  Will the patch be updated? 
>
>  Best, Ihor 
>
>  <#secure method=pgpmime mode=sign>
>  -- 
>  [ stardiviner ]
> I try to make every word tell the meaning that I want to express.
>
> Blog: https://stardiviner.github.io/
> IRC(freenode): stardiviner, Matrix: stardiviner
> GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



<#secure method=pgpmime mode=sign>
-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


Re: Inequalities in math blocks

2021-10-07 Thread Rudolf Adamkovič
Max Nikulin  writes:

> If you submitted HTML file, you might suggest to open sources to make it 
> obvious that the mistake was not intentional.

One day! The university system switches to a read-only mode at the end of every 
week, and I cannot open-source anything for two years after the submission. I 
ended up posting an "errata" comment.

> […] "idf" typed in straight font instead of italics and to avoid additional 
> space between characters.

Yes, the three letters denote a function name, not a product of three 
variables. I simplified the snippet for the mailing list. In reality, I typed 
$\mathrm{idf}(t)>c$, as one should. Thank you for caring!

> It is matter of taste, but "{}" after "\in" looks a bit strange for me. 
> "$t\in q$ is even shorter, "$t \in q$", having the same length, is more 
> readable from my point of view.

Ha-ha! Yeah, I avoid spaces because they make me think for much too long about 
where to put them. Knuth would write $t\in q$, like you said, but that looks 
"unbalanced" to me. Of course, $t \in q$ looks best, but that sends me to back 
to the "whitespace paralysis" mode. Help wanted.

Rudy
-- 
"'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and if it 
were so, it would be; but as it isn't, it ain't. That's logic.'" -- Lewis 
Carroll, Through the Looking Glass

Rudolf Adamkovič 
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]



Re: Inequalities in math blocks

2021-10-07 Thread Rudolf Adamkovič
Timothy  writes:

> […] MathJax seems to take care of it […]

>From what I understand, MathJax does nothing, for it expects to exit inside of 
>valid HTML.

> […] but it looks like MathJax is also fine with  and . […]

Not that I know how ox-html works internally, but FYI, we can also use TeX's 
native \lt{} and \gt{}.

> As the maintainer for ox-html, I’ll take a look at this.

Thank you so much in advance!

Rudy
-- 
"Logic is a science of the necessary laws of thought, without which no 
employment of the understanding and the reason takes place." -- Immanuel Kant, 
1785

Rudolf Adamkovič 
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Bastien
Hi Bhavin,

Bhavin Gandhi  writes:

> I second the mention of something like "Confirmed" instead of email
> headers. I recently started reading Org mode list, reproducing bug
> reports, and using email headers is something I haven't managed to do yet
> (pending as I'm yet to set up some email client). Reading Woof!
> documentation made it clear about other ways than email headers
> though.

I added this section, with a small introduction to the current way of 
tracking bugs and patches:

https://orgmode.org/worg/org-maintenance.html#orgc84c8f5

If you want to improve it (shorter is better), please go ahead!

-- 
 Bastien



Re: Maintainer Duties

2021-10-07 Thread Daniel Fleischer
Daniel Fleischer [2021-10-06 Wed 18:05] wrote:

> Only 30 out of the 122 Elisp files have a maintainer. I'm interested in
> maintaining one or more files but I'm not sure what it means. Can we
> make it clearer, as perhaps other people are interested and want to
> know.

Thanks Bastien for documenting a good explanation of the role; for
reference, see section "What is the role of a maintainer?" in
https://orgmode.org/worg/org-maintenance.html.

-- 

Daniel Fleischer



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Bhavin Gandhi
Hi Ihor and Bastien,

On Thu, 7 Oct 2021 at 21:08, Bastien  wrote:
> Ihor Radchenko  writes:
>
> > We may want to put reference to Woof docs. Not all users are even able
> > to add headers to emails. Or we can simply recommend using word
> > "^Confirmed" in emails.

I second the mention of something like "Confirmed" instead of email
headers. I recently started reading Org mode list, reproducing bug
reports, and using email headers is something I haven't managed to do yet
(pending as I'm yet to set up some email client). Reading Woof!
documentation made it clear about other ways than email headers though.

> Yes - this needs to be better documented.  I'm currently working on
> the next version of Woof!, it will comes with many enhancements, I'll
> reference to the new documentation when I make the switch.
>

Awesome! Thanks.

-- 
Regards,
Bhavin Gandhi (bhavin192) | https://geeksocket.in



Re: [PATCH] [BUG] Org 9.5: org-goto UI seems broken

2021-10-07 Thread Max Nikulin

On 05/10/2021 23:32, Ihor Radchenko wrote:

Max Nikulin writes:

I tried come up with the reason why org-no-popup was used in the initial
implementation. I think, the reason is avoiding situation like what you
may see after running
(let ((pop-up-frames t)) (funcall-interactively #'org-goto))
So, removing the macro completely is not a good idea.

I have updated the patch that should work without dropping the macro.
See the attached.


Thank you, Ihor.

Your updated patch works in default configuration (-Q). I am not 
familiar with knobs of `display-buffer' function so I have no idea if 
someone may complain that such variant overrides his setup or works 
incorrectly with his preferences.






Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Bastien
Hi Ihor,

Ihor Radchenko  writes:

> Some comments:
>
>>> If you can reproduce a bug, reply to the original poster and add
>>> X-Woof-Bug: confirmed to your mail headers, and the bug will then be
>>> shown on updates.orgmode.org.
>
> We may want to put reference to Woof docs. Not all users are even able
> to add headers to emails. Or we can simply recommend using word
> "^Confirmed" in emails.

Yes - this needs to be better documented.  I'm currently working on
the next version of Woof!, it will comes with many enhancements, I'll
reference to the new documentation when I make the switch.

>> Maintain an Org file: If a file in the git repository does not have a
>> maintainer, and you want to help by maintaining it, please let us know
>> by sending an email to the mailing list.
>
> Also, it may be a good idea to clarify what maintainer duties are.
> People are asking:
> https://list.orgmode.org/m2pmsi6vob@gmail.com/T/#you

I added a few lines, I hope it answers some of the main questions.

Thanks!

-- 
 Bastien



Re: Inequalities in math blocks

2021-10-07 Thread Max Nikulin

On 07/10/2021 20:05, Timothy wrote:

Org should rewrite < and > to  and  to avoid broken HTML, or as < and  
in general.


I think we’ve drifted a bit to the differences in processing (where the `\( ... 
\)'
vs `$ ... $' comments are most pertinent), but as you say for valid HTML < and >
should be rewritten. I don’t think I’ve seen an issue because MathJax seems to
take care of it, but it looks like MathJax is also fine with  and .


"<" and ">" characters are valid only markup elements in HTML (part of 
tags, comments). MathJax interprets text content. Normally, to add text 
"<" or ">", "" or "" should be used in HTML sources. Browsers 
may pass "<" and ">" from source to text content if they are totally 
confused by invalid markup that does not resemble tags or something 
else. I do not think, it should be abused.


I cited MathJax docs just to show a temporary workaround till the bug 
will be fixed in Org. It is quite strange that Org properly converts 
"<>&" to entities in text but leaves them as is in math snippets. Unsure 
whether git history might clarify some reasons of such behavior.


On 06/10/2021 14:39, Rudolf Adamkovič wrote

I wrote the following: "[…] every term $t\in{}q$ with $idf(t)>c$ for
some constant $c$ […]", and the "idf(t) > c" part got exported as
"idf(t)". I cannot fix the paper at this point. Uh-oh!


If you submitted HTML file, you might suggest to open sources to make it 
obvious that the mistake was not intentional.


"$idf(t)>c$" means "i*d*f(t) > c". A bit more markup required to make 
"idf" typed in straight font instead of italics and to avoid additional 
space between characters.


It is matter of taste, but "{}" after "\in" looks a bit strange for me. 
"$t\in q$ is even shorter, "$t \in q$", having the same length, is more 
readable from my point of view.





[tip] Go to the org node from the attached directory

2021-10-07 Thread Juan Manuel Macías
Hi,

I often come across the following use case:

helm-locate leads me to a file named (for example) document.pdf, which
is in an attached folder of an Org node. I open the document and then I
would like to jump from there to the Org node. I don't know if anyone
has found any solutions for this or if there is any specific package. I
have come up with this poor man's solution: add a local variable to the
attached directory, which should contain the org node ID.

The function that adds the variable after I run org-attach:

#+begin_src emacs-lisp
  (defun my-org-attach/add-dir-variable ( _ignore)
(let* ((dir (org-attach-dir))
   (id (org-id-get-create))
   (default-directory dir))
  (unless (file-exists-p (concat dir "/" ".dir-locals.el"))
(save-window-excursion
  (add-dir-local-variable nil 'node-id id)
  (save-buffer)
  (read (current-buffer))
  (kill-buffer)
#+end_src

and then:

#+begin_src emacs-lisp
  (advice-add 'org-attach :after  #'my-org-attach/add-dir-variable)
#+end_src

and the function to jump from the attached folder to the org node:

#+begin_src emacs-lisp
  (defun my-org-attach/goto-node ()
(interactive)
(org-id-goto node-id))
#+end_src

(of course this only works if there is only one attached directory per
node).

Best regards,

Juan Manuel 



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Ihor Radchenko
Bastien  writes:

> Perhaps you can still carefully proofread
> https://orgmode.org/worg/org-contribute.html and enhance it?

Some comments:

>> If you can reproduce a bug, reply to the original poster and add
>> X-Woof-Bug: confirmed to your mail headers, and the bug will then be
>> shown on updates.orgmode.org.

We may want to put reference to Woof docs. Not all users are even able
to add headers to emails. Or we can simply recommend using word
"^Confirmed" in emails.

> Maintain an Org file: If a file in the git repository does not have a
> maintainer, and you want to help by maintaining it, please let us know
> by sending an email to the mailing list.

Also, it may be a good idea to clarify what maintainer duties are.
People are asking:
https://list.orgmode.org/m2pmsi6vob@gmail.com/T/#you

Best,
Ihor



Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Eric S Fraga
On Thursday,  7 Oct 2021 at 14:27, Uwe Brauer wrote:
> Yes, as the subject states org-->odt. 

Ummm, yes, I guess subject lines should be read... sorry for the noise.
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-63-g67b613
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Bastien
Hi Greg,

Greg Minshall  writes:

> in the absence of any other volunteer, i'd be happy to produce a merge
> for review.  (though it might take a few weeks.)

thanks a lot for volunteering, but I did the merge a few days ago.

Perhaps you can still carefully proofread
https://orgmode.org/worg/org-contribute.html and enhance it?

Thanks a lot,

-- 
 Bastien



Re: Inequalities in math blocks

2021-10-07 Thread Timothy
Hi Rudolf,

> I do not understand. As Max pointed out, inequalities break HTML export in 
> and as well.
>
> Example:
>
> - a - b>a
>
> Org should rewrite < and > to  and  to avoid broken HTML, or as < and 
>  in general.

I think we’ve drifted a bit to the differences in processing (where the `\( ... 
\)'
vs `$ ... $' comments are most pertinent), but as you say for valid HTML < and >
should be rewritten. I don’t think I’ve seen an issue because MathJax seems to
take care of it, but it looks like MathJax is also fine with  and .

As the maintainer for ox-html, I’ll take a look at this. I am exceptionally busy
over the next few weeks though, so there may be a brief delay.

All the best,
Timothy


Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Peter Neilson

On Thu, 07 Oct 2021 08:28:03 -0400, Uwe Brauer  wrote:


"JMM" == Juan Manuel Macías  writes:



Uwe Brauer writes:

I searched about google, but it seems that the only way to have a 10 or
11 pt font size is, again, by using styles. Am I right?



Yes, you are right. Word processors handle paragraph and character
styles. Anything that is not styled is applied by direct formatting,
manually, which is often bad practice.



Fun fact: 11pt (for example) in libreoffice or M$ Word is not the same
as 11pt in LaTeX. The reason is that TeX uses by default the classic
point "pt", traditionally used in English-speaking countries. 12pt=1pc
(pica). Word processors and DTP programs like InDesign or QuarkXpress
use the postscript point, which is somewhat higher. In TeX the
postscript point is called 'big point' (bp). There is also the didot
point, which in TeX is called "dd" (12dd = 1 cicero). See:
https://github.com/tweh/tex-units



With the calc-units package you can easily convert between these TeX
units in Elisp. For instance:



(require 'calc-units)



(calc-eval (math-convert-units (calc-eval "11texpt" 'raw) (calc-eval
"texbp" 'raw)))


Thanks, but it seems 11TeXpt-->10.95

So it is not that different.


Sometimes that kind of difference can cause minor sessions of  
tearing-out-the-hair, like when the expected pagination is off, with just  
one word hanging off into the wilderness of another separate page. Manual  
typesetting, back in the dark ages of hand-set lead type, or even  
Linotype, encountered those problems, too. What did the stymied typesetter  
do? He'd leave out words! Yes, really!! "This sentence no verb."




Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Juan Manuel Macías
Uwe Brauer writes:

> Thanks, but it seems 11TeXpt-->10.95
>
> So it is not that different.

In typography it's a significant difference. It's not dramatic, but it
can produce different results in a book using the same body text and the
same line spacing, same margins, page dims. etc. Also TeX uses more
decimals. It all depends on more factors, of course: the font or the
microtype properties of pdfTeX and LuaTeX, especially horizontal
scaling, which can also have a significant influence, when activated, on
the appearance of text and pagination.

In any case, what I said was nothing more than a fun typographic fact,
since most people think that there is only one type of point.

Best regards,

Juan Manuel 



Re: Inequalities in math blocks

2021-10-07 Thread Rudolf Adamkovič
Greg Minshall  writes:

> oof.  \(...\) is the way to go.

I do not understand. As Max pointed out, inequalities break HTML export in \( 
and \) as well.

Example:

- \(aa\)

Org should rewrite < and > to  and  to avoid broken HTML, or as \lt{} 
and \rt{} in general.

R+
-- 
"'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and if it 
were so, it would be; but as it isn't, it ain't. That's logic.'" -- Lewis 
Carroll, Through the Looking Glass

Rudolf Adamkovič 
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]



Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

> Uwe Brauer writes:
>> I searched about google, but it seems that the only way to have a 10 or
>> 11 pt font size is, again, by using styles. Am I right?

> Yes, you are right. Word processors handle paragraph and character
> styles. Anything that is not styled is applied by direct formatting,
> manually, which is often bad practice.

> Fun fact: 11pt (for example) in libreoffice or M$ Word is not the same
> as 11pt in LaTeX. The reason is that TeX uses by default the classic
> point "pt", traditionally used in English-speaking countries. 12pt=1pc
> (pica). Word processors and DTP programs like InDesign or QuarkXpress
> use the postscript point, which is somewhat higher. In TeX the
> postscript point is called 'big point' (bp). There is also the didot
> point, which in TeX is called "dd" (12dd = 1 cicero). See:
> https://github.com/tweh/tex-units

> With the calc-units package you can easily convert between these TeX
> units in Elisp. For instance:

> (require 'calc-units)

> (calc-eval (math-convert-units (calc-eval "11texpt" 'raw) (calc-eval
> "texbp" 'raw)))

Thanks, but it seems 11TeXpt-->10.95

So it is not that different.


smime.p7s
Description: S/MIME cryptographic signature


Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

> On Wednesday,  6 Oct 2021 at 17:18, Uwe Brauer wrote:
>> I searched about google, but it seems that the only way to have a 10
>> or 11 pt font size is, again, by using styles. Am I right?

> Are you referring to the export of an org document?  If so, what target?
> LaTeX has LaTeX_CLASS_OPTIONS in which you can set the size.

Yes, as the subject states org-->odt. So it seems a style is the answer.


smime.p7s
Description: S/MIME cryptographic signature


Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Greg Minshall
hi, Bastien,

in the absence of any other volunteer, i'd be happy to produce a merge
for review.  (though it might take a few weeks.)

cheers, Greg

> as the subject says: 
> 
> https://orgmode.org/contribute.html is very straightforward and
> https://orgmode.org/worg/org-contribute.html is very complete.
> 
> I think we should merge both pages into worg/org-contribute.org,
> the page that we recommand users to read in general.
> 
> The page would start with simple "calls to action" and progress
> toward more informative sections.
> 
> It's a delicate balance to have -- but having two pages for the
> same purpose isn't very good today.
> 
> Anyone?
> 
> -- 
>  Bastien
> 



Re: Inequalities in math blocks

2021-10-07 Thread Greg Minshall
Timothy,

> I’m thinking we should perhaps update the docs to more strongly
> recommend `\( ... \)' over `$ ... $'. So that someone coming from say,
> Markdown + $-math or (not-La)TeX doesn’t just go “cool, $ works, I’ll
> keep on using that”.

i think that would be a helpful change.

cheers, Greg



Re: Inequalities in math blocks

2021-10-07 Thread Timothy
Hi Greg,

> oof.  ... is the way to go.

I’m thinking we should perhaps update the docs to more strongly recommend `\( 
... \)'
over `$ ... $'. So that someone coming from say, Markdown + $-math or
(not-La)TeX doesn’t just go “cool, $ works, I’ll keep on using that”.

All the best,
Timothy


Re: Inequalities in math blocks

2021-10-07 Thread Greg Minshall
Rudolf,

> FYI: I have just discovered that this bug screwed up a paper I
> submitted to university this week. In the paper, I wrote the
> following: "[…] every term $t\in{}q$ with $idf(t)>c$ for some constant
> $c$ […]", and the "idf(t) > c" part got exported as "idf(t)". I cannot
> fix the paper at this point. Uh-oh!

oof.  \(...\) is the way to go.

cheers, Greg



Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Juan Manuel Macías
Uwe Brauer writes:

> I searched about google, but it seems that the only way to have a 10 or
> 11 pt font size is, again, by using styles. Am I right?

Yes, you are right. Word processors handle paragraph and character
styles. Anything that is not styled is applied by direct formatting,
manually, which is often bad practice.

Fun fact: 11pt (for example) in libreoffice or M$ Word is not the same
as 11pt in LaTeX. The reason is that TeX uses by default the classic
point "pt", traditionally used in English-speaking countries. 12pt=1pc
(pica). Word processors and DTP programs like InDesign or QuarkXpress
use the postscript point, which is somewhat higher. In TeX the
postscript point is called 'big point' (bp). There is also the didot
point, which in TeX is called "dd" (12dd = 1 cicero). See:
https://github.com/tweh/tex-units

With the calc-units package you can easily convert between these TeX
units in Elisp. For instance:

(require 'calc-units)

(calc-eval (math-convert-units (calc-eval "11texpt" 'raw) (calc-eval
"texbp" 'raw)))

Best regards,

Juan Manuel 



Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?

2021-10-07 Thread Eric S Fraga
Confirmed: this version does not work for me either.

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-63-g67b613
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: how to export to odt with 11 or 10 pt fonts? Default font setting

2021-10-07 Thread Eric S Fraga
On Wednesday,  6 Oct 2021 at 17:18, Uwe Brauer wrote:
> I searched about google, but it seems that the only way to have a 10
> or 11 pt font size is, again, by using styles. Am I right?

Are you referring to the export of an org document?  If so, what target?
LaTeX has LaTeX_CLASS_OPTIONS in which you can set the size.

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-63-g67b613
: Latest paper written in org: https://arxiv.org/abs/2106.05096