Re: [O] Some thought about `org-latex-pdf-process-alist', was Re: (V9) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-21 Thread Feng Shu

> It is different, 3 runs of latex as example:
>
> if we don't deal with %latex place-hold in process commands,
> #+latex_compiler is useless, we need to define pdf process
> in org-latex-pdf-process-alist, 
>
>"pdflatex-pdflatex-pdflatex" "xelatex-xelatex-xelatex" 
> "lualatex-lualatex-lualatex"
>  
> otherwise, we can use #+latex_compile and define pdf process
>
>"latex-latex-latex"

By the way, I don't like the #+latex_compile approach, In my opinion, it seem 
to be a
hack. For user, ox-latex provide too much configure options.

Maybe someone says, it is stupid duplicate code:

#+BEGIN_COMMENT
pdflatex-pdflatex-pdflatex
pdflatex-pdflatex-pdflatex
pdflatex-bibtex-pdflatex-pdflatex
xelatex-xelatex-pdflatex
xelatex-xelatex-pdflatex
xelatex-bibtex-xelatex-xelatex
luatex-luatex-lualatex
luatex-luatex-lualatex
luatex-bibtex-luatex-lualatex
#+END_COMMENT

but I think, it is a right approach, we must know, we have org contrib
package, and we have other personnel org extension package, we don't
need put all the process setting to ox-latex.el, we just add the
following three as defaults and examples.

#+BEGIN_COMMENT
pdflatex-pdflatex-pdflatex
pdflatex-pdflatex-pdflatex
pdflatex-bibtex-pdflatex-pdflatex
#+END_SRC

ox-latex-process:xelatex package can be provided in elpa or melpa,
if some need xelatex process setting, just install it.

Users can develop and share their own special processes with the
help of emacs package.





[O] Some thought about `org-latex-pdf-process-alist', was Re: (V9) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-21 Thread Feng Shu


> Hi Feng,
>
> Thanks for the patches. 
>
> "Feng Shu"  writes:
>
>> 1. org-latex-pdf-process -> org-latex-pdf-default-process
>> 2. Add new variable org-latex-pdf-process-alist
>
> What do you have in mind?  I assume it’s something more than just ripping
> out the :type part of org-latex-pdf-process.
>

Similar, but include more information, maybe it it like:

#+BEGIN_SRC emacs-lisp
(setq org-latex-pdf-process-alist
  '(("pdflatex-pdflatex-pdflatex"
 :commands ("pdflatex -interaction nonstopmode -output-directory %o %f"
"pdflatex -interaction nonstopmode -output-directory %o %f"
"pdflatex -interaction nonstopmode -output-directory %o %f")

 ;; A string in `:valid-classes',
 ;; when nil, fallback to `org-latex-default-class'
 :default-class "article"
 
 ;; class-settings which works well with the process,
 ;; they must be defined `org-latex-classes'.
 ;; when nil, all class-settings defined `org-latex-classes'
 ;; are valid.
 :valid-classes ("article" "beamer" "report" "book")

 ;; the process's default packages, when nil
 ;; fallback to `org-latex-default-packages-alist'
 :default-packages-alist nil

 ;; the process's packages, when nil
 ;; fallback to `org-latex-packages-alist'
 :packages-alist nil
 :packages-override nil)))
#+END_SRC

>> 3. Add #+LATEX_PDF_PROCESS setting
>
> Is this the same as #+latex_compiler, which is used for setting the
> process to pdflatex, xelatex or lualatex?

It is different, 3 runs of latex as example:

if we don't deal with %latex place-hold in process commands,
#+latex_compiler is useless, we need to define pdf process
in org-latex-pdf-process-alist, 

   "pdflatex-pdflatex-pdflatex" "xelatex-xelatex-xelatex" 
"lualatex-lualatex-lualatex"
 
otherwise, we can use #+latex_compile and define pdf process

   "latex-latex-latex"


