Re: [O] Using #+NAME for single value, not table?

2014-06-30 Thread Rainer M Krug
Aaron Ecay  writes:

> Hi Rainer,
>
> 2014ko ekainak 26an, Rainer M Krug-ek idatzi zuen:
>> 
>> Hi
>> 
>> I use #+NAME to define some parameters for my analysis, which works
>> quite nice for tables. but I would now like to use the same apprioach
>> for values, e.g. a single number, but I don't manage. Is this possible?
>> For illustration a short example:
>> 
>> --8<---cut here---start->8---
>> *** Species names and iespece codes
>> #+NAME: SPECIES
>> | | fullName| shortName | iespece | IFNName | color |
>> |-+-+---+-+-+---|
>> | fagus   | Fagus sylvatica | fagus |   4 | fagus_sylvatica | red   |
>> | quercus | Quercus robur   | quercus   |   3 | quercus_robur   | green |
>> 
>> *** Random Number Definition
>> Defines random number generator kind, normal.kind and seed (see set.seed 
>> help in R for details)
>> #+NAME: RNGSEED 
>> 13
>> --8<---cut here---end--->8---
>> 
>> SPECIES works, but how do I get RNGSEED to be 13?
>
> You can use a verbatim block:
>
> ,
> | #+name: xyz
> | : hi
> | 
> | #+begin_src emacs-lisp :var abc=xyz
> | (concat "*" abc "*")
> | #+end_src
> | 
> | #+RESULTS:
> | : *hi*
> `

Perfect - this is exactly what I was looking for.

Thanks,

Rainer

>
> HTH,

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpDi9gCrOnuB.pgp
Description: PGP signature


[O] Problem with org-mode after upgradiing to org 8

2014-06-30 Thread Roland Everaert
Hi,

I have recently upgraded to org-mode version 8. Each time I start emacs I
see the folloinwg error:

error "Autoloading failed to define function org-element-cache-reset"


And some functionnality of org-mode doesn't seems to work anymore.


Informa


Re: [O] org-ref in action

2014-06-30 Thread Joseph Vidal-Rosset
2014-06-29 20:19 GMT+02:00 Eric Schulte :

>
> With ox-bibtex.el [[cite:(page n)one-reference-paper-year]] will export as
>
>   \cite[page n]{one-reference-paper-year}



I am sorry Eric but [[cite:(page n)one-reference-paper-year]]  breaks the
bibliography reference for me with ox-bibtex.el ... it is too bad because
it was a convenient solution to get  \cite[page
n]{one-reference-paper-year} .

I am lost.

Regards

Jo.


Re: [O] Define resources in ox-taskjuggler

2014-06-30 Thread Christian Egli
Johan Ekh  writes:


> "Error: crc is not a defined resource"
>
> I've read some documentation/tutorials and I've searched this list but
> I did not find an answer. Can anyone of you gurus see emmediately what
> is wrong or at least point me in the right direction?

Isn't this just a question of capitalization? In other words try to
define the resource_id lowercase crc.

HTH
Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




Re: [O] Problem with org-mode after upgradiing to org 8

2014-06-30 Thread Roland Everaert
Second part of the message:

Information from M-x org-version:

Org-mode version beta_8.3 (beta_8.3-16-g16c71d6 @
/home/reveatwork/.emacs.d/site-lisp/org-mode/lisp/)

I have downloaded the last version using git.

How can I switch to a stable branch instead of the last beta, to check if
that solves the problem?


Thanks for your help.



On Mon, Jun 30, 2014 at 11:24 AM, Roland Everaert 
wrote:

> Hi,
>
> I have recently upgraded to org-mode version 8. Each time I start emacs I
> see the folloinwg error:
>
> error "Autoloading failed to define function org-element-cache-reset"
>
>
> And some functionnality of org-mode doesn't seems to work anymore.
>
>
> Informa
>


Re: [O] org-ref in action

2014-06-30 Thread Eric Schulte
Joseph Vidal-Rosset  writes:

> 2014-06-29 20:19 GMT+02:00 Eric Schulte :
>
>>
>> With ox-bibtex.el [[cite:(page n)one-reference-paper-year]] will export as
>>
>>   \cite[page n]{one-reference-paper-year}
>
>
>
> I am sorry Eric but [[cite:(page n)one-reference-paper-year]]  breaks the
> bibliography reference for me with ox-bibtex.el ... it is too bad because
> it was a convenient solution to get  \cite[page
> n]{one-reference-paper-year} .
>
> I am lost.
>

Could you be more specific?  Does org-mode generate any latex at all,
and how does it differ from what you'd expect?  If no LaTeX is
generated, and Org-mode actually throws an error then please provide a
backtrace.  I should be able to help but I'll need more information.

One thing I noticed is that I got better behavior if I didn't allow line
breaks in the link, which was easily accomplished by replacing
[[cite:(page n)one-reference-paper-year]] with
[[cite:(page~n)one-reference-paper-year]].  In general the later is
actually /preferable/ than the former, as you don't want LaTeX breaking
lines in the middle of a citation either.

Best,

>
> Regards
>
> Jo.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



Re: [O] org-ref in action

2014-06-30 Thread Joseph Vidal-Rosset
I thank you Eric for your quick and kind reply.

In my init.el  file  I have put this code :

(eval-after-load 'reftex-vars
  '(progn

 (add-to-list 'reftex-cite-format-builtin
  '(org "Org-mode citation"
((?\C-m . "[[cite:(%p)%l]]")
 (?t . "[[textcite:%l]]")
 (?p . "[[parencite:%l]]")
 (?s . "[[posscite:%l]]")
 (?a . "[[citeauthor:%l]]")
 (?y . "[[citeyear:%l]]"))

2014-06-30 11:52 GMT+02:00 Eric Schulte :

> Could you be more specific?  Does org-mode generate any latex at all,
> and how does it differ from what you'd expect?  If no LaTeX is
> generated, and Org-mode actually throws an error then please provide a
> backtrace.  I should be able to help but I'll need more information.
>

Thanns to the default cite action, I get for example in my org file:

 [[cite:(119–136)johansson36:_minim_formal]]

and it creates no reference at al, because via the export I get:

\cite{(119–136)johansson36:_minim_formal}



>
> One thing I noticed is that I got better behavior if I didn't allow line
> breaks in the link, which was easily accomplished by replacing
> [[cite:(page n)one-reference-paper-year]] with
> [[cite:(page~n)one-reference-paper-year]].  In general the later is
> actually /preferable/ than the former, as you don't want LaTeX breaking
> lines in the middle of a citation either.
>

It is not the issue here because I have no broken line.

I'm using bibtex here and no biblatex. Maybe biblatex is a better option,
but it is another question.

Best

Jo.


Re: [O] org-ref in action

2014-06-30 Thread Eric Schulte
> Thanns to the default cite action, I get for example in my org file:
>
>  [[cite:(119–136)johansson36:_minim_formal]]
>
> and it creates no reference at al, because via the export I get:
>
> \cite{(119–136)johansson36:_minim_formal}
>

Using the latest version of Org-mode from the git repository, this is a
very new feature and requires usage of the git version of Org-mode, I am
seeing the desired behavior.  After simply requiring ox-bibtex, the
following

* H1
[[cite:(119–136)johansson36:_minim_formal]]

exports to

\begin{document}

\maketitle
\tableofcontents

\section{H1}
\label{sec-1}~\cite[119–136]{johansson36:_minim_formal}
% Emacs 24.4.50.2 (Org mode beta_8.3)
\end{document}

As expected.

I hope this helps,
Eric

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



[O] Tables orgmode2html styles

2014-06-30 Thread silgon
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

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

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

Hello guys. I just wanted to say that when you're converting the tables
the properties of the tables are different. The properties are not
longer part of the parameters of the tag, they are part of the css
configuration. I realized that by using *org-reveal* to do my
presentations.



Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-02-22 on king, modified by Debian
Package: Org-mode version 8.2.6 (release_8.2.6-923-g233c11 @
/home/atlas/.emacs.d/elisp/org-mode/lisp/)

current state:
==
(setq
org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-latex-classes '(("beamer" "\\documentclass[presentation]{beamer}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" .
"\\subsubsection*{%s}"))
   ("article" "\\documentclass[11pt]{article}"
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
   ("report" "\\documentclass[11pt]{report}"
   ("\\part{%s}" . "\\part*{%s}")
   ("\\chapter{%s}" . "\\chapter*{%s}")
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" .
"\\subsubsection*{%s}"))
   ("book" "\\documentclass[11pt]{book}"
   ("\\part{%s}" . "\\part*{%s}")
   ("\\chapter{%s}" . "\\chapter*{%s}")
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" .
"\\subsubsection*{%s}"))
   )
org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-html-format-drawer-function '(lambda (name contents) contents)
org-latex-format-inlinetask-function 'ignore
org-confirm-shell-link-function 'yes-or-no-p
org-ascii-format-inlinetask-function
'org-ascii-format-inlinetask-default
org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
 org-beamer-auto-fragile-frames

org-beamer-place-default-actions-for-lists)
org-latex-pdf-process '("texi2dvi --pdf --verbose --batch %f")
org-export-date-timestamp-format nil
org-export-latex-after-initial-vars-hook
'(org-beamer-after-initial-vars)
org-beamer-outline-frame-options ""
org-latex-format-headline-function
'org-latex-format-headline-default-function
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-latex-format-drawer-function '(lambda (name contents) contents)
org-from-is-user-regexp nil
org-src-mode-hook '(org-src-babel-configure-edit-buffer
   org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-export-copy-to-kill-ring nil
org-beamer-column-view-format "%45ITEM %10BEAMER_env(Env)
%10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt)"
org-mode-hook '(zotelo-minor-mode org-mode-reftex-setup
   #[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-show-block-all
append local]
5]
   #[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
5]
   org-babel-result-hide-spec org-babel-hide-all-hashes)
org-export-with-tags t
org-ascii-format-drawer-

Re: [O] html-encode in mathjax latex fragments

2014-06-30 Thread Eric Schulte
Nick Dokos  writes:

> Nicolas Goaziou  writes:
>
>> Hello,
>>
>> Eric Schulte  writes:
>>
>>> I noticed equations with "<"'s weren't displaying correctly in HTML
>>> export using mathjax.  The attached patch fixes this by html-encoding
>>> latex fragments for mathjax HTML export.  I imagine this change would be
>>> generally useful and could be applied to master.
>>
>> I am a bit puzzled. I just tried exporting the following buffer:
>>
>>   \(1 < 2\)
>>
>> and the result looked good. Could you provide an example of a failed
>> export?
>>
>>
>
> See 
>
>http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents
>
> for some gotchas.

Thanks, the link does describe the problem well.  My particular problem
formula included "iFrom the link above it sounds like replacing just "<", ">" and "&"
should be sufficient, if the full html encoding in my previous patch was
too heavy weight.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



Re: [O] html-encode in mathjax latex fragments

2014-06-30 Thread Nicolas Goaziou
Hello,

Eric Schulte  writes:

> From the link above it sounds like replacing just "<", ">" and "&"
> should be sufficient, if the full html encoding in my previous patch was
> too heavy weight.

By default, `org-html-encode-plain-text' just takes care about "<", ">"
and "&", which is what you're looking. However, it is configurable
through `org-html-protect-char-alist', which may cause trouble.

FWIW I think a hard-coded function dedicated to the task, or simply
a hard-coded replacement within `org-html-format-latex', may be safer in
the long run. Anyway Rick Frankel may have an opinion here.


