Re: [O] org Publish subtree to pdf

2013-08-18 Thread Martin Leduc
Thanks for your answers. That worked perfectly.
Martin

 From: n.goaz...@gmail.com
 To: mart...@hotmail.com
 CC: emacs-orgmode@gnu.org
 Subject: Re: org Publish subtree to pdf
 Date: Sat, 17 Aug 2013 10:28:06 +0200
 
 Hello,
 
 Martin Leduc mart...@hotmail.com writes:
 
I have a large org file with several projects in it. I can export one of
  them (a subtree) to pdf by using C-c C-e C-s l o. However, I would like to
  use the Publish function since it allows to export the pdf to another 
  folder. 
 
  However, by using C-s (Subtree option) and P (for publish) and x (to choose
  template from org-publish-project-alist), the Subtree option does not seem
  to work well.
 
 Subtree export is not meant to be used along with publishing. The latter
 works on complete files only.
 
  The entire tree is exported though without the content of higher-level
  headlines.
 
  Is it the normal behavior to be expected from the publish function ? What is
  the best way to export in pdf to another location ?
 
 Use EXPORT_FILE_NAME node property. See penultimate paragraph from
 section 12.3 in the manual.
 
 
 Regards,
 
 -- 
 Nicolas Goaziou
  

[O] [patch][ox-latex] context-aware subscript

2013-08-18 Thread Rasmus
Hi,

Currently one can't write something like \beta_t and get a nice result
in org when exporting to LaTeX (where nice result := $\beta_t$).  This
patch tries to fix it.

Nicolas, you might consider this a can of worms, but since I'd
already worked on it a while ago I'll try my luck.  I'd appreciate if
you'd let me know something like this would be acceptable before I put
more work into it.

With this patch the following document

--8---cut here---start-8---
#+TITLE:
#+OPTIONS: toc:nil num:nil
#+LATEX:\Huge
* Math entity
1. \(\alpha\)\(\beta\)\(_\text{t}\)
2.  \(\alpha\)\(\beta\)\(_t\)
3. \alpha\beta_t
4. \alpha\times\beta_t\gamma
5. foo_bar
6. \beta_bar
--8---cut here---end---8---

translates to something like

--8---cut here---start-8---
\begin{enumerate}
\item \(\alpha\)\(\beta\)\(_t\)
\item $\alpha\beta_t$
\item $\alpha$\texttimes{}$\beta_{t\gamma}$
\item foo$_{\text{bar}}$
\item $\beta_{bar}$
\end{enumerate}
--8---cut here---end---8---

For the reference, this is the output with the current HEAD

--8---cut here---start-8---
\begin{enumerate}
\item \(\alpha\)\(\beta\)\(_\text{t}\)
\item \(\alpha\)\(\beta\)\(_t\)
\item $\alpha$$\beta$$_{\text{t}}$
\item $\alpha$\texttimes{}$\beta$$_{\text{t}\gamma}$
\item foo$_{\text{bar}}$
\item $\beta$$_{\text{bar}}$
\end{enumerate}
--8---cut here---end---8---

As is evident from the pdf output

  $\alpha$$\beta$$_{\text{t}}$ ≠ $\alpha$$\beta$$_{{t}}$ ≠ $\alpha\beta_{t}$

There seems to be no difference between $\alpha$$\beta$ and
$\alpha\beta$ in the pdf, but the latter is more aesthetically
pleasing in the source.

I (currently) don't see much use in trying to be context aware outside
of the entity case (e.g. \(x\)_t?), but I could be wrong.

–Rasmus

From eefe696de67bd4c9baefe928a58648c75adec41e Mon Sep 17 00:00:00 2001
From: rasmus ras...@gmx.us
Date: Sat, 13 Jul 2013 15:59:23 +0200
Subject: [PATCH] Improved subscript handling in ox-latex.

	* ox-latex.el (org-latex-subscript-format): Controls the
	format of subscripts.
	(org-latex-entity): Collects multiple math entities into one
	math fragment.
	(org-latex-entity): Collect proceeding subscripts into same
	math fragment.
	(org-latex--script-size): Better collection of subscripts into
	math-fragments.  Allows for different handling of
	math-subscripts and text subscripts.

In the above subscripts refers to subscripts and superscripts.
---
 lisp/ox-latex.el | 55 +--
 1 file changed, 45 insertions(+), 10 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 1fe918a..183c89a 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -552,6 +552,20 @@ returned as-is.
   :options '(bold code italic strike-through underline verbatim))
 
 