>
>> I am a member of emacs community in chinese, many org-mode latex
>> beginners will ask me: "How to export org to pdf by latex?",
>> this problem is annoying, so i deside to write a package:
>> ox-latex-chinese and tell them: "Install org-latex-chinese package!"
>
> It sounds like #+language support should be extended.  A basic Chinese
> document with org doesn’t seem that hard.  With ttf-hannom, all I need is
> this:
>
> #+latex_compiler: xelatex
> #+latex_header: \usepackage{xeCJK}
> #+latex_header: \setCJKmainfont{HAN NOM A}
> 文章内容
>
Reason:
1. Not so simple, we often need to edit `org-latex-classes'
   `org-latex-default-packages-alist' and `org-latex-package-alist'
   for many reason, for example: macro conflict

2. I don't want every users have to write latex-header in every org-file
and I like: install ox-latex-chinese and

   (setq org-latex-default-pdf-process "cn/xelatex-xelatex-xelatex")

every org-file can export to pdf.

> Rasmus

-- 


-- 




[O] bug org-list-send-list

2016-05-21 Thread Charles Millar

Using the following on LMDE 2

GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 
2015-03-07 on trouble, modified by Debian
Org-mode version 8.3.4 (release_8.3.4-833-g2ed5e6 @ 
/usr/local/share/emacs/site-lisp/org-mode/lisp/)


I have (require 'ox-latex) in my .emacs.d/init.el

The following radio table is in LaTeX major mode and orgstruct minotr 
mode per the manual.


% BEGIN RECEIVE ORGLST radioTableTest
% END RECEIVE ORGLST radioTableTest
\begin{comment}
#+ORGLST: SEND radioTableTest org-list-to-latex
- Something to send
\end{comment}

With cursor on the "S" in Something calling (or "-")

M-x org-list-send-list

does not convert LATEX list between the two marker lines. Instead the 
following message is in the mini-buffer


No such transformation function org-list-to-latex and the degug-on-entry is

Debugger entered--entering a function:
* org-list-send-list()
  call-interactively(org-list-send-list record nil)
  command-execute(org-list-send-list record)
  execute-extended-command(nil "org-list-send-list")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

If I C-c C-c on the "S" (or the "-")

the minibuffer calls Command [pdflatex]:

if I just hit enter the following is in the tex-shell

charlie01@theoffice /mnt/Data/ActiveFiles $ pdflatex 
\\nonstopmode\\input RadiotablesTest.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 
2015/dev/Debian) (preloaded format=pdflatex)

 restricted \write18 enabled.
entering extended mode
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.

(./RadiotablesTest.tex

! LaTeX Error: Environment comment undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...

l.3 \begin{comment}

! You can't use `macro parameter character #' in vertical mode.
l.4 #
 +ORGLST: SEND radioTableTest org-list-to-latex

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...

l.4 #+
  ORGLST: SEND radioTableTest org-list-to-latex

! LaTeX Error: \begin{document} ended by \end{comment}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...

l.6 \end{comment}

)
! Emergency stop.
<*> \nonstopmode\input RadiotablesTest.tex

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on RadiotablesTest.log.
charlie01@theoffice /mnt/Data/ActiveFiles $

Is this a bug? Is my setup incorrect? Or what am I missing.

Charlie Millar




Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-21 Thread Nick Dokos
"Charles C. Berry"  writes:

