Re: [O] Equation references in HTML export

2018-01-10 Thread Thibault Marin

Hi,


> You may be right. In this case, we may use \eqref if MathJax is
> going to be used (like your initial patch did), and do the above
> otherwise.

OK, I think that would work.  To summarize, here are the different
outputs under MathJax and the other modes:

- MathJax mode:
  - Environment:
,
| \begin{align}
| \label{eq:org19c7f92}
| 1 + 1 = 0
| \end{align}
`
  - Link:
,
| link to \eqref{eq:org19c7f92}
`
- other modes, e.g. verbatim: (it is similar for the rest: dvipng,
  imagemagick, etc).:
  - Environment
,
| 
| 
| \begin{align}
| 1 + 1 = 0
| \end{align}
| 
| 
| 
| 1
| 
| 
`
  - Link:
,
| link to equation 1
`

The attached patch produces this on my test cases.

About the CSS caption:
> I'm not sure. Have you checked how captions in other parts of
> "ox-html.el"?

I looked at other structures:
- for figures, the caption is in a `figcaption' tag if HTML5 is used or
  in a paragraph, both under the figure,
- for tables, the caption is in a `caption' tag, at the top or bottom of
  the environment depending on `:html-table-caption-above',
- As far as I can tell, source blocks get no caption.

Since there does not appear to have a common convention, I think the
proposed output (see above with "equation-container", "equation" and
"equation-label" tags) would be fine, if nobody objects.  Some CSS puts
the label on the right side, as with LaTeX export or MathJax.  This only
applies to the non-MathJax modes.


> Do we need to rely on `org-latex-caption-above', which is LaTeX
> specific? We could instead extend `org-html-table-caption-above' to
> handle LaTeX environments, and rename it `org-html-caption-above'.

I think I misunderstood what the caption does in ox-latex.  Here, in the
MathJax case, just I need to insert the `\label' inside the latex
environment, e.g. `\begin{equation}\label{org21321}' similar to what
`org-latex-latex-environment' does.  The caption itself (the equation
number) is always on the right of the equation, regardless of the mode
(MathJax or other), so this is variable is not needed anymore.


I hope the patch looks better now.  I have a few remaining questions:

- The `org-html--is-math-environment' function relies on
  `org-latex-math-environments-re' from ox-latex for the numbering
  (numbering only equations, ignoring other environments).  Is it
  acceptable?
- In non-MathJax modes, I currently pre-process the latex environment to
  change equation environments to their * version,
  e.g. "\begin{equation}" -> "\begin{equation*}".  This is to prevent
  the latex environment from adding its own labeling to the rendered
  image.  This feels like a hack.  Is there a better way to achieve
  this?
- The `org-html--insert-latex-environment-label' (the function that
  inserts `\label' inside the environment also feels like a hack.  I
  originally wanted to re-use the equivalent latex code, but maybe this
  is simpler.  Do you think we can do better?
- In the image modes (e.g. dvipng), I removed the following comment: ";;
  Do not provide a caption or a name to be consistent with `mathjax'
  handling."  I am not sure what it means and whether I should be
  concerned about it.
- I think I have been with messing this file enough now that I should
  add tests.  I didn't see any tests for ox-latex or ox-html.  Is there
  a reason for that?


Please let me know if you have any comment.

Thanks,

thibault
>From 70f6e350615922007e08eec7deecdcdeadd0dc04 Mon Sep 17 00:00:00 2001
From: thibault 
Date: Sun, 7 Jan 2018 03:04:39 -0600
Subject: [PATCH] ox-html.el: Add label and number to equations in HTML export