Regards,

-- 
Nicolas Goaziou



Re: [O] html-encode in mathjax latex fragments

2014-06-30 Thread Nicolas Goaziou
Hello,

Nick Dokos  writes:

> See 
>
>http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents
>
> for some gotchas.

Thank you.


Regards,

-- 
Nicolas Goaziou



[O] [patch] [babel] Patches to fix tangling and variable transfer of tables in R

2014-06-30 Thread Rainer M Krug

Hi

Attached please find two patches ready for application to fix that table
variables were not usable adter tangling as temporary files were used.
These patches were discussed in the thread "[babel][PATCHES] ob-R
patches for review"

Thanks,

RainerFrom 38c029b38c85d9f9d35d0867b332eebc3daf1aca Mon Sep 17 00:00:00 2001
From: "Rainer M. Krug" 
Date: Fri, 20 Jun 2014 22:19:59 +0200
Subject: [PATCH 1/2] lisp/ob-R.el: Fix tangling with tables

* lisp/ob-R.el (org-babel-R-assign-elisp): Fix variable transfer of
tables by using text connections in R instead of files.  Variable
transfer of tables does not depend on files anymore, i.e. works also
when tangling.
---
 lisp/ob-R.el | 52 
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index a3ae1ec..c77a103 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -190,32 +190,44 @@ This function is called by `org-babel-execute-src-block'."
   (if (listp value)
   (let* ((lengths (mapcar 'length (org-remove-if-not 'sequencep value)))
 	 (max (if lengths (apply 'max lengths) 0))
-	 (min (if lengths (apply 'min lengths) 0))
-	 (transition-file (org-babel-temp-file "R-import-")))
+	 (min (if lengths (apply 'min lengths) 0)))
 ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
 (unless (listp (car value)) (setq value (list value)))
-(with-temp-file transition-file
-  (insert
-	   (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field))
-	   "\n"))
-	(let ((file (org-babel-process-file-name transition-file 'noquote))
+	(let ((file (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field)))
 	  (header (if (or (eq (nth 1 value) 'hline) colnames-p)
 			  "TRUE" "FALSE"))
 	  (row-names (if rownames-p "1" "NULL")))
 	  (if (= max min)
-	  (format "%s <- read.table(\"%s\",
-  header=%s,
-  row.names=%s,
-  sep=\"\\t\",
-  as.is=TRUE)" name file header row-names)
-	(format "%s <- read.table(\"%s\",
-   header=%s,
-   row.names=%s,
-   sep=\"\\t\",
-   as.is=TRUE,
-   fill=TRUE,
-   col.names = paste(\"V\", seq_len(%d), sep =\"\"))"
-		name file header row-names max
+	  (format "%s <- local({
+con <- textConnection(
+  %S
+)
+res <- read.table(
+  con,
+  header= %s,
+  row.names = %s,
+  sep   = \"\\t\",
+  as.is = TRUE
+)
+close(con)
+res
+})" name file header row-names)
+	(format "%s <- local({
+   con <- textConnection(
+ %S
+   )
+   res <- read.table(
+ con,
+ header= %s,
+ row.names = %s,
+ sep   = \"\\t\",
+ as.is = TRUE,
+ fill  = TRUE,
+ col.names = paste(\"V\", seq_len(%d), sep =\"\")
+   )
+   close(con)
+   res
+   })" name file header row-names max
 (format "%s <- %s" name (org-babel-R-quote-tsv-field value
 
 (defvar ess-ask-for-ess-directory) ; dynamically scoped
-- 
2.0.0

From e62a75e7227027c406d23fa9f8ac594db2ce81d6 Mon Sep 17 00:00:00 2001
From: "Rainer M. Krug" 
Date: Mon, 23 Jun 2014 12:11:59 +0200
Subject: [PATCH 2/2] Make transfer of values from R type aware

* lisp/ob-R.el (org-babel-R-assign-elisp): Added different cases for
transfer of integer, float, string and other variables to R so that
now integer values are transferred as integers (L) and stored in R as
such.  This change is backward compatible as integer values are
numerical values in R.
Moved definition of R functions for transfer of tables into defconst
ob-R-transfer-variable-table-with-header and
ob-R-transfer-variable-table-without-header.
---
 lisp/ob-R.el | 78 
 1 file changed, 47 insertions(+), 31 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index c77a103..92c1dbc 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -93,6 +93,44 @@ this variable.")
 (when (and session (string-match "^\\*\\(.+?\\)\\*$" session))
   (save-match-data (org-babel-R-initiate-session session nil)
 
+(defconst ob-R-transfer-variable-table-with-header
+  "%s <- local({
+ con <- textConnection(
+   %S
+ )
+ res <- read.table(
+   con,
+   header= %s,
+   row.names = %s,
+   sep  

Re: [O] org-ref in action

2014-06-30 Thread Joseph Vidal-Rosset
Thanks Eric, it works now, with the latest version of org-mode.

Best wishes

Jo.


2014-06-30 12:22 GMT+02:00 Eric Schulte :

> > Thanns to the default cite action, I get for example in my org file:
> >
> >  [[cite:(119–136)johansson36:_minim_formal]]
> >
> > and it creates no reference at al, because via the export I get:
> >
> > \cite{(119–136)johansson36:_minim_formal}
> >
>
> Using the latest version of Org-mode from the git repository, this is a
> very new feature and requires usage of the git version of Org-mode, I am
> seeing the desired behavior.  After simply requiring ox-bibtex, the
> following
>
> * H1
> [[cite:(119–136)johansson36:_minim_formal]]
>
> exports to
>
> \begin{document}
>
> \maketitle
> \tableofcontents
>
> \section{H1}
> \label{sec-1}~\cite[119–136]{johansson36:_minim_formal}
> % Emacs 24.4.50.2 (Org mode beta_8.3)
> \end{document}
>
> As expected.
>
> I hope this helps,
> Eric
>
> --
> Eric Schulte
> https://cs.unm.edu/~eschulte
> PGP: 0x614CA05D (see https://u.fsf.org/yw)
>


Re: [O] Problem with org-mode after upgradiing to org 8

2014-06-30 Thread John Hendy
On Jun 30, 2014 4:48 AM, "Roland Everaert"  wrote:
>
> Second part of the message:
>
> Information from M-x org-version:
>
> Org-mode version beta_8.3 (beta_8.3-16-g16c71d6 @
/home/reveatwork/.emacs.d/site-lisp/org-mode/lisp/)
>
> I have downloaded the last version using git.

Can you elaborate on your exact procedure for upgrading as well as posting
relevant lines from .emacs?

John

>
> How can I switch to a stable branch instead of the last beta, to check if
that solves the problem?
>
>
> Thanks for your help.
>
>
>
> On Mon, Jun 30, 2014 at 11:24 AM, Roland Everaert 
wrote:
>>
>> Hi,
>>
>> I have recently upgraded to org-mode version 8. Each time I start emacs
I see the folloinwg error:
>>
>> error "Autoloading failed to define function org-element-cache-reset"
>>
>>
>> And some functionnality of org-mode doesn't seems to work anymore.
>>
>>
>> Informa
>
>


Re: [O] [PATCH] curly nested latex fragments

2014-06-30 Thread Nicolas Goaziou
Hello,

hero...@gentoo.org writes:

> Nicolas Goaziou  writes:
>
>> I do not mind extending syntax for LaTeX macros a bit if it helps users,
>> but first, I would like a clear definition of what subset of macros
>> should be supported in Org.
>>
>> See, for example,
>>
>>   http://orgmode.org/worg/dev/org-syntax.html#Entities_and_LaTeX_Fragments
>
> \ce{^{238}U} falls into \NAME POST, doesn't it?

Sorry I wasn't clear. I suggested to not use a regexp to describe the
syntax, as regular expressions may not be sufficient to describe the
object. Try to use something like the link above.

Also, bear in mind that a complicated regexp slows down parsing.

> Ha, I don't even aware of <...> syntex as a part of the LaTeX macro; I
> just copied the regex from org-latex.el.  So let's strip it out, and
> advise the users to use explicit LaTeX block for <...> constructs.
>
> + (looking-at (concat
> +  "\\([a-zA-Z]+\\*?\\)"
> +  "\\(?:\\[[^][\n]*?\\]\\)*"
> +  "\\(" (org-create-multibrace-regexp "{" "}" 3) "\\)\\{1,3\\}"))

Unfortunately, this is ambiguous with Org macro syntax.  For example, it
would match:

  \alpha{{{macro(arg)}}}

which is an entity followed by a macro.

> Do you mean this[2] and this[3] threads?  I've read them through, and
> remotely understood the difficulty coming from the ambiguity of the
> syntax.  And as discussed above, the difficulty manifests in the
> definition of LaTeX fragments, too.

There is no ambiguity in LaTeX fragments, as Org is not required to
support full raw LaTeX syntax (and never did anyway), as long as we
provide markup to insert LaTeX in the buffer anyway.

If we can support a bit more without introducing corner cases, that's
fine. But, as you say, that's just syntactic sugar, so pure Org syntax
goes first.

> At the same time, these syntax sugar is great.  And that's the reason
> why we prefer org-mode in composing LaTeX to pristine LaTeX.  There is a
> sincere need to compromise the cleanness of the implementation for the
> sake of an ambiguous-but-human-intuitive syntax.

@@l:\ce{^{238}U}@@ is not so bad, nor is {{{ce(^{238)U)}}} with
a properly defined macro template.

Anyway, let me stress it again: a change to macro syntax is fine if it
introduces no ambiguity. Obviously, the same holds for sub/superscript.

> To resolve this dilemma, we need a formal (mathematically rigorous) org
> syntex specification, like the rules drafted in
>
>   http://orgmode.org/worg/dev/org-syntax.html#Entities_and_LaTeX_Fragments
>
> together with a set of test suites to demonstrate the spec.  There would
> be a lot of work, but we could start from embedded LaTeX fragments and
> super(sub)scripts/underline.
>
> It might be mentally overwhelming for one single guy to do the spec and
> the implementation at the same time, because they require different
> mindsets.  The spec is long term and should be stable while the
> implementation is always being optimized.  After all, it is considered
> good practice to make the two processes independent to each other.

I'm not sure what do you mean. "org-syntax.html" describes, well, the
syntax (although it could be better, with, e.g., EBNF, help is welcome),
"org-element.el" implements it, with optimizations, and
"test-org-element.el" tests the implementation.

Anyway, let's concentrate on LaTeX macros.


Regards,

-- 
Nicolas Goaziou



Re: [O] [patch] [babel] Patches to fix tangling and variable transfer of tables in R

2014-06-30 Thread Nicolas Goaziou
Hello,

Rainer M Krug  writes:

> Attached please find two patches ready for application to fix that table
> variables were not usable adter tangling as temporary files were used.
> These patches were discussed in the thread "[babel][PATCHES] ob-R
> patches for review"

I have not much to say about the feature, since I don't use R. Usual
nitpicking follows.

> +(if (integerp value) (format "%s <- %s" name (concat (number-to-string 
> value) "L"))
> +  (if (floatp value) (format "%s <- %s" name value)
> + (if (stringp value) (format "%s <- %S" name value) 
> +   (format "%s <- %S" name (prin1-to-string value)))

I think a `cond' would be more readable here.