> On Fri, 20 May 2016, Nick Dokos wrote:
>
>> Ken Mankoff  writes:
>>
> [deleted discussion of  `org-export-babel-evaluate' settings]
>
>>
>> With ":exports results" and o-e-b-e set to nil, I get no evaluation on
>> export, but I get both code and results in the output.
>>
>>> There may have been a misunderstanding, but when I mentioned this in
>>> the bug report, I was told this is a "feature".
>>>
>>> http://thread.gmane.org/gmane.emacs.orgmode/107230/focus=107231
>>>
>>
>> Not sure what exactly Chuck meant is a feature, but IIUC, the fact
>> that I get both code and results even if I specify ":exports results"
>> looks like a bug to me.
>>
>
> I meant this, as of commit ec615b1..., `org-export-babel-evaluate' set to
> `nil' keeps the exporter from running this line
>
>   (org-export-execute-babel-code)
>
> during exports. So, 'no Babel code is run' in the sense that the above
> line does not execute.
>
> src-blocks and inline-src-blocks are neither run nor removed, and no
> #+results: or {{{results()}}} are added, removed, or
> modified. Babel handles all that. The exporter merely formats those
> things once Babel is done.
>
> So the bug, if any, is in the docstring in failing to mention that
> everything that babel does is switched off.
>
> Since the behavior that the OP wanted can be had by setting babel
> header args, I don't see this as a bug even though the behavior
> changed in a way that surprised him.
>

I'm not sure I followed the whole discussion so maybe I'm missing
something. Setting o-e-b-e to nil does what it says it does: it does not
evaluate the babel block on export - that's as it should be AFAICT.

But that still leaves the problem that ":exports results" is not obeyed:
both code and results are exported - that's a bug, no?

--
Nick




[O] Some functions not being autoloaded in ELPA Org-mode

2016-05-21 Thread Alex

As an example, see `orgtbl-mode'. While this function has an autoload
cookie, it is not being autoloaded in the org-autoloads.el file.

However this function's autoload form is in org-loaddefs.el. Is
org-autoloads.el not being updated correctly?




Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-21 Thread Alex
Hello,

Nicolas Goaziou  writes:

> Hello,
>
> Alex G  writes:
>
>> Oh, it seems like backspace works fine in text modes like
>> fundamental-mode and message-mode, but not prog-derived modes. I'd say
>> that's another bug.
>>
>> A git bisect says that this commit by Bastien Guerry is the culprit:
>> f0a64ab3b5c46c8c7b1c838de2ed20511357e43d
>
> Fixed. Thank you.
>
> Regards,

Thank you for the fixes. However, the fix in 4914f89 does not work for
me. When I run it (type backspace) in a graphical Emacs I get:

user-error: This key has no function outside tables

When I run it in a terminal Emacs the command is not rebound at all.

Replacing [(del)] with (kbd "DEL") fixed the issue for me.



Re: [O] latex newcommand in org

2016-05-21 Thread Marcin Borkowski

On 2016-05-21, at 13:00, Eric S Fraga  wrote:

> On Friday, 20 May 2016 at 23:45, Doyley, Marvin M. wrote:
>> Eric’s suggestion works like a charm with the following modification
>> #+latex_header:\newenvironment{response}{\color{red}}{\ignorespacesafterend}
>
> Excellent and the modification makes sense for your use case.

You might also want to say

\newenvironment{response}{\unskip\color{red}\ignorespaces}{\unskip\ignorespacesafterend}

(not tested).

Best,

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



Re: [O] (V9) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-21 Thread Rasmus
Hi Feng,

Thanks for the patches. 

"Feng Shu"  writes:

> 1. org-latex-pdf-process -> org-latex-pdf-default-process
> 2. Add new variable org-latex-pdf-process-alist

What do you have in mind?  I assume it’s something more than just ripping
out the :type part of org-latex-pdf-process.

> 3. Add #+LATEX_PDF_PROCESS setting

Is this the same as #+latex_compiler, which is used for setting the
process to pdflatex, xelatex or lualatex?

> I am a member of emacs community in chinese, many org-mode latex
> beginners will ask me: "How to export org to pdf by latex?",
> this problem is annoying, so i deside to write a package:
> ox-latex-chinese and tell them: "Install org-latex-chinese package!"

It sounds like #+language support should be extended.  A basic Chinese
document with org doesn’t seem that hard.  With ttf-hannom, all I need is
this:

#+latex_compiler: xelatex
#+latex_header: \usepackage{xeCJK}
#+latex_header: \setCJKmainfont{HAN NOM A}
文章内容

Rasmus

-- 
Don't slow down Johnny, leave the Cadillac runnin'




Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-21 Thread Nicolas Goaziou
Hello,

Alex G  writes:

> Oh, it seems like backspace works fine in text modes like
> fundamental-mode and message-mode, but not prog-derived modes. I'd say
> that's another bug.
>
> A git bisect says that this commit by Bastien Guerry is the culprit:
> f0a64ab3b5c46c8c7b1c838de2ed20511357e43d

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] (V9) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-21 Thread Feng Shu
Nicolas Goaziou  writes:

