Re: [O] Problem exporting file with code references

2016-08-28 Thread Nicolas Goaziou
Hello,

Thibault Marin  writes:

> I am trying to run the last example on the documentation page:
> http://orgmode.org/manual/Literal-examples.html and I am running into a
> problem.  The following is the full org file I am trying to export:
>
> ---
> #+BEGIN_SRC emacs-lisp -n -r
> (save-excursion  (ref:sc)
>(goto-char (point-min)))  (ref:jump)
> #+END_SRC
> In line [[(sc)]] we remember the current position.  [[(jump)][Line
> (jump)]] jumps to point-min.
> ---
>
> When trying to export (I tried html or latex), I get the following error
> message: 'user-error: Unable to resolve link: "sc"'.
>
> Trying to investigate, it appears that the `org-babel--normalize-body'
> function (ob-core.el) removes the references "(ref:sc)" and "(ref:jump)"
> from the code block prior to execution.  This happens during the call to
> `org-babel-exp-process-buffer' when `org-export-babel-evaluate' is
> non-nil (in ox.el).  From that point, the source block content does not
> contain the "(ref:sc)" and "(ref:jump)" text.  Consequently, when
> reaching the `org-export-resolve-coderef' function, the link is not
> found in the code and the error is returned.

This is now fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? org-export-unravel-code inserts a spurious newline at end of inline-src-block elements

2016-08-28 Thread Nicolas Goaziou
Hello,

> Exporting the following file to HTML yields the following:
>
> #+PROPERTY: header-args :exports code
> This code has many src_python{def}s.
>
> 
> This code has many def
> s.
> 
>
> This renders as ~This code has many def s~, instead of the expected ~This 
> code has many defs~.  The extra space is due to the newline after before the 
> closing  tag in the HTML exported sources.
>
> This newline is added by ~org-export-unravel-code~:
>
>  ;; Get code and clean it.  Remove blank lines at its
>  ;; beginning and end.
>  (code (replace-regexp-in-string
> "\\`\\([ \t]*\n\\)+" ""
> (replace-regexp-in-string
>  "\\([ \t]*\n\\)*[ \t]*\\'" "\n"
>  (if (or org-src-preserve-indentation
>  (org-element-property :preserve-indent element))
>  value
>(org-remove-indentation value)
>
> The documentation of this function seems slightly wrong, too, as it gets 
> passed elements of type ~inline-src-block~:
>
> (defun org-export-unravel-code (element)
>   "Clean source code and extract references out of it.
>
> ELEMENT has either a `src-block' an `example-block' type.

The documentation is correct. `org-export-unravel-code' is not meant to
be called on inline source blocks since they cannot contain coderefs.

I fixed "ox-html.el" accordingly. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Footnotes in image captions

2016-08-28 Thread Nicolas Goaziou
Hello,

Arun Isaac  writes:

> In my use case, I can guarantee that all captions will be exported. So,
> could footnotes in captions be implemented as an optional feature that
> the user can enable by setting some variable?

That's not an option, because this is forbidden at the syntax level,
i.e., "thou shall not use footnotes in keywords", and I don't want Org
_format_ to be customizable.

> Or will that be too much trouble?

The "keywords" location in the restriction above is rather large as it
contains both regular keywords (e.g., TITLE) and captions.

Adding footnotes in regular keywords is really too much trouble at this
point. During export, what keywords are parsed changes according to the
export back-end used. Besides some keywords can also be defined as
properties, which means you need to allow footnote references in node
properties.

Adding footnotes to captions only /may/ be painful too. Some back-ends
ignore captions, or ignore captions associated to a certain type of
element (e.g., a paragraph). In these cases, footnotes export is mostly
broken, because it cannot properly number them.

Another difficult situation I can think of is tables. If you use
a caption in both a table and its caption, the reference order depends
on some other variable, e.g., `org-html-table-caption-above', so, again,
the footnotes handling is going to be broken in a non-trivial way in
some cases.

There are also special cases, even when Org does not handle footnotes
itself. Under `latex' back-end, using "listings" package, caption is
defined as a parameter of the "\lstset" command, e.g.,

  \lstset{language=Lisp,label= ,caption={Foo}, ...}

I don't know if additional footnotes commands are supported in such
a parameter.

In a nutshell, I'm sure that it will work in your use case, and I can
even perceive the interest in having footnotes within captions. However,
handling all the implied corner cases is going to be some tedious work,
if doable at all. We might try, nonetheless, to introduce footnotes in
captions as an experimental feature, but not before 9.0 release, and not
without some developer support to handle the issues that would arise (as
a reminder I'm an expert neither in LaTeX nor in HTML).

WDYT?


Regards,

-- 
Nicolas Goaziou



[O] Suggestion: prettify \nbsp{} as NO-BREAK SPACE

2016-08-28 Thread Clément Pit--Claudel
Emacs displays NO-BREAK SPACE differently from regular space, whereas Org-mode 
displays \nbsp{} as a regular space (when replacement of symbols is enabled).  
Maybe it would help to display it as NO-BREAK SPACE instead?

I can provide a patch if it is useful.

Clément.



signature.asc
Description: OpenPGP digital signature


Re: [O] Footnotes in image captions

2016-08-28 Thread Arun Isaac

> In a nutshell, I'm sure that it will work in your use case, and I can
> even perceive the interest in having footnotes within captions. However,
> handling all the implied corner cases is going to be some tedious work,
> if doable at all. We might try, nonetheless, to introduce footnotes in
> captions as an experimental feature, but not before 9.0 release, and not
> without some developer support to handle the issues that would arise (as
> a reminder I'm an expert neither in LaTeX nor in HTML).
>
> WDYT?

I totally agree. No objections. When I brought up this matter, I thought
it might be just a little tweak to the org export code. I didn't realize
that there would be this many complications.

As for my use case, I can handle it easily enough without using
footnotes. So, I don't really need footnote support in image captions. I
only brought it up because I thought it might be a more generally useful
feature than my specific use case. So, this feature, if implemented, can
definitely wait. No hurry.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] org2pdf export broken on parabola

2016-08-28 Thread Divan Santana
Thanks for the reply.

My initial post was a lacking detail, sorry...

So, on parabola Linux, a simply org file, like this:

QUOTE
* Test

Testing org export to pdf via latex, on parabola Linux.
END QUOTE

If I try export via C-c C-e l p

results in a blank PDF.

The *Org PDF LaTeX Output* buffer contains this:

QUOTE
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Parabola) 
(preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/home/admin/ownCloud/documents/org/test.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size11.clo))
(/usr/share/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texmf-dist/tex/latex/base/t1enc.def)
kpathsea: Running mktextfm ecrm1095
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
input ecrm1095
This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded base=mf)

kpathsea: Running mktexmf ecrm1095

! I can't find file `ecrm1095'.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1095

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1095

Transcript written on mfput.log.
grep: ecrm1095.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
ecrm1095' failed to make ecrm1095.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font T1/cmr/m/n/10.95=ecrm1095 at 10.95pt not loadable: Metric (TFM) file not
 found.

   relax
l.105 \fontencoding\encodingdefault\selectfont

) (/usr/share/texmf-dist/tex/latex/base/fixltx2e.sty

Package fixltx2e Warning: fixltx2e is not required with releases after 2015
(fixltx2e)All fixes are now in the LaTeX kernel.
(fixltx2e)See the latexrelease package for details.

) (/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texmf-dist/tex/latex/graphics-def/pdftex.def
(/usr/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grffile.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty))
(/usr/share/texmf-dist/tex/latex/tools/longtable.sty)
(/usr/share/texmf-dist/tex/latex/wrapfig/wrapfig.sty)
(/usr/share/texmf-dist/tex/latex/graphics/rotating.sty
(/usr/share/texmf-dist/tex/latex/base/ifthen.sty))
(/usr/share/texmf-dist/tex/generic/ulem/ulem.sty)
(/usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf-dist/tex/latex/base/textcomp.sty
(/usr/share/texmf-dist/tex/latex/base/ts1enc.def
(/usr/share/texmf-dist/tex/latex/base/ts1enc.dfu)))
(/usr/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/share/texmf-dist/tex/latex/capt-of/capt-of.sty)
(/usr/share/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/share/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/share/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/share/texmf-dist/tex/latex/url/url.sty))

Package hyperref Message: Driver (autodetected): hpdftex.

(/usr/share/texmf-dist/tex/latex/hyperref/hpdftex.def
(/usr/share/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (.//test.aux)
(/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys

Re: [O] Suggestion: prettify \nbsp{} as NO-BREAK SPACE

2016-08-28 Thread Aaron Ecay
Hi Clément,

I think rather that the entry for \nbsp in the ‘org-entities’ alist is
incorrect: the last two elements (the Latin-1 and UTF8 equivalents)
should be a non-breaking space, rather than a plain space.  This would
make \nbsp display as a non-breaking space in buffers and also when
exporting to (UTF8) plain text.

2016ko abuztuak 28an, Clément Pit--Claudel-ek idatzi zuen:

> I can provide a patch if it is useful.

Thanks for the offer.  I went ahead and made the change (on the master
branch), since it was so simple.

-- 
Aaron Ecay



Re: [O] org2pdf export broken on parabola

2016-08-28 Thread Aaron Ecay
Hi Divan,

Thanks for your reply.

2016ko abuztuak 28an, Divan Santana-ek idatzi zuen:
> 
> Thanks for the reply.
> 
> My initial post was a lacking detail, sorry...
> 
> So, on parabola Linux, a simply org file, like this:
> 
> QUOTE
> * Test
> 
> Testing org export to pdf via latex, on parabola Linux.
> END QUOTE
> 
> If I try export via C-c C-e l p
> 
> results in a blank PDF.
> 
> The *Org PDF LaTeX Output* buffer contains this:
> 
> QUOTE
> This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Parabola) 
> (preloaded format=pdflatex)
>  restricted \write18 enabled.
> entering extended mode
> (/home/admin/ownCloud/documents/org/test.tex
> LaTeX2e <2016/03/31> patch level 3
> Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
> (/usr/share/texmf-dist/tex/latex/base/article.cls
> Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
> (/usr/share/texmf-dist/tex/latex/base/size11.clo))
> (/usr/share/texmf-dist/tex/latex/base/inputenc.sty
> (/usr/share/texmf-dist/tex/latex/base/utf8.def
> (/usr/share/texmf-dist/tex/latex/base/t1enc.dfu)
> (/usr/share/texmf-dist/tex/latex/base/ot1enc.dfu)
> (/usr/share/texmf-dist/tex/latex/base/omsenc.dfu)))
> (/usr/share/texmf-dist/tex/latex/base/fontenc.sty
> (/usr/share/texmf-dist/tex/latex/base/t1enc.def)
> kpathsea: Running mktextfm ecrm1095
> mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
> input ecrm1095
> This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded 
> base=mf)
> 
> kpathsea: Running mktexmf ecrm1095
> 
> ! I can't find file `ecrm1095'.
> <*> ...ljfour; mag:=1; nonstopmode; input ecrm1095

[...snip the rest...]

This log indicates that the problem occurs during the loading of the
fontenc package.  Fontenc is a good package to load, apparently:
.

You can probably fix this error by either removing the entry for the
fontenc package from org-latex-default-packages-alist, or setting
org-latex-compiler to either lualatex or xelatex (newer latex compilers
neither of which use fontenc).  Of course, either of these might uncover
further problems (the parabola approach to packaging texlive seems
pretty haphazard), but I believe either step would fix the problem you
have reported.

-- 
Aaron Ecay



Re: [O] Suggestion: prettify \nbsp{} as NO-BREAK SPACE

2016-08-28 Thread Clément Pit--Claudel
On 2016-08-28 14:08, Aaron Ecay wrote:
> Hi Clément,
> 
> I think rather that the entry for \nbsp in the ‘org-entities’ alist is
> incorrect: the last two elements (the Latin-1 and UTF8 equivalents)
> should be a non-breaking space, rather than a plain space.  This would
> make \nbsp display as a non-breaking space in buffers and also when
> exporting to (UTF8) plain text.
> 
> 2016ko abuztuak 28an, Clément Pit--Claudel-ek idatzi zuen:
> 
>> I can provide a patch if it is useful.
> 
> Thanks for the offer.  I went ahead and made the change (on the master
> branch), since it was so simple.

Wonderful, thanks!



signature.asc
Description: OpenPGP digital signature


[O] table alignment with org-pretty-entities turned on

2016-08-28 Thread jsj
Hi,

I am using the latest org-plus-contrib package (20160822) with emacs 25.1.50.

I turned org-pretty-entities on in my init.el. When there are prettified 
letters displayed in an org table, the alignment of the table seems to be 
messed up.  The deviation is related to the number of prettified symbols.

For example,

| a  | b | c |
|+---+---|
| \alpha |   |   |

is displayed as

| a  | b | c |
|+---+---|
| α |   |   |

while 

| a| b | c |
|--+---+---|
| \alpha \beta |   |   |

is prettified as

| a | b | c |
|---+---+---|
| α β |   |   |

I am wondering whether I miss anything. It would be great to have aligned 
tables with prettified symbols.

Thank you!

Best regards,
Jiang

Re: [O] Bug: +MATHJAX Not Wrok [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/24.5/lisp/org/)]

2016-08-28 Thread Nicolas Goaziou
Hello,

"zhangjg"  writes:

> In the org-html-mathjax-options variable description , say #+MATHJAX: 
> path:"http://url/MATHjax.js"; can be ued to set the variable 
>
> org-html-mathjax-options to  `((path "http://url/MATHjax.js";)  but it not 
> work. 
>
> Set the variable in .emacs is OK, but in Org file, 
>
> +MATHJAX: path: "http://somepath/Mathjax.js";

This should be #+HTML_MATHJAX: path: whatever.

Regards,

-- 
Nicolas Goaziou



Re: [O] DONE items skipped in org-map-entries

2016-08-28 Thread Nicolas Goaziou
Hello,

Stefan van der Walt  writes:

> For a while now, I've been using the solution to the following
> StackOverflow question to archive all done subitems:
>
> http://stackoverflow.com/a/27043756/214686
>
> (I've repeated the question and answer below, for completeness.)
>
> A few months ago, I noticed that the given solution no longer works.
> Investigating (with org-mode/2016-08-22), it looks like org-map-entries
> skips DONE items---likely different behavior from before.
>
> The following test function can be used to replicate:
>
> (defun org-count ()
>   (interactive)
>   (message "entries %d" (length
>(org-map-entries t t 'tree
>
> Executing this function on any heading with the "DONE" tag returns 0.
>
> Is this the correct behavior for org-map-entries?

I'm not able to reproduce the issue. I tried with the following document

  ** DONE Foo
  *** Bar

with point anywhere on the first line, `org-count' displays "entries 2".


Regards,

-- 
Nicolas Goaziou



Re: [O] recalculate tables

2016-08-28 Thread Nicolas Goaziou
Hello,

Michael Welle  writes:

> I have a handful of tables like the following:
>
> |---+---+|
> | 3 | 4 ||
> |---+---+|
> #+TBLFM: $3=$2-$1
>
> I don't add data to them very frequently. But since they all have the
> third column filled, I think recalculating had worked in tables formated
> like that before.
>
> If you give me a week or so I will try to find the change set that
> introduced the current behaviour.

I think I found the culprit. Org is hopefully back to its initial
behaviour. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] recalculate tables

2016-08-28 Thread Michael Welle
Hello,

Nicolas Goaziou  writes:

> Hello,
>
> Michael Welle  writes:
>
>> I have a handful of tables like the following:
>>
>> |---+---+|
>> | 3 | 4 ||
>> |---+---+|
>> #+TBLFM: $3=$2-$1
>>
>> I don't add data to them very frequently. But since they all have the
>> third column filled, I think recalculating had worked in tables formated
>> like that before.
>>
>> If you give me a week or so I will try to find the change set that
>> introduced the current behaviour.
>
> I think I found the culprit. Org is hopefully back to its initial
> behaviour. Thank you.
wow, that was fast. Thank you very much, Nicolas.

Regards
hmw



Re: [O] Emacs movement keys

2016-08-28 Thread Marcin Borkowski

On 2016-08-23, at 23:31, Alex Recker  wrote:

>> "You know you're an Emacs user when..."
>
> You try to M-f your way through a URI and accidentally turn it into an
> integral.

Could you explain this one?

Also,

You know you're an Emacs user when...

you try to get to the beginning of line and find yourself selecting
everything and losing the positition in a large file.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University