Regards,

-- 
Nicolas Goaziou



Re: [O] Always use \hyperref for internal Links in PDF export?

2014-06-30 Thread Nicolas Goaziou
Hello,

Bernd Haug  writes:

> Given a Document:
>
> —
> [[Section 1]]
>
> Bla, bla
>
> [[Section 2]]
>
> The blah blah is [[Section1][covered well above]], so let me just say:
> [[Section 1]]!
> —
>
> I get:
>
> —
> …
> The blah blah is \hyperref[Section 1]{covered well above}, so let me
> just say: \ref{Section 1}
> …
> —
>
> Is there a any way (without just always writing [[Section 1][Section
> 1]]) to always get the former behaviour, but just repeating the Title
> itself if no explicit link text was provided? That is:
>
> —
> …
> The blah blah is \hyperref[Section 1]{covered well above}, so let me
> just say: \hyperref[Section 1]{Section 1}

Not out of the box: this is a feature. Though, you can write a macro for
that:

  #+MACRO: sec [[$1][$1]]

and, instead of writing

  [[Section 1]]

you will use

  {{{sec(Section 1)}}}

Obviously, it only works if the value is exactly the same if both
arguments.


Regards,

-- 
Nicolas Goaziou



[O] numbered equations in html export

2014-06-30 Thread Eric Schulte
Hi,