* lisp/ox-html.el (org-html--wrap-latex-environment): New function
wrapping the content of latex environments in HTML  tags, adding
"id" and equation number.
(org-html--is-math-environment): New function determining if a latex
environment is a math environment.
(org-html-latex-environment): Use `org-html--wrap-latex-environment' to
wrap equation in HTML container (non-MathJax modes).  Make latex
environment unnumbered when compiling equations to images.  Insert latex
label in environment in MathJax mode.
(org-html-link): Calculate equation number limiting counter to equation
environments.  Use eqref for link when using MathJax
(org-html--make-unlabelled-latex-environment): New function to convert
latex math environments to unnumbered versions (e.g. "equation" ->
"equation*").
(org-html--insert-latex-environment-label): Insert latex \label inside
environment.
---
 lisp/ox-html.el | 136 +---
 1 file changed, 109 insertions(+), 27 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a3a7c5f92..0bb3eff0e 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -430,6 +430,18 @@ for the JavaScript code in this tag.
   .footdef  { margin-bottom: 1em; }
   .figure { padding: 1em; }
   

Re: [O] Org citations, CSL and citeproc-el

2018-01-10 Thread Richard Lawrence
Hi András and all: 

Sorry for the delay.  


András Simonyi  writes:

Another question is the syntax for specifying the bibliography 
to be used and, maybe, the location where the bibliography 
should be placed.  Org-ref (ab)uses links for these purposes as 
well. Was there a syntax proposal for these things too? 


As far as I know, there was not.  This was not settled because in 
order to settle it, you need to know a bit more about the backend. 
(Where is the citation data stored? do you have to get it from an 
external program? if so, which? etc. etc.)


I think there was some agreement that we can do this with option 
keywords.  There is an existing syntax for specifying 
bibliographies in contrib/ox-bibtex.el, which probably provides a 
good model:


#+BIBLIOGRAPHY: bibfilename stylename optional-options  When I was 
playing around with hooking up the citation syntax to an external 
citation processor, I was using something similar: I had keywords 
like


#+CSL_FILE: the-csl-style-file.csl +BIBDB: bibtex testdoc.bib 


in the header, and used

#+BIBLIOGRAPHY: here

to specify where the bibliography should be placed in the 
document.  That is obviously not the nicest solution, but the 
basic idea might be a good starting point. 



--
Best,
Richard



Re: [O] Orgmode repeater intervals with end date

2018-01-10 Thread Tory S. Anderson

I just tried

--8<---cut here---start->8---
   DEADLINE: <2018-04-19 Thu>
   <2018-01-10 Wed 16:00 +2w>
--8<---cut here---end--->8---

But unfortunately entries were still appearing after the 
deadline. 


ed...@openmail.cc writes:


Message: 8
Date: Tue, 09 Jan 2018 22:16:56 -0700
From: torys.ander...@gmail.com (Tory S. Anderson)
To: orgmode list 
Subject: [O] Orgmode repeater intervals with end date
Message-ID: <87incamgxj@byu.edu>
Content-Type: text/plain; format=flowed

Hi all,

When repeater intervals are set on on org dates (eg 
=<2018-01-10
Wed 16:00 
+2w>=) the 
output is 
exported 
nicely to 
ical and 
appears
nicely in agenda. Is there anyway to put an end-date on org 
dates

so that the +2w will not just continue forever?

I could use org-class, but then it wouldn't be exported to ical
nicely. I was hopefully with <2018-01-10 Wed 16:00
+2w>--<2018-04-10 Wed 16:00 +2w> but this just put the range as
counting every day in the interim. Is there an existing way to
have an end-date on a repeating cycle?

- Tory


Have you tried with DEADLINE:? I seem to remember to have read 
something like that somewhere. Don't trust me. If it helps, I am 
glad, but I am not sure.


-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email 
out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  15GB 
disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  




[O] Feature request: #+INCLUDE: with anchors

2018-01-10 Thread edgar

Hello,

I have seen this syntax in markdown (one of the many versions):

!listing
path/to/file.ext
start=ini_keyword end=end_keyword

Here, ~file.ext~ is a source file, and both ~ini_keyword~ and 
~end_keyword~ are text strings in the text delimiting what should be 
included (responsibility of the writer to make sure they are unique). I 
think that having something like this in Org would be nice. I am aware 
of the ~:lines~ option, but having something like this would not require 
an update of the numeric reference every time the referenced file 
changes.


Thanks for the great work!

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] Orgmode repeater intervals with end date

2018-01-10 Thread edgar

Message: 8
Date: Tue, 09 Jan 2018 22:16:56 -0700
From: torys.ander...@gmail.com (Tory S. Anderson)
To: orgmode list 
Subject: [O] Orgmode repeater intervals with end date
Message-ID: <87incamgxj@byu.edu>
Content-Type: text/plain; format=flowed

Hi all,

When repeater intervals are set on on org dates (eg =<2018-01-10
Wed 16:00 +2w>=) 
the output is exported nicely to ical and appears

nicely in agenda. Is there anyway to put an end-date on org dates
so that the +2w will not just continue forever?

I could use org-class, but then it wouldn't be exported to ical
nicely. I was hopefully with <2018-01-10 Wed 16:00
+2w>--<2018-04-10 Wed 16:00 +2w> but this just put the range as
counting every day in the interim. Is there an existing way to
have an end-date on a repeating cycle?

- Tory


Have you tried with DEADLINE:? I seem to remember to have read something 
like that somewhere. Don't trust me. If it helps, I am glad, but I am 
not sure.


-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] ox-bibtex

2018-01-10 Thread Adonay Felipe Nogueira
On a related topic, I wish there was a way for Org to export BibTeX
references to other formats besides LaTeX and PDF.

I once relied on some package, org-bibtex to do the trick along with a
set of Emacs Lisp scripts that were run with Babel ([1]), but found out
that I was doing more Lisp programming and actually embedding software
(a kind of functional data) to my presentations (a kind of
non-functional data) than doing my actual presentation, and also decided
to not use it anymore because people who were new to Org mode documents
and not tech experts would ask me how to do the same thing in their Org
mode documents and I would have to present them the monster I
created. :S

[1]
.

2018-01-10T13:01:59+ Colin Baxter wrote:
> I've overlooked the fact that ox-bibtex is in contribs of org-mode
> git. Perhaps it never was in the main lisp directory of org-mode. It
> does seem a rather basic package though.
>
> Best wishes.

-- 
- https://libreplanet.org/wiki/User:Adfeno
- Palestrante e consultor sobre /software/ livre (não confundir com
  gratis).
- "WhatsApp"? Ele não é livre. Por favor, veja formas de se comunicar
  instantaneamente comigo no endereço abaixo.
- Contato: https://libreplanet.org/wiki/User:Adfeno#vCard
- Arquivos comuns aceitos (apenas sem DRM): Corel Draw, Microsoft
  Office, MP3, MP4, WMA, WMV.
- Arquivos comuns aceitos e enviados: CSV, GNU Dia, GNU Emacs Org, GNU
  GIMP, Inkscape SVG, JPG, LibreOffice (padrão ODF), OGG, OPUS, PDF
  (apenas sem DRM), PNG, TXT, WEBM.



Re: [O] ox-bibtex

2018-01-10 Thread Colin Baxter
I've overlooked the fact that ox-bibtex is in contribs of org-mode
git. Perhaps it never was in the main lisp directory of org-mode. It
does seem a rather basic package though.

Best wishes.




Re: [O] [PATCH] Fix broken one-time continuous clock-in

2018-01-10 Thread Nicolas Goaziou
Hello,

Aliaksey Artamonau  writes:

> I noticed that when I try using C-u C-u C-u `org-clock-in', I get two
> clocks started: one using last clock out time, and one using current
> time. Clocking out then closes the last one and leaves the former one
> dangling. This doesn't happen though when I have
> `org-clock-continuously' simply set to `t' and use `org-clock-in'
> without any prefix. So I started looking what the cause was. When
> triple-prefix is used, `org-clock-in' binds `org-clock-continuously'
> to `t' temporarily and calls itself recursively. But then it continues
> the execution normally once the recursive call returns. And that's
> what seemingly breaks things. The attached patch addresses the issue
> by aborting after the recursive call is over. That seemed like the
> easiest way to address the issue, but if it's not in the "spirit" o
>  f org-mode, I'll be happy to work on improving the patch.

Applied. Thank you!

Regards,

-- 
Nicolas Goaziou



[O] ox-bibtex

2018-01-10 Thread Colin Baxter

It seems that the emacs-26.0.90 pretest, which uses org-version 9.1.2,
does not contain ox-bibtex. I thought ox-bibtex was introduced at
org-version 8.2.

Best wishes.




Re: [O] https://orgmode.org/ loads google font css through http

2018-01-10 Thread Bastien
Hi Xu Chunyang,

> The source of https://orgmode.org/ contains the following
>
> #+begin_src html
>  href="http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic|Droid+Sans=latin"
>  rel="stylesheet" type="text/css" />
> #+end_src
>
> My web browser (Chrome) refuses to load it and shows a warning in the
> address bar.

this should be fixed now, thanks for reporting this.

-- 
 Bastien



Re: [O] Incorrect references to LaTeX Listings

2018-01-10 Thread James Harkins
 On Tue, 09 Jan 2018 20:35:37 +0800 Eric S Fraga  wrote 
 
> Check org-latex-prefer-user-labels. 

OK, this works for me, thanks.

FWIW, org-latex-prefer-user-labels eluded me in the documentation. Now that you 
pointed me to it, I see the reason for the change, but I wouldn't have guessed 
it on my own.

I'll update org when I can.

In any case, thanks.
hjh




Re: [O] Tab-completion no longer works?

2018-01-10 Thread Rasmus
Diego Zamboni  writes:

> Hi Martin,
>
> I discovered this only yesterday, when I started using org-mode from a git
> checkout and the shortcuts stopped working. Turns out this functionality
> now has to be enabled by loading the org-tempo library:
> https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-tempo.el. In
> principle, you can reenable them just by adding (require 'org-tempo) in
> your Emacs config. The first time I did this, I was getting an error which
> seemed to be caused by the value of the org-structure-template-alist
> variable. I hadn't modified it myself, but I went into its customize screen
> and reset it to the default, and that fixed the problem.

Note that ‘org-structure-template-alist’ will change again.  There’s a
patch posted on December 21 that I have got to finish.

Rasmus

-- 
The Kids call him Billy the Saint




Re: [O] Tab-completion no longer works?

2018-01-10 Thread Martin Steffen
> "Diego" == Diego Zamboni  writes:

Diego> Hi Martin,

Diego> I discovered this only yesterday, when I started using
Diego> org-mode from a git checkout and the shortcuts stopped
Diego> working. Turns out this functionality now has to be enabled
Diego> by loading the org-tempo library:
Diego> https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-tempo.el. 
In

great. That did it. Thanks. Martin







Re: [O] Tab-completion no longer works?

2018-01-10 Thread Diego Zamboni
One more note: the published manual at
https://orgmode.org/org.html#Easy-templates is still not updated, but the
org-version of the manual mentions this at
https://code.orgmode.org/bzg/org-mode/src/master/contrib/manual.org#structure-templates


On Wed, Jan 10, 2018 at 9:00 AM, Diego Zamboni  wrote:

> Hi Martin,
>
> I discovered this only yesterday, when I started using org-mode from a git
> checkout and the shortcuts stopped working. Turns out this functionality
> now has to be enabled by loading the org-tempo library:
> https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-tempo.el. In
> principle, you can reenable them just by adding (require 'org-tempo) in
> your Emacs config. The first time I did this, I was getting an error which
> seemed to be caused by the value of the org-structure-template-alist
> variable. I hadn't modified it myself, but I went into its customize screen
> and reset it to the default, and that fixed the problem.
>
> Hope this helps,
> --Diego
>
>
> On Wed, Jan 10, 2018 at 8:26 AM, Martin Steffen 
> wrote:
>
>>
>>
>> Hi, Since recently ---I can't remember exactly since when--- some
>> completion-feature I liked does not work any more.
>>
>> By completion, I mean the expansion of
>>
>>>
>> to
>>
>> +BEGIN_QUOTE
>>   blabla
>> #+END_QUOTE
>>
>> or similar for including SRC or LATEX etc.
>>
>> This expansion no longer works. I tried to ``narrow down'' under which
>> circumstances it breaks..
>>
>> Now it turns out, that already the very first lines break it. Following
>> the manual I start the org-section in my .emacs as
>>
>> 
>> -
>> (setq load-path (cons "~/gnu/emacs/24/lisp/org-mode/lisp" load-path))
>> ;;; destroys tab completion
>> (setq load-path (cons "~/gnu/emacs/24/lisp/org-mode/contrib/lisp"
>> load-path))
>> ---
>>
>> If I comment-out the first line, the completion still works, if I
>> include the line and extend the path properly, the completion does not
>> work (of course, other problems arise then)
>>
>>
>>
>>
>> Any suggestions?
>>
>> Martin
>>
>>
>> - Versions
>> Emacs version: GNU Emacs 24.3.1
>> Org mode version 9.1.4
>> -
>>
>> I have though the same problem for
>>
>>
>> - Versions
>> Emacs version: GNU Emacs 25.3.1
>> Org mode version 9.1.3
>> -
>>
>>
>>
>>
>


Re: [O] Tab-completion no longer works?

2018-01-10 Thread Diego Zamboni
Hi Martin,

I discovered this only yesterday, when I started using org-mode from a git
checkout and the shortcuts stopped working. Turns out this functionality
now has to be enabled by loading the org-tempo library:
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-tempo.el. In
principle, you can reenable them just by adding (require 'org-tempo) in
your Emacs config. The first time I did this, I was getting an error which
seemed to be caused by the value of the org-structure-template-alist
variable. I hadn't modified it myself, but I went into its customize screen
and reset it to the default, and that fixed the problem.

Hope this helps,
--Diego


On Wed, Jan 10, 2018 at 8:26 AM, Martin Steffen  wrote:

>
>
> Hi, Since recently ---I can't remember exactly since when--- some
> completion-feature I liked does not work any more.
>
> By completion, I mean the expansion of
>
>
> to
>
> +BEGIN_QUOTE
>   blabla
> #+END_QUOTE
>
> or similar for including SRC or LATEX etc.
>
> This expansion no longer works. I tried to ``narrow down'' under which
> circumstances it breaks..
>
> Now it turns out, that already the very first lines break it. Following
> the manual I start the org-section in my .emacs as
>
> 
> -
> (setq load-path (cons "~/gnu/emacs/24/lisp/org-mode/lisp" load-path)) ;;;
> destroys tab completion
> (setq load-path (cons "~/gnu/emacs/24/lisp/org-mode/contrib/lisp"
> load-path))
> ---
>
> If I comment-out the first line, the completion still works, if I
> include the line and extend the path properly, the completion does not
> work (of course, other problems arise then)
>
>
>
>
> Any suggestions?
>
> Martin
>
>
> - Versions
> Emacs version: GNU Emacs 24.3.1
> Org mode version 9.1.4
> -
>
> I have though the same problem for
>
>
> - Versions
> Emacs version: GNU Emacs 25.3.1
> Org mode version 9.1.3
> -
>
>
>
>