> Hello,
>
> "Feng Shu"  writes:
>
>> From e18b7a4430ff90d6bcb828e3898ef25c61aba4bd Mon Sep 17 00:00:00 2001
>> From: Feng Shu 
>> Date: Tue, 17 May 2016 21:24:35 +0800
>> Subject: [PATCH] New feature: Use dvisvgm to preview latex formular
>
> It looks good. I applied it with minor tweak to docstrings. I also made
> use of `org-preview-latex-default-process', which was defined but not
> used in the patch.
>
> Thank you for all this work.

Thank you for you help too :-)

The next work i want to do is:

1. org-latex-pdf-process -> org-latex-pdf-default-process
2. Add new variable org-latex-pdf-process-alist
3. Add #+LATEX_PDF_PROCESS setting


I am a member of emacs community in chinese, many org-mode latex
beginners will ask me: "How to export org to pdf by latex?",
this problem is annoying, so i deside to write a package:
ox-latex-chinese and tell them: "Install org-latex-chinese package!"

But, it is a diffcult work to convert my own org latex configure
to a well organized emacs package, setq nightmare!.

The above suggestion is a try to solve this problem.

Any suggestion? if you agree, i will code the patch.

>
> BTW, could you provide an entry for ORG-NEWS about it? User visible
> changes are variables being renamed an, obviously, the new feature.

I can write an entry, but for my poor English, reviewing it may need
more time than writing a new, :-)

>
> Regards,

-- 




Re: [O] Bug: org links do not work in some latex files [8.3.4 (8.3.4-34-gacfd41-elpaplus @ /home/oub/.emacs.d/elpa/org-plus-contrib-20160411/)]

2016-05-21 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

> Hello,
> Uwe Brauer  writes:

>> Ok, but one link worked with this function.

> Sheer luck. `org-open-at-point' behaviour is undefined in non-Org
> buffers. Note that, however, `org-open-at-point' wouldn't open the
> second link even in an Org buffer because it is located within a LaTeX
> environment. Org doesn't look for links into them.

>> Thank you for fixing it. I presume it will be on Monday  in ELPA?

> Unfortunately, no. I fixed it in master, which is development branch.
> ELPA is a release from maint branch. I could cherry-pick it there, but
> I need to be sure it doesn't break anything first.

Ok, I could clone the git rep of org and then try to merge your
modification into ELPA, it is just that function you changed?

BTW I see that org is also in the trunk of Emacs master (25.1.5) which I
use, is org master the same as that version? I would then need to re
compile emacs...

regards


> Regards,



Re: [O] latex newcommand in org

2016-05-21 Thread Eric S Fraga
On Friday, 20 May 2016 at 23:45, Doyley, Marvin M. wrote:
> Eric’s suggestion works like a charm with the following modification
> #+latex_header:\newenvironment{response}{\color{red}}{\ignorespacesafterend}

Excellent and the modification makes sense for your use case.

-- 
: Professor Eric S Fraga, CPSE, Chemical Engineering, UCL
: GnuPG/PGP key 0xFFFCF67D, http://www.ucl.ac.uk/~ucecesf
:
: CFP: Nature-Inspired Algorithms: Design, Analysis and Application
:  Special session, META'2016 (http://meta2016.sciencesconf.org/)
<>

[O] Bug: Error upon HTML export of LaTeX source code [8.3.4 (release_8.3.4-831-gbf93e1 @ /home/dominik/.emacs.d/org-mode/lisp/)]

2016-05-21 Thread Dominik Schrempf
Hello,

I try to export a fontified LaTeX source code listing with HTML export.
It boils down to an error that is thrown upon execution of the following
function during HTML export:

(org-html-fontify-code "\\begin{tabular}{@{} l @{}}\n\\hline\nno leading 
space\n\\hline\n\\end{tabular}\n" "latex")

The debugging information is:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  reftex-TeX-master-file()
  reftex-reset-scanning-information()
  reftex-reset-mode()
  my-reftex-mode-hook()
  run-hooks(reftex-mode-hook)
  reftex-mode(t)
  turn-on-reftex()
  run-hooks(change-major-mode-after-body-hook text-mode-hook TeX-mode-hook 
LaTeX-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
TeX-mode-hook LaTeX-mode-hook))
  TeX-run-mode-hooks(text-mode-hook TeX-mode-hook LaTeX-mode-hook)
  TeX-latex-mode()
  apply(TeX-latex-mode nil)
  latex-mode()
  org-html-fontify-code("\\begin{tabular}{@{} l @{}}\n\\hline\nno leading 
space\n\\hline\n\\end{tabular}\n" "latex")
  eval((org-html-fontify-code "\\begin{tabular}{@{} l @{}}\n\\hline\nno leading 
space\n\\hline\n\\end{tabular}\n" "latex") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

All the best,
Dominik



Re: [O] Bug: org links do not work in some latex files [8.3.4 (8.3.4-34-gacfd41-elpaplus @ /home/oub/.emacs.d/elpa/org-plus-contrib-20160411/)]

2016-05-21 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Ok, but one link worked with this function.

Sheer luck. `org-open-at-point' behaviour is undefined in non-Org
buffers. Note that, however, `org-open-at-point' wouldn't open the
second link even in an Org buffer because it is located within a LaTeX
environment. Org doesn't look for links into them.

> Thank you for fixing it. I presume it will be on Monday  in ELPA?

Unfortunately, no. I fixed it in master, which is development branch.
ELPA is a release from maint branch. I could cherry-pick it there, but
I need to be sure it doesn't break anything first.

Regards,

-- 
Nicolas Goaziou



Re: [O] (V9) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-21 Thread Nicolas Goaziou
Hello,

"Feng Shu"  writes:

> From e18b7a4430ff90d6bcb828e3898ef25c61aba4bd Mon Sep 17 00:00:00 2001
> From: Feng Shu 
> Date: Tue, 17 May 2016 21:24:35 +0800
> Subject: [PATCH] New feature: Use dvisvgm to preview latex formular

It looks good. I applied it with minor tweak to docstrings. I also made
use of `org-preview-latex-default-process', which was defined but not
used in the patch.

Thank you for all this work.

BTW, could you provide an entry for ORG-NEWS about it? User visible
changes are variables being renamed an, obviously, the new feature.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org links do not work in some latex files [8.3.4 (8.3.4-34-gacfd41-elpaplus @ /home/oub/.emacs.d/elpa/org-plus-contrib-20160411/)]

2016-05-21 Thread Uwe Brauer

> Hello,
> Uwe Brauer  writes:


> `org-open-at-point' in an Org function, which is meant to be called in
> an Org buffer. IIUC, you are calling it from a LaTeX buffer.

Ok, but one link worked with this function.


> `org-open-at-point-global' provides sloppy Org link (and time-stamp)
> following in any buffer. You should use it in this case.


Ok, thanks


> Note that however `org-open-at-point-global' was bugged, so I just fixed
> it in master. Thank you for the report.

Thank you for fixing it. I presume it will be on Monday  in ELPA?

regards

Uwe Brauer