All equations are numbered "1" when the attached example file is
exported to HTML.

#+Title: Example

* H1
See Equation [[the-first]],

#+name: the-first
\begin{equation}
n_{i+1} = \frac{n_{i} (d-i) (e-1)}{(i+1)}
\end{equation}

and also Equation [[the-second]].

#+name: the-second
\begin{equation}
n_{0} = 1
\end{equation}


Thanks,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)


Re: [O] how to handle backend-specific types as fuzzy link targets during export

2014-06-30 Thread Eric Schulte
Nicolas Goaziou  writes:

> Hello,
>
> Eric Schulte  writes:
>
>> Attached
>
> OK, now I get it.
>
> You're working at the wrong level. `latex-fragment' is an object
> (inline) type, but you're inserting it at the element's level. The
> equivalent (non inline) element is `latex-environment', which is, for
> example:
>
>   \begin{equation}
>   1+1=2
>   \end{equation}
>
> So you could simply replace `latex-fragment' type with
> `latex-environment', and your example should work properly.
>

Confirmed, using `latex-environment' does give the desired behavior.

A related question.  Is there a command to re-number figures in export?
After adding latex-environments in a function added to the
`org-export-filter-parse-tree-functions' hook, all figures are numbered
"1".

Thanks,

>
> HTH,
>
>
> Regards,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



[O] Bug: recurring mesages - Invalid face reference: nil [nnn times] [8.2.7b (8.2.7b-1-ga5beff-elpa @ c:/home/george/.emacs.d/elpa

2014-06-30 Thread George Pearson
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

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

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




Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200)
 of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.7b (8.2.7b-1-ga5beff-elpa @ 
c:/home/george/.emacs.d/elpa/org-20140630/)

current state:
==
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-ndays 1
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 turn-on-font-lock)
 org-directory "/home/george/orgfiles/"
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-agenda-files '("~/orgfiles/master.org" "~/orgfiles/recurring.org")
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-confirm-shell-link-function 'yes-or-no-p
 )

The message:

Invalid face reference: nil [nnn times]

where, nnn is replaced by a number, appears frequently in the *Messages* 
buffer.

How I reproduce it:
1. start emacs
2. open any file
3. open a 2nd window or frame for the *Messages* buffer
4. type ctrl-g in the open file's buffer - notice only Quit messages in
the *Messages* buffer i.e. the normal effect
5. open master.org
6. create an agenda with ctrl-a a
7. type "G" into the agenda window (This is just one of several ways to
produce the problem.)
8. now type ctrl-g in ANY of the open file's buffers or the agenda window
itself and observe the "QuitInvalid face reference ..." message.

What I've tried:

- debug-on-error t - nothing happened
- debug-on-entry to message function - nothing happened
- attached advice to message function, as described at
  http://www.emacswiki.org/emacs/DebugMessages.  That also did nothing -
  perhaps because the message occurs in a "repaint"?

Observations:
- it's interesting that once the effect is triggered in org, then it
occurs everywhere
- this problem does NOT happen if I switch back to org 7.9.3f.
- if I don't use org from ELPA and instead use org 8.2.6 in a site-lisp 
directory, the problem still happens

Any ideas?

- George



[O] org-special-keyword face not showing in sublevels anymore since commit 69700e1

2014-06-30 Thread Martin Carlé
It appears that by commit 69700e1 [22.04.2014 13:09] a little bug
slipped into the codebase, sinc the org-special-keyword face is only
shown at the top level in the correct face, but then gets simply
overwritten by the respective sublevel face. 

I guess, this is not intented and would be nice to have it fixed.

best,
mc

-- 
Fetch my gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 7E3CA33F



smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Bug: recurring mesages - Invalid face reference: nil [nnn times] [8.2.7b (8.2.7b-1-ga5beff-elpa @ c:/home/george/.emacs.d/elpa

2014-06-30 Thread Nick Dokos
"George Pearson"  writes:


> The message:
>
> Invalid face reference: nil [nnn times]
>
> where, nnn is replaced by a number, appears frequently in the
> *Messages* buffer.
>
> How I reproduce it: 1. start emacs 2. open any file 3. open a 2nd
> window or frame for the *Messages* buffer 4. type ctrl-g in the open
> file's buffer - notice only Quit messages in the *Messages* buffer
> i.e. the normal effect 5. open master.org 6. create an agenda with
> ctrl-a a 7. type "G" into the agenda window (This is just one of
> several ways to produce the problem.)  8. now type ctrl-g in ANY of
> the open file's buffers or the agenda window itself and observe the
> "QuitInvalid face reference ..." message.
>
> What I've tried:
>
> - debug-on-error t - nothing happened - debug-on-entry to message
> function - nothing happened - attached advice to message function, as
> described at
>   http://www.emacswiki.org/emacs/DebugMessages.  That also did nothing
>   - perhaps because the message occurs in a "repaint"?
>
> Observations: - it's interesting that once the effect is triggered in
> org, then it occurs everywhere - this problem does NOT happen if I
> switch back to org 7.9.3f.  - if I don't use org from ELPA and instead
> use org 8.2.6 in a site-lisp directory, the problem still happens
>
> Any ideas?
>

I can't reproduce it in my setup, but I found this note in the gnus
changelog which might (or might not) be illuminating:

,
| 2012-12-27 Wolfgang Jenkner 
| 
|   * gnus-spec.el (gnus-face-face-function): Don't use nil as no-op face
|   place holder since this gives `Invalid face reference: nil'
|   messages.  Use the `default' face instead.  It has the same
|   effect here, even though it is not no-op.
`