+(defcustom org-latex-subscript-format '(\\text{%s} . %s)
+  Formatting string or strings used for sub- and super-scripts.
+
+If `org-latex-subscript-format' is a cons of two strings, the first
+element will be used when a subscript is plain text,
+e.g. foo_bar, and the second will be used when a subscript is
+math, e.g. beta_t.
+
+If `org-latex-subscript-format' is a string this is used in both
+cases.
+
+The string should contain \%s\, which is then replaced by the
+actual subscript.)
+
  Drawers
 
 (defcustom org-latex-format-drawer-function nil
@@ -1234,8 +1248,23 @@ holding contextual information.  See `org-export-data'.
   Transcode an ENTITY object from Org to LaTeX.
 CONTENTS are the definition itself.  INFO is a plist holding
 contextual information.
-  (let ((ent (org-element-property :latex entity)))
-(if (org-element-property :latex-math-p entity) (format $%s$ ent) ent)))
+  (let ((ent (org-element-property :latex entity))
+	(prev (org-export-get-previous-element entity info))
+	(next (org-export-get-next-element entity info))
+	(post-blanks-p (= (or (org-element-property :post-blank entity) 1) 0))
+	(pre-blanks-p (= (or (org-element-property :post-blank
+		   (org-export-get-previous-element
+		entity info)) 1) 0))
+	(scripts '(subscript superscript)))
+(if (not (org-element-property :latex-math-p entity)) ent
+  (concat
+   (if (and pre-blanks-p
+		(or (org-element-property :latex-math-p prev)
+		(memq (org-element-type prev) scripts)))  $)
+   ent
+   (if (and post-blanks-p
+		(or (org-element-property :latex-math-p next)
+		(memq (org-element-type next) scripts)))  $)
 
 
  Example Block
@@ -2217,8 +2246,12 @@ channel.
 			   (let ((blank (org-element-property :post-blank obj)))
 			 (and blank ( blank 0) \\ ))
 	  (plain-text
-	   (setq output
-		 (format %s\\text{%s} output (org-export-data obj info
+	   (let* ((mathp (org-element-property :latex-math-p (org-export-get-previous-element (org-export-get-parent obj) info)))
+		  

[O] [patch][org-entities] More symbols

2013-08-18 Thread Rasmus
Hi,

This patch adds some general interest(?) symbols to org entities that
otherwise lived in my init file.

1. I don't know how to easily check whether a glyph is supported by
   Latin 1, so Latin 1 entries correspond to the ASCII equivalent.

2. HTML symbols have been tested in Firefox.  In a few cases I
   couldn't find a pretty name (like pi;) in which case I've
   supplied the unicode number (like 960;).  Is that OK?  (E.g. can
   Org produce non-uft8 HTML?)

3. In LaTeX the symbols are mostly defined in amsmath, except coloneqq
   and eqqcolon which requires something like mathtools or kpfonts or
   possibly unicode-math.  Is that OK?  I also fixed some
   inconsistencies.  E.g. loz was loaded diamond even though loz is
   defined in amssymb and ~ and \tilde produced different results
   (the latter produces the irritating \~{} often observed among
   (social science?) university professors...).

–Rasmus

From ed467f7de217d9cafb74f743309e44e91ad9cf25 Mon Sep 17 00:00:00 2001
From: rasmus ras...@gmx.us
Date: Sun, 18 Aug 2013 17:42:33 +0200
Subject: [PATCH] More org-entities.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* org-entities.el (org-entities): Add support for ell, imath,
jmath, varphi, varomega, varpi, aleph, gimel, beth, dalet,
cdots, S (§), dag, ddag, colon, therefore, because, coloneqq,
eqqcolon, triangleq, leq, geq, lessgtr, lesseqgtr, ll, gg,
prec, preceq, preccurleyeq, succ, succeq, succurleyeq,
setminus, nexist(s), implies, impliedby, iff, diamond.
Changes loz and tilde.

In LaTeX these symbols are mostly defined in amssymb. coloneqq and
eqqcolon require kpfonts or mathtools or similar in LaTeX.
---
 lisp/org-entities.el | 43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index a1519b0..0012566 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -154,6 +154,9 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 (real \\Re t real; R R ℜ)
 (image \\Im t image; I I ℑ)
 (weierp \\wp t weierp; P P ℘)
+(ell \\ell t ell; ell ell ℓ)
+(imath \\imath t imath; dotless i dotless i ı)
+(jmath \\jmath t jmath; dotless j dotless j ȷ)
 
 ** Greek
 (Alpha A nil Alpha; Alpha Alpha Α)
@@ -203,6 +206,7 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 (upsilon \\upsilon t upsilon; upsilon upsilon υ)
 (Phi \\Phi t Phi; Phi Phi Φ)
 (phi \\phi t phi; phi phi φ)
+(varphi, \\varphi t varphi; varphi varphi ɸ )
 (Chi X nil Chi; Chi Chi Χ)
 (chi \\chi t chi; chi chi χ)
 (acutex \\acute x t acute;x 'x 'x 푥́)
@@ -211,11 +215,17 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 (tau \\tau t tau; tau tau τ)
 (Omega \\Omega t Omega; Omega Omega Ω)
 (omega \\omega t omega; omega omega ω)
+(varomega \\varomega t #631; varomega varomega ɷ)
 (piv \\varpi t piv; omega-pi omega-pi ϖ)
+(varpi \\varpi t piv; omega-pi omega-pi ϖ)
 (partial \\partial t part; [partial differential] [partial differential] ∂)
 
 ** Hebrew
 (alefsym \\aleph t alefsym; aleph aleph ℵ)
+(aleph \\aleph t alefsym; aleph aleph ℵ)
+(gimel \\gimel t gimel; gimel gimel ℷ)
+(beth \\beth t beth; beth beth ב)
+(dalet \\daleth t daleth; dalet dalet ד)
 
 ** Dead languages
 (ETH \\DH{} nil ETH; D Ð Ð)
@@ -227,6 +237,7 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 ** Dots and Marks
 (dots \\dots{} nil hellip; ... ... …)
 (hellip \\dots{} nil hellip; ... ... …)
+(cdots \\cdots t #8943; ... ... ⋯)
 (middot \\textperiodcentered{} nil middot; . · ·)
 (iexcl !` nil iexcl; ! ¡ ¡)
 (iquest ?` nil iquest; ? ¿ ¿)
@@ -255,18 +266,21 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 (circ \\^{} nil circ; ^ ^ ˆ)
 (vert \\vert{} t #124; | | |)
 (brvbar \\textbrokenbar{} nil brvbar; | ¦ ¦)
+(S \\S nil sect; paragraph § §)
 (sect \\S nil sect; paragraph § §)
 (amp \\ nil amp;   )
 (lt \\textless{} nil lt;   )
 (gt \\textgreater{} nil gt;   )
-(tilde \\~{} nil tilde; ~ ~ ~)
+(tilde \\textasciitilde{} nil tilde; ~ ~ ~)
 (slash / nil / / / /)
 (plus + nil + + + +)
 (under \\_ nil _ _ _ _)
 (equal = nil = = = =)
 (asciicirc \\textasciicircum{} nil ^ ^ ^ ^)
 (dagger \\textdagger{} nil dagger; [dagger] [dagger] †)
+(dag \\dag{} nil dagger; [dagger] [dagger] †)
 (Dagger \\textdaggerdbl{} nil Dagger; [doubledagger] [doubledagger] ‡)
+(ddag \\ddag{} nil Dagger; [doubledagger] [doubledagger] ‡)
 
 ** Whitespace
 (nbsp ~ nil nbsp;  )
@@ -297,6 +311,7 @@ packages to be loaded, add these packages to `org-latex-packages-alist'.
 (plusmn \\textpm{} nil plusmn; +- ± ±)
 (times \\texttimes{} nil times; * × ×)
 (frasl / nil frasl; / / ⁄)
+(colon \\colon 

[O] WISH: SQL on org-mode tables

2013-08-18 Thread Johan W . Klüwer
I wish it were possible to execute SQL on tables in org-mode buffers.
Filtering rows and columns, joining values across named tables, and so
forth could be done with SQL in the org-table SEND clauses.

There's a script called csvsql that allows for executing SQL on comma- or
tab-separated files from the command-line (using the H2 database engine):
https://github.com/jdurbin/durbinlib/wiki/csvsql. I'm thinking csvsql or
similar could provide the query capability, and org-mode would take care of
sending it org tables in tab separated format.

That's my wish.

Cheers

Johan


[O] org-capture changes the buffer ring in a confusing way

2013-08-18 Thread Samuel Wales
When I use capture, the buffer ring ordering changes from what it was
before the capture.  It even changes when I cancel the capture.  Is
there a way to keep it exactly as it was in all cases?

What I expected was that previous-buffer would be the same before and
after and that next-buffer would be the same before and after.  [In
other words, that capture + capture finalizing would not change
anything.  The philosophy of capture, to my understanding, is that
capture is intended to allow you to take a note with minimum
distraction.]

What I tried was org-capture.

What I noticed was that the buffer ring ordering had changed.

I have previous-buffer and next-buffer set to function keys, and I
find them extremely useful.  But when the buffer ring ordering
changes, I get confused.  So capture confuses me.

Also, it seems to always split the window.  Is there a way to fix that
that is better than my current method of deleting other windows in the
hook?  I always require a single window.

Thanks.

Samuel

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

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

Denmark: free Karina Hansen NOW.