Re: [O] How to safely update from ver. 8.2.10 to 8.3.x

2016-08-15 Thread Maria Shinoto

Thanks again, this was really helpful, and I understand the logic.

To explain what worked:

- My Emacs was simply the downloaded version of "EmacsForOSX", which 
resides in the application folder.


- The path to the emacs file that opens from the Terminal turned out to be
 /Applications/Emacs.app/Contents/MacOS/Emacs

- So the Terminal commands was

 /Applications/Emacs.app/Contents/MacOS/Emacs -Q

- After checking that only the 2 regular buffers were active and orgmode 
not loaded, I installed the package with the package manager.




It worked well, my org-mode is now the newest version, and updating this 
way was really easy.



May I suggest that the procedure that Malcolm explained so well will be 
part of the explanation/wiki/manuals?


Beginners like me can become confused -- software bug, stupid user bug, 
what else...



Cheers to the list,
Maria




Am 16.08.16 um 13:19 schrieb Cook, Malcolm:

Answers are out of order:

(2) - oops , you are correct.  What you want is:


emacs -Q -batch -eval "(progn (require 'package)
(package-initialize) (package-refresh-contents) (package-install
'org))"



(1) - you have 2 copies of emacs installed on your mac probably one
in /usr/bin/emacs .  How did you install the gui version?  If
Homebrew, then the other is in /usr/local/bin/emacs.  If EmacsForOSX
then, if I remember correctly, it is in /Applications/Emacs.app which
is really just a folder and which contains in it Emacs the actual
emacs program to run.  In any case, just replace emacs in the above
command line with the full path to the emacs you are using, like
this:


/usr/local/bin/emacs -Q -batch -eval "(progn (require 'package)
(package-initialize) (package-refresh-contents) (package-install
'org))"


or this


/Applications/Emacs.app/emacs -Q -batch -eval "(progn (require
'package) (package-initialize) (package-refresh-contents)
(package-install 'org))"



(3)  yes - start a fresh emacs and don't load your init.el file,
using the -Q option, like this


/Applications/Emacs.app/emacs -Q


And then don't load any .org files!!! Go directly to the package
manager and refresh your org installation like any other package.

~ malcolm_c...@stowers.org

 From: Maria Shinoto
 Sent: Monday, August 15, 2016 6:06 PM To: Cook,
Malcolm Subject: Re: [O] How to safely update from ver. 8.2.10 to
8.3.x

Hi,

so, it was good that I asked, thanks for your advice.

I got the idea, but there are two questions left. I prefer simple
org since I am a beginner and want to start with the standards.


emacs -Q -batch -eval "(progn (require 'package) (add-to-list
'package-archives '(\"org\" . \"http://orgmode.org/elpa/\;))
(package-initialize) (package-refresh-contents) (package-install
'org-plus-contrib))"



Note: I use org-plus-contrib from melpa instead of org.  If you
want just org, you could simply:

emacs -Q -batch -eval "(progn (require 'package)
(package-initialize) (package-refresh-contents) (package-install
'org-plus-contrib))"


(1) When I check my emacs version in the Terminal (running Mac OS X
10.11), I get version "GNU Emacs 22.1.1", while asking from the GUI
shows version 24.5 (9.0). I do not understand why this can happen,
how these are separated and how they influence each other.
Furthermore, if they are separate, how should an installation from
the Terminal influence the situation in the GUI?



(2) Your second script is different, but it still deals with
"org-plus-contrib". Could you verify the script so that I can be
sure that I install the right org-mode version?


(3) Is there a way to safely install the org-mode package from the
GUI package manager? This would be easiest, since I intend to go on
with the GUI emacs. In other words, I am looking for a way to start
the GUI without org-mode loaded (similar to "emacs -Q" in the
Terminal).


Thanks again, Maria






[O] Sharing documents with bibtex bibliography from org to non-org users

2016-08-15 Thread Martin Leduc

Hi orgers,

People using org-mode or LaTeX to write scientific papers inevitably 
face problems when the time comes to share a manuscript with co-authors 
for reviewing. Unless one decides to restrict the choice of his 
co-authors based exclusively on their knowledge of LaTeX, collaborators 
generally use Microsoft Word to write their documents.


One way to share LaTeX documents with non-LaTeX users is to simply 
copy-paste the LaTeX file into a Word document. You can then share this 
file with other people along with the pdf-compiled version to allow them 
to see all references, bibliography, equations and figures. This is the 
most convenient approach for the first author, who can simply copy-paste 
back the text into a tex file after the rounds of review and then 
compile the LaTeX manuscript again following some minor debugging.


However, the latter approach may not be suitable in several situations. 
For instance, it could be because the document is intended to stay into 
a word format for whatever reason, or simply because you want to be kind 
with some co-authors that wouldn't pay much interest into a scary 
document filled with complicated codes.


So I would like to know what are the best known strategies to circumvent 
the latter issue. To simplify, I accept that I will need to rewrite the 
equations (and eq. numbers) in the Word document. What I really want, 
however, is all the citations and the list of references being managed 
automatically at the step of exporting from org to ODT or to Plain Text.


The only solution I see from now is to export the org document to a 
plain pdf (e.g. with no page numbers) and then to copy paste from the 
pdf to a Word documents. This strategy is rather cumbersome as a lot of 
work is needed in terms of formatting the word document (page wrapping, 
no line breaks between paragraphs, words hyphenation, etc).


Is there any cleaner solutions to this issue ? Or more general ideas on 
how we could facilitate the sharing documents containing a bibtex 
bibliography between org and non-org users ?


Thanks

Martin






[O] Sharing documents with bibtex bibliography from org to non-org users

2016-08-15 Thread Martin Leduc

Hi orgers,

People using org-mode or LaTeX to write scientific papers inevitably 
face problems when time comes to share a manuscript with co-authors for 
reviewing. Unless one decides to restrict the choice of his co-authors 
based exclusively on their knowledge of LaTeX, collaborators generally 
use Microsoft Word to write their documents.


One way to share LaTeX documents with non-LaTeX users is to simply 
copy-paste the LaTeX file into a Word document. You can then share this 
file with other people along with a pdf-compiled version of the 
manuscript allowing them to see all references, bibliography, equations 
and figures. This is the most convenient approach for the first author, 
who can simply copy-paste back the text into a tex file after the rounds 
of review and then compile the LaTeX manuscript again following some 
minor debugging.


However, the latter approach may not be suitable in situations where the 
document is intended to stay into a word format for whatever reason. It 
could be for instance because you want to be kind with some co-authors 
that wouldn't pay much interest into a scary document filled with 
complicated codes.


So I would like to know what are the best known strategies to circumvent 
the latter issue. To simplify, I accept that I will need to rewrite the 
equations (and eq. numbers) in the Word document. What I really want, 
however, is all the citations and the list of references being managed 
automatically at the step of exporting from org to ODT or to Plain Text.


The only solution I see now is to export the org document to a plain pdf 
(e.g. with no page numbers) and then to copy-paste the pdf into a Word 
document. This strategy is cumbersome because a lot of work is generally 
needed to format the word document (page wrapping, no line breaks 
between paragraphs, words hyphenation, etc).


Is there any cleaner solutions to this issue ? Or more general ideas on 
how we could facilitate the sharing of documents containing a bibtex 
bibliography between org and non-org users ?


Thanks

Martin





Re: [O] Bug: clock table report hang when using :tags [8.2.10 (release_8.2.10 @ c:/Program Files/emacs/share/emacs/24.5/lisp/org/)]

2016-08-15 Thread Yichao Woo
Here is the Error trace I got with Org uncompiled

Debugger entered--Lisp error: (quit)
  (save-restriction (widen) (end-of-line) (if (re-search-backward
org-outline-regexp-bol nil t) (1- (- (match-end 0) (match-beginning
0))) 0))
  (save-excursion (save-restriction (widen) (end-of-line) (if
(re-search-backward org-outline-regexp-bol nil t) (1- (- (match-end 0)
(match-beginning 0))) 0)))
  org-outline-level()
  outline-up-heading(1 t)
  (while (> (funcall outline-level) 1) (outline-up-heading 1 t)
(put-text-property (point) (point-at-eol)
:org-clock-force-headline-inclusion t))
  (progn (while (> (funcall outline-level) 1) (outline-up-heading 1 t)
(put-text-property (point) (point-at-eol)
:org-clock-force-headline-inclusion t)))
  (unwind-protect (progn (while (> (funcall outline-level) 1)
(outline-up-heading 1 t) (put-text-property (point) (point-at-eol)
:org-clock-force-headline-inclusion t))) (set-match-data
save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal (match-data))) (unwind-protect
(progn (while (> (funcall outline-level) 1) (outline-up-heading 1 t)
(put-text-property (point) (point-at-eol)
:org-clock-force-headline-inclusion t))) (set-match-data
save-match-data-internal (quote evaporate
  (save-excursion (let ((save-match-data-internal (match-data)))
(unwind-protect (progn (while (> (funcall outline-level) 1)
(outline-up-heading 1 t) (put-text-property (point) (point-at-eol)
:org-clock-force-headline-inclusion t))) (set-match-data
save-match-data-internal (quote evaporate)
  (if headline-filter (save-excursion (let ((save-match-data-internal
(match-data))) (unwind-protect (progn (while (> (funcall
outline-level) 1) (outline-up-heading 1 t) (put-text-property (point)
(point-at-eol) :org-clock-force-headline-inclusion t)))
(set-match-data save-match-data-internal (quote evaporate))
  (progn (if headline-included (let* ((l 0) (--cl-var-- level)) (while
(<= l --cl-var--) (aset ltimes l (+ (aref ltimes l) t1)) (setq l (+ l
1))) nil)) (setq time (aref ltimes level)) (goto-char (match-beginning
0)) (put-text-property (point) (point-at-eol) (or propname
:org-clock-minutes) time) (if headline-filter (save-excursion (let
((save-match-data-internal (match-data))) (unwind-protect (progn
(while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ...
:org-clock-force-headline-inclusion t))) (set-match-data
save-match-data-internal (quote evaporate)))
  (if (or headline-included headline-forced) (progn (if
headline-included (let* ((l 0) (--cl-var-- level)) (while (<= l
--cl-var--) (aset ltimes l (+ (aref ltimes l) t1)) (setq l (+ l 1)))
nil)) (setq time (aref ltimes level)) (goto-char (match-beginning 0))
(put-text-property (point) (point-at-eol) (or propname
:org-clock-minutes) time) (if headline-filter (save-excursion (let
((save-match-data-internal (match-data))) (unwind-protect (progn
(while ... ... ...)) (set-match-data save-match-data-internal (quote
evaporate
  (progn (if (or headline-included headline-forced) (progn (if
headline-included (let* ((l 0) (--cl-var-- level)) (while (<= l
--cl-var--) (aset ltimes l (+ ... t1)) (setq l (+ l 1))) nil)) (setq
time (aref ltimes level)) (goto-char (match-beginning 0))
(put-text-property (point) (point-at-eol) (or propname
:org-clock-minutes) time) (if headline-filter (save-excursion (let
((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...))) (setq t1 0) (let*
((l level) (--cl-var-- (1- lmax))) (while (<= l --cl-var--) (aset
ltimes l 0) (setq l (+ l 1))) nil))
  (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (if (or
headline-included headline-forced) (progn (if headline-included (let*
((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l
...) (setq l ...)) nil)) (setq time (aref ltimes level)) (goto-char
(match-beginning 0)) (put-text-property (point) (point-at-eol) (or
propname :org-clock-minutes) time) (if headline-filter (save-excursion
(let (...) (unwind-protect ... ...)) (setq t1 0) (let* ((l level)
(--cl-var-- (1- lmax))) (while (<= l --cl-var--) (aset ltimes l 0)
(setq l (+ l 1))) nil)))
  (let* ((headline-forced (get-text-property (point)
:org-clock-force-headline-inclusion)) (headline-included (or (null
headline-filter) (save-excursion (let ((save-match-data-internal ...))
(unwind-protect (progn ...) (set-match-data save-match-data-internal
...))) (setq level (- (match-end 1) (match-beginning 1))) (if (>=
level lmax) (progn (setq ltimes (vconcat ltimes (make-vector lmax 0))
lmax (* 2 lmax (if (or (> t1 0) (> (aref ltimes level) 0)) (progn
(if (or headline-included headline-forced) (progn (if
headline-included (let* (... ...) (while ... ... ...) nil)) (setq time
(aref ltimes level)) (goto-char (match-beginning 0))
(put-text-property (point) (point-at-eol) (or propname
:org-clock-minutes) time) (if headline-filter (save-excursion (let ...
...) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while
(<= l 

Re: [O] How to safely update from ver. 8.2.10 to 8.3.x

2016-08-15 Thread Cook, Malcolm
> this weekend I got through lots of troubles, because I updated my
 > orgmode version with "manage emacs packages" menu command and
 > somehow
 > got mixed preferences.
 > 
 > Now, after a clean install, I have org mode 8.2.10 and would like to
 > update to version 8.3.x (20160808) which is shown under the menu
 > command
 > "manage emacs packages".
 > 
 > How can I do this safely, without creating a mess again?

Here's what I do, at the shell:

  emacs -Q -batch -eval "(progn (require 'package) (add-to-list 
'package-archives '(\"org\" . \"http://orgmode.org/elpa/\;))  
(package-initialize) (package-refresh-contents) (package-install 
'org-plus-contrib))"

This assures that org is not already loaded when org is compiled, which I've 
learned is the source of creating a mess.

Note: I use org-plus-contrib from melpa instead of org.  If you want just org, 
you could simply:

  emacs -Q -batch -eval "(progn (require 'package) (package-initialize) 
(package-refresh-contents) (package-install 'org-plus-contrib))"

HTH,

Malcolm

 > 
 > Thanks for all advice,
 > Maria



Re: [O] Feature request: "Figure #:" in labels of listings

2016-08-15 Thread Nicolas Goaziou
Hello,

Clément Pit--Claudel  writes:

> This org file:
>
> #+CAPTION: Some C code
> #+NAME: fig:c
> #+BEGIN_SRC c
> int main() { return 0; }
> #+END_SRC
>
> See figure [[fig:c]].
>
> produces HTML similar to this:
>
> …
> Some C code
> …
> 
>
> 
> See figure 1.
> 
>
> The link says "Figure (1)", but the figure label doesn't include the
> figure number. It would be great to have an option to include it! (or
> even to always include it as is done for images, since it can be
> hidden from CSS).

I agreed we can add it unconditionally, using (org-html--translate
"Listing %d:" info).

What class do you suggest for the listing number, ""? If so, should `org-html-style-default' be modified?

Regards,

-- 
Nicolas Goaziou



Re: [O] ox-md.el: Export TOC and Footnotes as Markdown rather than HTML

2016-08-15 Thread Nicolas Goaziou
Hello,

Jake Romer  writes:

> I'm not as familiar with Org's TOC facilities as I should be, so I'll
> update to handle these cases after some research. I want to avoid letting
> these patches get too big, too.

See `org-html-toc' and `org-html--toc-text' for an illustration.

> Here's the patch for generating the footnotes section as Markdown, let me
> know what you think.

It looks good. However, I'm not able to apply them, they seem to be
created from a subdirectory instead of the root dir.

> From 63d985425d3995985bd340fe195d8e25bd7f2cc6 Mon Sep 17 00:00:00 2001
> From: Jake Romer 
> Date: Sat, 13 Aug 2016 11:45:34 -0400
> Subject: [PATCH 1/4] Extract org-md-headline-title to generate title
>
> In order to generate a headline title in the preferred Markdown
> style ('atx or 'setext), I extracted this bit of logic from
> `org-md-headline'.
>
> Since `org-md-headline' doesn't process the headline for the footnotes
> section, extracting `org-md-headline-title' will allow us to generate
> the Footnote section header in the preferred Markdown style without
> duplicating the logic for doing so.
>
> As an enhancement, `org-md-headline-title' places the anchor tag above
> the section header. This makes it so that in a browser, clicking on the
> TOC entry for that section scrolls to the section header without
> obscuring it.
>
> Example generated section title:
>
> 

Great. However, you need to supply modified variables and functions
names in the commit message, e.g.,

* lisp/ox-md.el (org-md-headline-title): New function.
(org-md-headline): Use new function.

> Summary of Changes
> ==
> ---
>  ox-md.el | 37 +++--
>  1 file changed, 23 insertions(+), 14 deletions(-)
>
> diff --git a/ox-md.el b/ox-md.el
> index 0aaade6..4bd445c 100644
> --- a/ox-md.el
> +++ b/ox-md.el
> @@ -216,20 +216,29 @@ a communication channel."
> (car (last (org-export-get-headline-number
> headline info
>"."
> -   (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags
> -   "\n\n"
> -   (and contents
> -(replace-regexp-in-string "^" "" contents)
> -   ;; Use "Setext" style.
> -   ((eq style 'setext)
> - (concat heading tags anchor "\n"
> - (make-string (length heading) (if (= level 1) ?= ?-))
> - "\n\n"
> - contents))
> -   ;; Use "atx" style.
> -   (t (concat (make-string level ?#) " " heading tags anchor "\n\n"
> -   contents))
> -
> +   (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags 
> "\n\n"
> +   (and contents (replace-regexp-in-string "^" "" 
> contents)
> +   (t (concat (org-md-headline-title style level title anchor tags) 
> contents))
> +
> +
> +;; Headline Title
> +
> +(defun org-md-headline-title (style level title  anchor tags)

I suggest to name it `org-md--headline-title' to highlight the fact that
it is an internal function.

> +  "Generate a headline title in the preferred Markdown headline style.
> +STYLE is the preferred style ('atx or 'setext)
> +LEVEL is the header level.
> +TITLE is the headline title.
> +ANCHOR is the HTML anchor tag for the section as a string.
> +TAGS are the tags set on the section."
> +  (let ((anchor-lines (if anchor (concat anchor "\n\n") nil)))

  (and anchor (concat anchor "\n\n"))

> Subject: [PATCH 2/4] Add customizable footnotes-related variables
>
> Taking a cue from `ox-html.el', this patch adds
> `org-md-footnotes-section' and `org-md-footnote-format' to allow user
> customization of the formatting for the footnotes section and individual
> footnotes, respectively.

Ditto (variable names...)

> +(defcustom org-md-footnotes-section "%s%s"
> +  "Format for the footnotes section.

Format string for...

> +The first %s placeholder will be replaced with the localized Footnotes 
> section
> +heading, the second with the contents of the Footnotes section."
> + :group 'org-export-md
> +  :type 'string)

You need to provide additional keywords, i.e.,

  :version "25.1"
  :package-version '(Org . "9.0")


> +(defcustom org-md-footnote-format "%s"
> +  "The format for the footnote reference.
> +The %s will be replaced by the footnote reference itself."
> +  :group 'org-export-md
> +  :type 'string)

Ditto.

> Subject: [PATCH 3/4] Add footnote-generating functions
>
> Introduces the following functions:
>
> * `org-md-footnote-formatted'
> * `org-md-footnote-section'

See above.

> + Footnote Section
> +
> +(defun org-md-footnote-formatted (footnote info)

Suggestion: `org-md--footnote-formatted'

> +  "Formats a single footnote entry FOOTNOTE.

You should specify the data type for FOOTNOTE, i.e., a cons cell 

  (number . definition)

> +INFO is a plist with contextual information."
> +  (let* ((fn-num (car 

Re: [O] Bug: clock table report hang when using :tags [8.2.10 (release_8.2.10 @ c:/Program Files/emacs/share/emacs/24.5/lisp/org/)]

2016-08-15 Thread Nicolas Goaziou
Hello,

Yichao Woo  writes:

> I upgraded from 8.2.10 to 8.3.5, but still get the same result.

Your upgrade may have failed, i.e., Org is reporting 8.3.5 but uses some
older libraries bundled with Emacs.

> Have no idea why since I have little knowledge on how to read and debug
> elisp code.

Try doing M-x toggle-debug-on-quit and reproduce the freeze. Once
frozen, quit with C-g and report the backtrace. Ideally, load Org
uncompiled first (C-u M-x org-reload).

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: LaTeX fragment not generated in electric-quote-mode [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/25.1.50/lisp/org/)]

2016-08-15 Thread Nicolas Goaziou
Hello,

Wouter Beek  writes:

> How do I close this issue?  (It’s my first and I cannot find
> instructions for this in the Emacs and Org manuals.)

There's nothing to do. Thank you for letting us know.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Latex equation numbering on left instead of right

2016-08-15 Thread Lawrence Bottorff
Okay, an Emacs StackExchange person said I'd have to alter the actual
HTML/CSS, that adding #+LaTeX_CLASS_OPTIONS: [oneside,reqno] would not help
the HTML output -- and it doesn't. I did find the HTML section


MathJax.Hub.Config({
displayAlign: "left",
displayIndent: "5em",

"HTML-CSS": { scale: 100,
linebreaks: { automatic: "false" },
webFont: "Neo-Euler"
   },
SVG: {scale: 100,
  linebreaks: { automatic: "false" },
  font: "Neo-Euler"},
NativeMML: {scale: 100},
TeX: { equationNumbers: {autoNumber: "AMS"},
   MultLineWidth: "85%",
   TagSide: "right",
   TagIndent: ".8em"
 }
});


where the TagSide "left" can be changed after output by hand to "right",
and that solves the problem. So how would I tell org-mode to make this
change? Is there any control over MathJax from Emacs variables or my
org-mode file?

On Sun, Aug 14, 2016 at 7:25 PM, Lawrence Bottorff 
wrote:

> I've got this
>
> \begin{align}
> n &= 0 \\
> n &= m + 1
> \end{align}
>
> in an org-mode buffer. When I produce a Latex output, the numbering n = 0
> (1) etc. is properly placed on the right. But an HTML output places the
> numbering on the left. What do I need to do to have both HTML and Latex
> output place the equation numbering off to the right? One Latex tip was to
> include \documentclass[12pt,oneside,reqno]{amsart} where t
>