The message is produced by merge_face_ref() in xfaces.c however, so
elisp debugging is probably not applicable: you have to run emacs under
gdb to catch it. But maybe somebody will have a better idea.

Nick







[O] "TOC" in a buffer

2014-06-30 Thread Sharon Kimble
Following on from the theme of "Table of Contents", is it possible to
just have a "TOC" for the file that it is in? Like -
--8<---cut here---start->8---
-*- mode: org -*-
#+STARTUP: overview

"Table of Contents"

 * blah
 ** de blah
Blurb and onwards. 
--8<---cut here---end--->8---

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, fluxbox 1.3.5, emacs 24.3.92.1


signature.asc
Description: PGP signature


Re: [O] "TOC" in a buffer

2014-06-30 Thread Thomas S. Dye
Aloha Sharon,

Sharon Kimble  writes:

> Following on from the theme of "Table of Contents", is it possible to
> just have a "TOC" for the file that it is in? Like -
> -*- mode: org -*-
> #+STARTUP: overview
>
> "Table of Contents"
>
>  * blah
>  ** de blah
> Blurb and onwards. 

I'm not sure I understand your question.  If you are looking for a table
of contents that shows in the buffer, rather than just in exported
files, then you might take a look at the Imenu package, which on my Mac
gives a drop down menu in the tool bar that shows the first two levels
of headings in the file, and at John Kitchin's org-ref code, discussed
on the list recently, which implements a link that not only shows the
table of contents when it is clicked, but also exports correctly.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] "TOC" in a buffer

2014-06-30 Thread Eric Abrahamsen
Sharon Kimble  writes:

> Following on from the theme of "Table of Contents", is it possible to
> just have a "TOC" for the file that it is in? Like -
>
> -*- mode: org -*-
> #+STARTUP: overview
>
> "Table of Contents"
>
>  * blah
>  ** de blah
> Blurb and onwards. 
>
> Thanks
> Sharon.

Yup, try org-toc in the contrib directory.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread Ian Barton

On 29/06/14 19:51, D. C. Toedt wrote:
 at http://www.CommonDraft.org, and plan to expand and maintain it.


QUESTION:  I'm currently using a single, multi-level table of contents
(TOC) at the beginning of the document.  That ends up being a lot to
scroll through to get to the first chapter.  I'd like instead to have:

  * a one-level "master" TOC at the beginning of the document, listing
and linking to just the articles (in contracts, "articles" are the
same as "chapters" in books, that is, the top-level sections); and

  * at the beginning of each article, a TOC listing and linking to the
subheadings within that article.



Not an org-mode solution, but if your audience is consuming the content 
as a web page generated from org-mode, you can do most of this using jQuery.


What I am suggesting is you make your TOC collapsible and clicking on a 
heading in the TOC expands the links to the sub headings underneath the 
heading. You can probably do nested collapsible headings so you can 
expand various level of subheadings like a concertina.


I am definitely not a Javascript expert, but I have managed to use this 
technique on some of my documents.


Ian.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
Thanks, Ian.  I've done things like that in the past, but it'd entail
maintaining the TOC by hand, which I was hoping to avoid.  True, I'd be
able to create the initial TOC using org-mode, followed by manually
inserting jQuery calls.  But I'd have to manually edit the TOC every time I
added a new chapter or section and every time I edited a heading title.






On Mon, Jun 30, 2014 at 1:40 PM, Ian Barton  wrote:

> On 29/06/14 19:51, D. C. Toedt wrote:
>  at http://www.CommonDraft.org, and plan to expand and maintain it.
>
>>
>> QUESTION:  I'm currently using a single, multi-level table of contents
>> (TOC) at the beginning of the document.  That ends up being a lot to
>> scroll through to get to the first chapter.  I'd like instead to have:
>>
>>   * a one-level "master" TOC at the beginning of the document, listing
>>
>> and linking to just the articles (in contracts, "articles" are the
>> same as "chapters" in books, that is, the top-level sections); and
>>
>>   * at the beginning of each article, a TOC listing and linking to the
>> subheadings within that article.
>>
>>
> Not an org-mode solution, but if your audience is consuming the content as
> a web page generated from org-mode, you can do most of this using jQuery.
>
> What I am suggesting is you make your TOC collapsible and clicking on a
> heading in the TOC expands the links to the sub headings underneath the
> heading. You can probably do nested collapsible headings so you can expand
> various level of subheadings like a concertina.
>
> I am definitely not a Javascript expert, but I have managed to use this
> technique on some of my documents.
>
> Ian.
>
>


[O] Wrong numbering after removal of headline

2014-06-30 Thread York Zhao
Hi list,

As an example, I have the follow org-mode buffer:

* Level1
** Level2
*** Level3

If I export this to LaTeX (C-x C-e l p), it produces the following:

--8<---cut here---start->8---

Contents

1 Level1
1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .

--8<---cut here---end--->8---

Which is good. However, since what I need is that I don't want to produce the
"level1" heading, so I added the following code:

