Re: [O] Guia compacta de Orgmode

2017-07-17 Thread Adonay Felipe Nogueira
Excellent! I also like some of the works published at Traficantes de
Sueños. :)

-- 
- [[https://libreplanet.org/wiki/User:Adfeno]]
- Palestrante e consultor sobre /software/ livre (não confundir com
  gratis).
- "WhatsApp"? Ele não é livre, por isso não uso. Iguais a ele prefiro
  GNU Ring, ou Tox. Quer outras formas de contato? Adicione o vCard
  que está no endereço acima aos teus contatos.
- Pretende me enviar arquivos .doc, .ppt, .cdr, ou .mp3? OK, eu
  aceito, mas não repasso. Entrego apenas em formatos favoráveis ao
  /software/ livre. Favor entrar em contato em caso de dúvida.



[O] [PATCH] An amended to the enhance Org babel for scheme blocks

2017-07-17 Thread José L. Doménech
Hello again, I have added a :prologue param to the scheme blocks of babel.
This multiple option prepends all the values in the generated code of the
block.

This patch also includes the previous one that enabled returning a table
when evaluating a scheme block.

A changelog:

Enhance the babel block for scheme.

Allows scheme code blocks to return a table and add a :prologue param
to the scheme blocks. All :prologue params are prepended to the
body of code.

* lisp/ob-scheme.el (org-babel-scheme-null-to): New custom option that
  allows to use a empty list to format the table output, initially
  assigned to 'hlines.
  (org-babel-scheme-table-or-string): New helper function to convert
  the return value from the block as a table or a string.
  (org-babel-execute-src-block): Changed to allow the return of a
  table for the output.
  (org-babel-expand-body:scheme) Add :prologue param support.

The patch:

From c87786bc4b4d40cdda99a7fb006382c8a852928a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20L=2E=20Dom=C3=A9nech?= 
Date: Mon, 17 Jul 2017 08:42:32 +0200
Subject: [PATCH] Enhance the babel block for scheme.

Allows scheme code blocks to return a table and add a :prologue param
to the scheme blocks. All :prologue params are prepended to the
body of code.

* lisp/ob-scheme.el (org-babel-scheme-null-to): New custom option that
  allows to use a empty list to format the table output, initially
  assigned to 'hlines.
  (org-babel-scheme-table-or-string): New helper function to convert
  the return value from the block as a table or a string.
  (org-babel-execute-src-block): Changed to allow the return of a
  table for the output.
  (org-babel-expand-body:scheme) Add :prologue param support.
---
 lisp/ob-scheme.el | 53 -
 1 file changed, 40 insertions(+), 13 deletions(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index cd8c386..599ece7 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -51,14 +51,24 @@
   (start end &optional and-go raw nomsg))
 (declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg))
 
+(defcustom org-babel-scheme-null-to 'hline
+  "Replace `null' in scheme tables with this before returning."
+  :group 'org-babel
+  :version "24.4"
+  :package-version '(Org . "8.0")
+  :type 'symbol)
+
 (defvar org-babel-default-header-args:scheme '()
   "Default header arguments for scheme code blocks.")
 
 (defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (org-babel--get-vars params)))
+  (let ((vars (org-babel--get-vars params))
+   (prepends (cl-remove-if-not (lambda (x) (eq (car x) :prologue)) 
params)))
 (if (> (length vars) 0)
-(concat "(let ("
+(concat (mapconcat (lambda (p) (format "%s" (cdr p)))
+  prepends "\n ")
+   "(let ("
 (mapconcat
  (lambda (var) (format "%S" (print `(,(car var) ',(cdr var)
  vars "\n  ")
@@ -176,6 +186,18 @@ is true; otherwise returns the last value."
   result
 result))
 
+(defun org-babel-scheme-table-or-string (results)
+  "Convert RESULTS into an appropriate elisp value.
+If the results look like a list or tuple, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+  (let ((res (org-babel-script-escape results)))
+(if (listp res)
+(mapcar (lambda (el) (if (or (eq el '()) (eq el 'null))
+org-babel-scheme-null-to
+  el))
+res)
+  res)))
+
 (defun org-babel-execute:scheme (body params)
   "Execute a block of Scheme code with org-babel.
 This function is called by `org-babel-execute-src-block'"
@@ -184,7 +206,6 @@ This function is called by `org-babel-execute-src-block'"
  "^ ?\\*\\([^*]+\\)\\*" "\\1"
  (buffer-name source-buffer
 (save-excursion
-  (org-babel-reassemble-table
(let* ((result-type (cdr (assq :result-type params)))
  (impl (or (when (cdr (assq :scheme params))
  (intern (cdr (assq :scheme params
@@ -192,16 +213,22 @@ This function is called by `org-babel-execute-src-block'"
(car geiser-active-implementations)))
  (session (org-babel-scheme-make-session-name
source-buffer-name (cdr (assq :session params)) impl))
- (full-body (org-babel-expand-body:scheme body params)))
-(org-babel-scheme-execute-with-geiser
- full-body  ; code
- (string= result-type "output") ; output?
- impl   ; implementation
- (and (not (string= session "none")) session))) ; session
-   (org-babel-pick-name (cdr (assq :colname-names params))
-   (cdr

Re: [O] MWE for BibLaTex and org-ref?

2017-07-17 Thread John Kitchin
I added some clarification to the manual on that point. Thanks for
pointing out it was a confusing!

best wishes,

Loris Bennett writes:

> Hi Detlef,
>
> Thanks for the information.  After removing the bibliography and
> bibliographystyle, everything seems to work.  I think I was confused by
> the following line from the org-ref manual:
>
>   For LaTeX export a bibliography and bibliographystyle link is /required/.
>
> Are they only required if I am *not* using biblatex, or, if I *am* using
> biblatex, are some org-ref goodies not going to work if I don't have
> them?
>
> Cheers,
>
> Loris
>
> Detlef Steuer  writes:
>
>> Hi!
>>
>> Look here:
>> https://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex
>>
>> In short \bibliographystyle and biblatex don't match.
>>
>> Hope that helps
>>
>> Detlef
>>
>> Am Thu, 13 Jul 2017 08:27:17 +0200
>> schrieb "Loris Bennett" :
>>
>>> Hi John,
>>> 
>>> Thanks for the pointer.  I think some of the errors I was getting were
>>> due having old temporary files (aux, bcf, ...) lying around and then
>>> switching between natbib and biblatex.
>>> 
>>> Following the org-ref manual I now have
>>> 
>>>   #+LATEX_HEADER:
>>> \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear,
>>> hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true]
>>> {biblatex}
>>> 
>>> and then use
>>> 
>>>   bibliographystyle:authoryear
>>> 
>>> I'm now just getting the following error:
>>> 
>>>   ! Package biblatex Error: '\bibliographystyle' invalid.
>>> 
>>> Any ideas what I'm doing wrong?
>>> 
>>> Cheers,
>>> 
>>> Loris
>>> 
>>> John Kitchin  writes:
>>> 
>>> > org-ref should work fine for biblatex, but the setup for biblatex in
>>> > the org file is a bit different than for bibtex.
>>> >
>>> > The org-ref manual can be opened by running M-x org-ref-help. Go to
>>> > the ** biblatex users heading. Hopefully that is clear enough to
>>> > help. If not, let me know what is missing.
>>> >
>>> > Best wishes,
>>> >
>>> > John
>>> >
>>> > ---
>>> > Professor John Kitchin 
>>> > Doherty Hall A207F
>>> > Department of Chemical Engineering
>>> > Carnegie Mellon University
>>> > Pittsburgh, PA 15213
>>> > 412-268-7803
>>> > @johnkitchin
>>> > http://kitchingroup.cheme.cmu.edu
>>> >
>>> > On Wed, Jul 12, 2017 at 9:59 AM, Loris Bennett
>>> >  wrote:
>>> >
>>> >  Hi,
>>> >
>>> >  Does org-ref work with BibLaTeX?
>>> >
>>> >  With org-ref, I have an MWE using natbib that works:
>>> >
>>> >  #+LATEX_CLASS_OPTIONS: [a4paper, 11pt]
>>> >  #+LATEX_HEADER: \usepackage{natbib}
>>> >
>>> >  #+TITLE: MWE
>>> >
>>> >  * Introduction
>>> >
>>> >  This MWE was found on the internet (see cite:Botha).
>>> >
>>> >  bibliographystyle:abbrvnat
>>> >  bibliography:file.bib
>>> >
>>> >  with 'file.bib' being
>>> >
>>> >  @Online{Botha,
>>> >  author = {Charl Botha},
>>> >  title = {From org file with local bibtex to LaTeX and PDF},
>>> >  date = {2017-02-20},
>>> >  url =
>>> > {https://vxlabs.com/2017/02/20/from-org-file-with-local-bibtex-to-latex-and-pdf/},
>>> >  }
>>> >
>>> >  For org-latex-pdf-process, I'm using the following:
>>> >
>>> >  ("latexmk -g -pdf -pdflatex=\"%latex\" -shell-escape -outdir=%o
>>> > %f")
>>> >
>>> >  However, if I try to replace natbib by BibLaTeX via
>>> >
>>> >  #+LATEX_HEADER: \usepackage{biblatex}
>>> >  #+LATEX_HEADER: \addbibresource{file.bib}
>>> >
>>> >  bibliographystyle:alphabetic
>>> >  bibliography:file.bib
>>> >
>>> >  I get errors about the style being invalid and the \bibliography
>>> > only being allowed in the preamble.
>>> >
>>> >  So if it should work, does anyone have a MWE for org-ref with
>>> > BibLaTeX?
>>> >
>>> >  Cheers,
>>> >
>>> >  Loris
>>> >
>>> >  --
>>> >  This signature is currently under construction.
>>> >
>>> >  

>>> 

-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin



Re: [O] Ruby or Python or Something

2017-07-17 Thread Axel E. Retif

On 07/17/2017 05:27 AM, Adam Jackson wrote:


Hi Byung-Hee,

org-mode itself uses emacs lisp as the programming language for 
development and extension and you may need to use a little lisp to 
access some of the features.


However, if you are interested in learning Python and/or Ruby I highly 
recommend you look at the org-babel features: 
http://orgmode.org/worg/org-contrib/babel/ .
This allows you to mix up code blocks with your notes and links for an 
interactive "notebook" similar to Jupyter. (If you haven't tried 
Jupyter, you really should look at that too!)


I also recommend to take a look at John Kitchin's YouTube channel:

https://www.youtube.com/channel/UCQp2VLAOlvq142YN3JO3y8w

He uses extensively Emacs org-mode, Python and LaTeX.


Best

Axel




Re: [O] Ruby or Python or Something

2017-07-17 Thread Adam Jackson
Hi Byung-Hee,



org-mode itself uses emacs lisp as the programming language for development and 
extension and you may need to use a little lisp to access some of the features.



However, if you are interested in learning Python and/or Ruby I highly 
recommend you look at the org-babel features: 
http://orgmode.org/worg/org-contrib/babel/ .

This allows you to mix up code blocks with your notes and links for an 
interactive "notebook" similar to Jupyter. (If you haven't tried Jupyter, you 
really should look at that too!)

These blocks will appear as formatted code blocks in your output HTML or LaTeX. 
I use it as a lab notebook.



All the best,

Adam






Message: 2 

Date: Sun, 16 Jul 2017 21:19:23 +0900 

From: "Byung-Hee HWANG (???, =?utf-8?B?6buD54Kz54aZKQ==?=" 

 

To: emacs-orgmode@gnu.org 

Subject: [O] Ruby or Python or Something 

Message-ID:  

Content-Type: text/plain; charset=utf-8 

 

Somewaht it is foolish question. Suddenly i get interested in other 

languages such as Ruby, Python, ... By the way these computing languages 

help to understand of org mode? 

 

My position is a writer, not programmer. To make HTML/LaTeX documents 

with Emacs is my goal. Any comments welcome!!! 

 

-- 

^? __ ?_^))// 

 

 







Re: [O] [PATCH] convert htmlize.el to use cl-lib rather than cl

2017-07-17 Thread Rasmus
Stig Brautaset  writes:

> Did a rather mechanical translation here, but test results seems to be
> the same as before. Are patches like these something you're interested
> in?

In principal, it would be good to use cl-lib, but htmlize.el is an
external package that Org relies on.

I think htmlize is maintained here:

https://github.com/hniksic/emacs-htmlize

Thanks,
Rasmus

-- 
I almost cut my hair, it happened just the other day




Re: [O] Calculating percentage

2017-07-17 Thread Cecil Westerhof
2017-07-16 20:32 GMT+02:00 Eric S Fraga :

> See attached.
>

​Works perfect thanks.​


-- 
Cecil Westerhof


Re: [O] Ruby or Python or Something

2017-07-17 Thread Roland Everaert
I guess it depends if you need to access external resources or not (DB,
webservices) or if you need to do heavy computations, for exemple. If not
and if you know lisp well, then, I think, it is better to stick with it.

As a dev/sysadmin, I tend to use whatever language suites my needs when
writing documents or adding data to some TODO item with emacs and org-mode.

On Sun, Jul 16, 2017 at 2:19 PM, Byung-Hee HWANG (황병희, 黃炳熙) <
soyeo...@doraji.xyz> wrote:

> Somewaht it is foolish question. Suddenly i get interested in other
> languages such as Ruby, Python, ... By the way these computing languages
> help to understand of org mode?
>
> My position is a writer, not programmer. To make HTML/LaTeX documents
> with Emacs is my goal. Any comments welcome!!!
>
> --
> ^고맙습니다 _地平天成_ 감사합니다_^))//
>
>