(defun yz/org-export-ignore-headline (contents backend info)
  "Ignore headlines with tag `ignoreheading'."
  (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
 (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
(replace-match "" nil nil contents)))

(add-to-list 'org-export-filter-headline-functions
 'yz/org-export-ignore-headline)

And I added tag "ignorheading" to the "Level1" heading. It works and produced:

--8<---cut here---start->8---

0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .

--8<---cut here---end--->8---

However, the headline numbering now starts from 0 which is wrong , what I want
is:

1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .

Can anyone please tell me how I could achieve this?

Thanks in advance

York



Re: [O] [PATCH] ob-shell: honor the specified shell for :session

2014-06-30 Thread Achim Gratz
Bastien writes:
> In the perspective of Org 8.3, we need to start updating etc/ORG-NEWS.

Done.

> Regardless of whether this was documented in the official manual or
> not, a note in ORG-NEWS would be useful -- feel free to start editing
> this file.

I've added all user-visible changes from me that will go into 8.3.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables




Re: [O] Pushing and pulling to google calendar

2014-06-30 Thread Doyley, Marvin
Thanks,

I will try  MobileOrg.
Cheers,
M
-- 





Re: [O] Pushing and pulling to google calendar

2014-06-30 Thread David Engster
Marvin M. Doyley writes:
> Is there a way to sync org-agenda with google calendar so that I can
> exploit googles calendar reminder.

org-caldav[1] works with Google Calendar on the old, deprecated CalDAV
endpoint (https://www.google.com/calendar/dav). I hear that the endpoint
is still working for some people, so maybe you are in luck.

Moving to the new endpoint would require OAuth authentication, which
shouldn't be hard to add using the oauth-library in ELPA, but since I
don't use Google, I'm lacking motivation...

-David

https://github.com/dengste/org-caldav




Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread Thomas S. Dye
Aloha York,

York Zhao  writes:

> Hi list,
>
> As an example, I have the follow org-mode buffer:
>
> * Level1
> ** Level2
> *** Level3
>
> If I export this to LaTeX (C-x C-e l p), it produces the following:
>
>
> Contents
>
> 1 Level1
> 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
>
> Which is good. However, since what I need is that I don't want to produce the
> "level1" heading, so I added the following code:
>
> (defun yz/org-export-ignore-headline (contents backend info)
>   "Ignore headlines with tag `ignoreheading'."
>   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>  (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
> (replace-match "" nil nil contents)))
>
> (add-to-list 'org-export-filter-headline-functions
>  'yz/org-export-ignore-headline)
>
> And I added tag "ignorheading" to the "Level1" heading. It works and produced:
>
>
> 0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> 0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
>
> However, the headline numbering now starts from 0 which is wrong , what I want
> is:
>
> 1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> 1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
> Can anyone please tell me how I could achieve this?

You could promote the Level2 subtree.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] still seeing semi-regular lockups

2014-06-30 Thread Alan Schmitt
On 2014-06-30 03:43, York Zhao  writes:

> I know that doesn't help much except for confirming the problem other people 
> was
> suffering. Sorry for the rant. I was too busy and too frustrated.
>
> By the way, what does ECM stands for?

Exemple Complet Minimal (French for minimal complete example)

http://orgmode.org/worg/org-faq.html#ecm

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpfvOW25eEeI.pgp
Description: PGP signature


Re: [O] numbered equations in html export

2014-06-30 Thread Nicolas Goaziou
Hello,

Eric Schulte  writes:

> All equations are numbered "1" when the attached example file is
> exported to HTML.
>
> #+Title: Example
>
> * H1
> See Equation [[the-first]],
>
> #+name: the-first
> \begin{equation}
> n_{i+1} = \frac{n_{i} (d-i) (e-1)}{(i+1)}
> \end{equation}
>
> and also Equation [[the-second]].
>
> #+name: the-second
> \begin{equation}
> n_{0} = 1
> \end{equation}

Only captioned equations are numbered. Behaviour is undefined for other
equations.


Regards,

-- 
Nicolas Goaziou



[O] indent c-c -?

2014-06-30 Thread Samuel Wales
i mark headlines then do c-c -.  i get this:

- 1
- 2

i would like this:

  - 1
  - 2

is there such a command?  if not, how does one write it?

thanks.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] how to handle backend-specific types as fuzzy link targets during export

2014-06-30 Thread Nicolas Goaziou
Hello,

Eric Schulte  writes:

> A related question.  Is there a command to re-number figures in
> export?

Figures are not numbered in the parse tree: their number is computed on
the fly during export, with `org-export-get-ordinal'.

> After adding latex-environments in a function added to the
> `org-export-filter-parse-tree-functions' hook, all figures are numbered
> "1".

See my answer in the other thread. The simplest solution is to add
a caption to them.


Regards,

-- 
Nicolas Goaziou



Re: [O] indent c-c -?

2014-06-30 Thread Grant Rettke
https://github.com/emacsmirror/multiple-cursors

is what I use for doing that specific thing
Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Mon, Jun 30, 2014 at 3:26 PM, Samuel Wales  wrote:
> i mark headlines then do c-c -.  i get this:
>
> - 1
> - 2
>
> i would like this:
>
>   - 1
>   - 2
>
> is there such a command?  if not, how does one write it?
>
> thanks.
>
> --
> The Kafka Pandemic: http://thekafkapandemic.blogspot.com
>
> The disease DOES progress.  MANY people have died from it.  And
> ANYBODY can get it.
>
> Denmark: free Karina Hansen NOW.
>



Re: [O] indent c-c -?

2014-06-30 Thread Samuel Wales
i don't want to invoke a separate command.  i want c-c - to indent by 2 spaces.

On 6/30/14, Grant Rettke  wrote:
> https://github.com/emacsmirror/multiple-cursors

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread York Zhao
> You could promote the Level2 subtree.

I had thought about this, but I don't think this will be trivial.

On Mon, Jun 30, 2014 at 3:37 PM, Thomas S. Dye  wrote:
> Aloha York,
>
> York Zhao  writes:
>
>> Hi list,
>>
>> As an example, I have the follow org-mode buffer:
>>
>> * Level1
>> ** Level2
>> *** Level3
>>
>> If I export this to LaTeX (C-x C-e l p), it produces the following:
>>
>>
>> Contents
>>
>> 1 Level1
>> 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>
>>
>> Which is good. However, since what I need is that I don't want to produce the
>> "level1" heading, so I added the following code:
>>
>> (defun yz/org-export-ignore-headline (contents backend info)
>>   "Ignore headlines with tag `ignoreheading'."
>>   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>>  (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>> (replace-match "" nil nil contents)))
>>
>> (add-to-list 'org-export-filter-headline-functions
>>  'yz/org-export-ignore-headline)
>>
>> And I added tag "ignorheading" to the "Level1" heading. It works and 
>> produced:
>>
>>
>> 0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> 0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>
>>
>> However, the headline numbering now starts from 0 which is wrong , what I 
>> want
>> is:
>>
>> 1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> 1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>
>> Can anyone please tell me how I could achieve this?
>
> You could promote the Level2 subtree.
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com



Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread Thomas S. Dye
M-S-left with point on the Level2 heading?

Tom

York Zhao  writes:

>> You could promote the Level2 subtree.
>
> I had thought about this, but I don't think this will be trivial.
>
> On Mon, Jun 30, 2014 at 3:37 PM, Thomas S. Dye  wrote:
>> Aloha York,
>>
>> York Zhao  writes:
>>
>>> Hi list,
>>>
>>> As an example, I have the follow org-mode buffer:
>>>
>>> * Level1
>>> ** Level2
>>> *** Level3
>>>
>>> If I export this to LaTeX (C-x C-e l p), it produces the following:
>>>
>>>
>>> Contents
>>>
>>> 1 Level1
>>> 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>> 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>
>>>
>>> Which is good. However, since what I need is that I don't want to produce 
>>> the
>>> "level1" heading, so I added the following code:
>>>
>>> (defun yz/org-export-ignore-headline (contents backend info)
>>>   "Ignore headlines with tag `ignoreheading'."
>>>   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>>>  (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>>> (replace-match "" nil nil contents)))
>>>
>>> (add-to-list 'org-export-filter-headline-functions
>>>  'yz/org-export-ignore-headline)
>>>
>>> And I added tag "ignorheading" to the "Level1" heading. It works and 
>>> produced:
>>>
>>>
>>> 0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>> 0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>
>>>
>>> However, the headline numbering now starts from 0 which is wrong , what I 
>>> want
>>> is:
>>>
>>> 1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>> 1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>
>>> Can anyone please tell me how I could achieve this?
>>
>> You could promote the Level2 subtree.
>>
>> hth,
>> Tom
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>
>

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread Nicolas Goaziou
Hello,

York Zhao  writes:

> As an example, I have the follow org-mode buffer:
>
> * Level1
> ** Level2
> *** Level3
>
> If I export this to LaTeX (C-x C-e l p), it produces the following:
>
>
> Contents
>
> 1 Level1
> 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
>
> Which is good. However, since what I need is that I don't want to produce the
> "level1" heading, so I added the following code:
>
> (defun yz/org-export-ignore-headline (contents backend info)
>   "Ignore headlines with tag `ignoreheading'."
>   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>  (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
> (replace-match "" nil nil contents)))
>
> (add-to-list 'org-export-filter-headline-functions
>  'yz/org-export-ignore-headline)

Don't do that at the filter level, which is too late for heavy structure
editing.  Use `org-export-before-parsing-hook' instead.  See section
12.14 in manual for an example.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] curly nested latex fragments

2014-06-30 Thread heroxbd
Hi Nicolas,

Nicolas Goaziou  writes:

> hero...@gentoo.org writes:
>
>> Nicolas Goaziou  writes:
>>
>>> I do not mind extending syntax for LaTeX macros a bit if it helps users,
>>> but first, I would like a clear definition of what subset of macros
>>> should be supported in Org.
>>>
>>> See, for example,
>>>
>>>   http://orgmode.org/worg/dev/org-syntax.html#Entities_and_LaTeX_Fragments
>>
>> \ce{^{238}U} falls into \NAME POST, doesn't it?
>
> Sorry I wasn't clear. I suggested to not use a regexp to describe the
> syntax, as regular expressions may not be sufficient to describe the
> object. Try to use something like the link above.
>
> Also, bear in mind that a complicated regexp slows down parsing.

Wow that's exactly what I was wondering when reading
org-element--parse-{elements,objects}.  It is a tokenizer in lexical
analysis, for which great tools exist for decades.

>> Ha, I don't even aware of <...> syntex as a part of the LaTeX macro; I
>> just copied the regex from org-latex.el.  So let's strip it out, and
>> advise the users to use explicit LaTeX block for <...> constructs.
>>
>> + (looking-at (concat
>> +  "\\([a-zA-Z]+\\*?\\)"
>> +  "\\(?:\\[[^][\n]*?\\]\\)*"
>> +  "\\(" (org-create-multibrace-regexp "{" "}" 3) 
>> "\\)\\{1,3\\}"))
>
> Unfortunately, this is ambiguous with Org macro syntax.  For example, it
> would match:
>
>   \alpha{{{macro(arg)}}}
>
> which is an entity followed by a macro.

Err, insert a white space?

   \alpha {{{macro(arg)}}}

Or expand the macro before latex-or-entity matching.

>> Do you mean this[2] and this[3] threads?  I've read them through, and
>> remotely understood the difficulty coming from the ambiguity of the
>> syntax.  And as discussed above, the difficulty manifests in the
>> definition of LaTeX fragments, too.
>
> There is no ambiguity in LaTeX fragments, as Org is not required to
> support full raw LaTeX syntax (and never did anyway), as long as we
> provide markup to insert LaTeX in the buffer anyway.
>
> If we can support a bit more without introducing corner cases, that's
> fine. But, as you say, that's just syntactic sugar, so pure Org syntax
> goes first.

I agree with you on this.

>> At the same time, these syntax sugar is great.  And that's the reason
>> why we prefer org-mode in composing LaTeX to pristine LaTeX.  There is a
>> sincere need to compromise the cleanness of the implementation for the
>> sake of an ambiguous-but-human-intuitive syntax.
>
> @@l:\ce{^{238}U}@@ is not so bad, nor is {{{ce(^{238)U)}}} with
> a properly defined macro template.
>
> Anyway, let me stress it again: a change to macro syntax is fine if it
> introduces no ambiguity. Obviously, the same holds for
> sub/superscript.

Hmmm, after reflection, my preference of \ce{^{238}U} comes from the
syntax of org-mode 7.9.

>> To resolve this dilemma, we need a formal (mathematically rigorous) org
>> syntex specification, like the rules drafted in
>>
>>   http://orgmode.org/worg/dev/org-syntax.html#Entities_and_LaTeX_Fragments
>>
>> together with a set of test suites to demonstrate the spec.  There would
>> be a lot of work, but we could start from embedded LaTeX fragments and
>> super(sub)scripts/underline.
>>
>> It might be mentally overwhelming for one single guy to do the spec and
>> the implementation at the same time, because they require different
>> mindsets.  The spec is long term and should be stable while the
>> implementation is always being optimized.  After all, it is considered
>> good practice to make the two processes independent to each other.
>
> I'm not sure what do you mean. "org-syntax.html" describes, well, the
> syntax (although it could be better, with, e.g., EBNF, help is welcome),
> "org-element.el" implements it, with optimizations, and
> "test-org-element.el" tests the implementation.

Sorry, it's my ignorance.  I didn't notice the tests/ dir.  So great
that the testing framework is already there.

> Anyway, let's concentrate on LaTeX macros.

Okay.

Cheers,
Benda



Re: [O] PDF output from Org

2014-06-30 Thread Brett Viren

David Masterson  writes:

> How do I control the page margins that Org uses in its Latex/PDF output?

I also just started a new doc today and wanted reduce the margins.
Normally I set all the various margin-related distances which I can
never seem to remember and have to go search for.  This time the search
turned up a nice one-liner:

#+LATEX_HEADER: \usepackage{fullpage}

I might even be able to remember this one next time.

Cheers,
-Brett.



pgpKk6H7E_so_.pgp
Description: PGP signature


Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread York Zhao
Hi Nicolas,

> Don't do that at the filter level, which is too late for heavy structure
> editing. Use `org-export-before-parsing-hook' instead.

I realized this, and had changed to use `org-export-before-parsing-hook', here
is my code:

(defun my-headline-removal (backend)
  "Ignore headlines with tag `ignoreheading'."
  (save-excursion
(when (eq org-export-current-backend 'latex)
  (org-map-entries (lambda ()
 (when (member "ignoreheading"
(org-get-tags-at nil 'local))
   (save-excursion
 (org-map-tree 'org-promote))
   (delete-region (line-beginning-position)
  (line-end-position

(add-hook 'org-export-before-parsing-hook 'my-headline-removal)

But I'm getting the error: "org-map-tree: Symbol's value as variable is void:
org-called-with-limited-levels". Any idea?

Thanks


On Mon, Jun 30, 2014 at 5:38 PM, Nicolas Goaziou  wrote:
> Hello,
>
> York Zhao  writes:
>
>> As an example, I have the follow org-mode buffer:
>>
>> * Level1
>> ** Level2
>> *** Level3
>>
>> If I export this to LaTeX (C-x C-e l p), it produces the following:
>>
>>
>> Contents
>>
>> 1 Level1
>> 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>
>>
>> Which is good. However, since what I need is that I don't want to produce the
>> "level1" heading, so I added the following code:
>>
>> (defun yz/org-export-ignore-headline (contents backend info)
>>   "Ignore headlines with tag `ignoreheading'."
>>   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>>  (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>> (replace-match "" nil nil contents)))
>>
>> (add-to-list 'org-export-filter-headline-functions
>>  'yz/org-export-ignore-headline)
>
> Don't do that at the filter level, which is too late for heavy structure
> editing.  Use `org-export-before-parsing-hook' instead.  See section
> 12.14 in manual for an example.
>
>
> Regards,
>
> --
> Nicolas Goaziou



[O] Installing from git

2014-06-30 Thread Vicente Vera
Hello. I'm quite confused with the installation options.

Recently started out a Debian base system and compiled Emacs from the bzr
repository. That came out fine, so I ran 'make install' and now Emacs
24.4.50 sits in /usr/local/bin, /usr/local/share, etc.

I want to install the master branch of org-mode. Currently I followed these
steps:

- cd ~/org_from_git/
- git clone git://orgmode.org/org-mode.git

¿Do i need to tweak 'local.mk' so the prefix variable points to
/usr/local/share before running make?
¿Which make option should i use (besides 'make autoloads')?

Thanks in advance.


Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread Ian Barton

On 2014-06-30 19:55, D. C. Toedt wrote:

Thanks, Ian.  I've done things like that in the past, but it'd entail
maintaining the TOC by hand, which I was hoping to avoid.  True, I'd
be able to create the initial TOC using org-mode, followed by manually
inserting jQuery calls.  But I'd have to manually edit the TOC every
time I added a new chapter or section and every time I edited a
heading title.  



You can do it without editing the TOC manually. You use the   
of each level of the org headline css as a selector in jQuery. You then 
add a JS function to the DocumentReady function which does the jQuery 
expanding/collapsing. This can all be done as part of your org-mode 
document. I can knock up a simple example tomorrow if it's of interest.


Best wishes,

Ian.




Re: [O] Installing from git

2014-06-30 Thread John Hendy
On Mon, Jun 30, 2014 at 5:44 PM, Vicente Vera  wrote:
> Hello. I'm quite confused with the installation options.
>
> Recently started out a Debian base system and compiled Emacs from the bzr
> repository. That came out fine, so I ran 'make install' and now Emacs
> 24.4.50 sits in /usr/local/bin, /usr/local/share, etc.
>
> I want to install the master branch of org-mode. Currently I followed these
> steps:
>
> - cd ~/org_from_git/
> - git clone git://orgmode.org/org-mode.git
>
> ¿Do i need to tweak 'local.mk' so the prefix variable points to
> /usr/local/share before running make?
> ¿Which make option should i use (besides 'make autoloads')?

Did you search around a bit? There's lots of posts with people's
setups. You certainly *can* install over the top of the Org that came
with your version of Emacs (pointing it to install to
/usr/local/share, I suppose), though I've never gone that route. Some
mailing list examples from googling about Orgmode git installation:
- Achim's post:
http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00609.html
- My setup: 
http://lists.gnu.org/archive/html/emacs-orgmode/2014-04/msg00396.html

>From mine, you'll note I never "install" Org -- just clone to a
directory, make, and tell Emacs about it in .emacs... done!


John

>
> Thanks in advance.



Re: [O] Wrong numbering after removal of headline

2014-06-30 Thread York Zhao
Finally, I got it all work and am happy with the result, here is the code:

(defun yz/org-export-ignore-headline (backend)
  "Ignore headlines with tag `ignoreheading'."
  (save-excursion
(let ((org-allow-promoting-top-level-subtree t))
  (org-map-entries
   (lambda ()
 (when (member "ignoreheading" (org-get-tags-at nil 'local))
   (org-promote-subtree)
   (delete-region (line-beginning-position) (line-end-position

(add-hook 'org-export-before-parsing-hook 'yz/org-export-ignore-headline)



[O] Force new page on exporting

2014-06-30 Thread York Zhao
I'm selectively exporting some subtree of an org-mode buffer, like this:

* Headline1  :export:
* Headline2
* Headline3  :export:

Question is: how do I force Headline3 to be on a new page while exporting to
LaTeX?

Thanks in advance



Re: [O] Force new page on exporting

2014-06-30 Thread Thomas S. Dye
Aloha York,

York Zhao  writes:

> I'm selectively exporting some subtree of an org-mode buffer, like this:
>
> * Headline1  :export:

#+latex: \newpage

> * Headline2
> * Headline3  :export:
>
> Question is: how do I force Headline3 to be on a new page while exporting to
> LaTeX?

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Force new page on exporting

2014-06-30 Thread York Zhao
Thanks Thomas. This works but is not an ideal approach because in a complex file
it may not be so easy to find out the location to insert the "\newpage"
instruction. Plus, each time when inserting new exported tree between
"Headline1" and "Headline2" you would have to remember to move the "\newpage" to
the end of the new tree.

On Mon, Jun 30, 2014 at 8:49 PM, Thomas S. Dye  wrote:
> Aloha York,
>
> York Zhao  writes:
>
>> I'm selectively exporting some subtree of an org-mode buffer, like this:
>>
>> * Headline1  :export:
>
> #+latex: \newpage
>
>> * Headline2
>> * Headline3  :export:
>>
>> Question is: how do I force Headline3 to be on a new page while exporting to
>> LaTeX?
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com



Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
That would be very much of interest, Ian.  One potential issue, though:
 The table of contents generated by org-mode uses just one ,
with nested  elements.

I spent a few hours tinkering with variations on the jQuery approach at
http://www.sitepoint.com/forums/showthread.php?822342-JavaScript-list-of-links-with-sub-lists-hide-and-show,
with code at http://jsfiddle.net/GeekyJohn/9kaQQ/.  It initially
looked promising, but I haven't been able to make it reliably play well
with having links in the TOC headings.  Of course, when it comes to jQuery
I'm not much better than a cargo-cult programmer.

Thanks,

--D. C.


Re: [O] Force new page on exporting

2014-06-30 Thread Thomas S. Dye
Aloha York,

York Zhao  writes:

> Thanks Thomas. This works but is not an ideal approach because in a complex 
> file
> it may not be so easy to find out the location to insert the "\newpage"
> instruction. Plus, each time when inserting new exported tree between
> "Headline1" and "Headline2" you would have to remember to move the "\newpage" 
> to
> the end of the new tree.


Agreed.  Something like this is more visible.

* Latex New Page :ignoreheading:
#+latex: \newpage

Also, see the LaTeX commands \pagebreak and \clearpage, which do
generally the same thing but in slightly different ways.

hth,
Tom

>
> On Mon, Jun 30, 2014 at 8:49 PM, Thomas S. Dye  wrote:
>> Aloha York,
>>
>> York Zhao  writes:
>>
>>> I'm selectively exporting some subtree of an org-mode buffer, like this:
>>>
>>> * Headline1  
>>> :export:
>>
>> #+latex: \newpage
>>
>>> * Headline2
>>> * Headline3  
>>> :export:
>>>
>>> Question is: how do I force Headline3 to be on a new page while exporting to
>>> LaTeX?
>>
>> hth,
>> Tom
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>
>

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] numbered equations in html export

2014-06-30 Thread Eric Schulte
Nicolas Goaziou  writes:

> Hello,
>
> Eric Schulte  writes:
>
>> All equations are numbered "1" when the attached example file is
>> exported to HTML.
>>
>> #+Title: Example
>>
>> * H1
>> See Equation [[the-first]],
>>
>> #+name: the-first
>> \begin{equation}
>> n_{i+1} = \frac{n_{i} (d-i) (e-1)}{(i+1)}
>> \end{equation}
>>
>> and also Equation [[the-second]].
>>
>> #+name: the-second
>> \begin{equation}
>> n_{0} = 1
>> \end{equation}
>
> Only captioned equations are numbered. Behaviour is undefined for other
> equations.
>

Why is this the default behavior?  It looks to me like even when they're
present captions on equations aren't displayed for HTML or LaTeX export.
Additionally I don't see why captions should be related to, or required
for, the numbering of equations.

In a related issue which I believe is more convincingly a bug; links to
equations (whether numbered or not, with or without captions) don't
actually point anywhere.  A link to the name is constructed, but no
anchor with the name is inserted into the page.

Would it make sense to change the current behavior as follows?

1. On HTML export all named equations are made into targets for a link
   based on their name.

2. All named and referenced equations are numbered.

Thanks,

>
>
> Regards,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)