Re: [O] [PATCH] call_*() is not working inside #+DATE

2016-03-11 Thread Rafael Laboissiere

* Rafael Laboissiere  [2016-03-07 02:58]:


The following used to work for me in the past:

  #+NAME: date
  #+BEGIN_SRC sh :results silent :exports results :tangle no
  date
  #+END_SRC
  #+TITLE: Sample
  #+AUTHOR: Me
  #+DATE: call_date()

and I saw the output of the shell command "date" when exporting the 
file to LaTeX.  However does not work for the current HEAD of the Git 
repository.


Using git-bisect, I discovered that the culprit is commit 85ff663, 
i.e. my code above works for commit 85ff663^ but fails for commit 
85ff663.


Commit 85ff663 was a pretty large commit and, besides that, the new 
code introduced by it was posteriorly changed, so it is hard to find 
where the bug comes from.  Could someone more acquainted with the code 
try to look at this bug, please?


I investigated this issue further and discovered that the constructs 
call_(args) and src_{code} are not evaluated at all when they 
appear in a keyword line (starting with "#+:").  Org-babel 
behaves in this way probably on purpose.  At any rate, it would be better 
if the current behavior is documented somewhere.  This may be 
accomplished with the patch attached below.


Best,

Rafael Laboissière

P.S.: For those who are reading this message and are interested in a 
solution for my original problem, here is the way I am getting around it 
right now.  When exporting to LaTeX, I wanted to have, as the contents of 
the \date{} macro, the date and the hash of the last Git commit of the 
current checkout HEAD, to which my Org document belongs.  Here is how I 
am doing it now:


   #+TITLE: Sample
   #+AUTHOR: Me
   #+BEGIN_SRC sh :results silent :exports results :tangle no
   git show -s --date=short --format="%cd [%h]" HEAD > GitDateCommit.tex
   #+END_SRC
   #+DATE: \input{GitDateCommit}
>From fa47439f9897c4bab436ecf4c9f08fa686ff0231 Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere 
Date: Fri, 11 Mar 2016 23:04:00 +0100
Subject: [PATCH] Document lack of evaluation of inline code blocks in keyword
 lines

doc/org.texi (Evaluating code blocks): Add footnote explaining that
inline code blocks are not evaluated inside keyword lines.
---
 doc/org.texi | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index e423df7..ce478f5 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -15030,13 +15030,16 @@ evaluation from the @kbd{C-c C-c} key binding.}.  This will call the
 its results into the Org mode buffer.
 
 @cindex #+CALL
-It is also possible to evaluate named code blocks from anywhere in an Org
-mode buffer or an Org mode table.  These named code blocks can be located in
-the current Org mode buffer or in the ``Library of Babel'' (@pxref{Library of
-Babel}).  Named code blocks can be evaluated with a separate @code{#+CALL:}
-line or inline within a block of text.  In both cases the result is wrapped
-according to the value of @code{org-babel-inline-result-wrap}, which by
-default is @code{"=%s="} for markup that produces verbatim text.
+It is also possible to evaluate named code blocks from
+anywhere@footnote{Actually, the constructs call_() and src_@{@}
+are not evaluated when they appear in a keyword line (i.e. lines starting
+with @code{#+KEYWORD:}, @pxref{In-buffer settings}).}  in an Org mode buffer
+or an Org mode table.  These named code blocks can be located in the current
+Org mode buffer or in the ``Library of Babel'' (@pxref{Library of Babel}).
+Named code blocks can be evaluated with a separate @code{#+CALL:} line or
+inline within a block of text.  In both cases the result is wrapped according
+to the value of @code{org-babel-inline-result-wrap}, which by default is
+@code{"=%s="} for markup that produces verbatim text.
 
 The syntax of the @code{#+CALL:} line is
 
-- 
2.7.0



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-11 Thread Kaushal Modi
Thanks.

--
Kaushal Modi


Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-11 Thread Kyle Meyer
Kyle Meyer  writes:

> Kaushal Modi  writes:
>
>> Patch (after rebasing to 5a735b0) attached. I hope it works.

[...]

> I'll have another look at the changes tonight and will push it then
> unless there are more comments from me or others.

Pushed in ebacca39b, with a small change to protect an open parentheses
that at the start of a message line.

-- 
Kyle



Re: [O] org-babel C math.h issue

2016-03-11 Thread Thierry Banel

  
  
Seems good.
  I tested it.
  
  As a refinement, the associated documentation should be updated
  (but that is a separate patch).
  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.html
  
  Thierry
  
  Le 11/03/2016 20:14, Oz Ben-Ami a écrit :


  

  

  Thanks for the response.

  
  On my machine, I get the undefined references even with
  GCC 5 (gcc version 5.2.1 20151010 (Ubuntu
  5.2.1-22ubuntu2)), if I put -lm before the source file
  name. 
  

As far as a patch, I can try but this would be my first time
really playing with org-mode code. As far as I can see, I
would need to add the following lines in ob-C.el:
L133: (libs (cdr (assoc :libs params)))
 (libs (mapconcat 'identity
               (if (listp libs) libs (list libs)) " "))
L142: (format "%s -o %s %s %s %s" ;; (added %s)
L147: libs

  
  Am I missing anything?
  

Oz
  
  
On Fri, Mar 11, 2016 at 1:52 PM,
  Thierry Banel 
  wrote:
  To
summarize this thread:
It seems there was an issue long ago.
Version 5 of GCC magically fixed it.
But it is still here for older compilers.

-

To debug, execute the following piece of lisp code:

    (defadvice org-babel-eval (before xxx (cmd body))
      ""
      (message "org-babel-eval : %s" cmd))
    (ad-activate 'org-babel-eval)

The actual compilation command will be displayed in the
*Messages* buffer.

With your example, we get

   gcc -o /tmp/babel-8412zIw/C-bin-8412IZR -lm
/tmp/babel-8412zIw/C-src-84127OL.c

--

You are right, Oz, this can be fixed in line 147.
But :flags is intended for flags like -g or -O, which need
to appear
before the source file.

Probably we are missing an additional flag, which could be
named :libs
Then your example would be:

  #+BEGIN_SRC C :includes '( )
:libs -lm
  int i=9;
    printf("%d\n",(int)sqrt(i));
    #+END_SRC
  
--

Oz, do you think you would be able to provide a patch?
The way to contribute is documented here:
http://orgmode.org/worg/org-contribute.html#orgheadline1

Thanks for reporting.
Thierry
  

  

Le 06/03/2016 23:44, Oz Ben-Ami a écrit :
> Hi,
>
> I'm a new org user, and I'm sorry if I'm missing
something obvious.
> When executing a C code snippet with org-babel,
that contains a math
> function, I get the famous "undefined reference"
errors. I tried
> adding ":flags -lm", but that doesn't help. Looking
at the code, it
> seems the -lm flag is inserted in the wrong place,
before the source
> file. An easy change would be in line 147 of
ob-C.el version
> 8.3.4-634, moving "flags" to after the source file.
This seems to
> work, but I don't know if it would break anything
else.
>
> A minimal working example, attached, includes the
following snippet:
>
> #+BEGIN_SRC C :includes '(
) :flags -lm
> int i=9;
> printf("%d\n",(int)sqrt(i));
> #+END_SRC
>
> Note the issue disappears if constants are directly
used rather than
> variables, presumably because the function call is
optimized away
> entirely.
>
> Any thoughts are appreciated.
>
> Oz


  

  


  


  




Re: [O] error on org-reload (Symbol's value as variable is void: load-uncore)

2016-03-11 Thread Giuseppe Lipari
Dear Nick,

Le ven. 11 mars 2016 à 16:45, Nick Dokos  a écrit :

> Giuseppe Lipari  writes:
>
> > Hello,
> >
> > I want to have a backtrace of an error I am encountering. So I followed
> the instructions here,
> > 1) I enabled "enter debugger on error"
> > 2) M-x org-reload
> >
> > And I obtain the following error
> >
> > and: Symbol's value as variable is void: load-uncore
> >
>
> I think it's time to kill the running emacs session and start a new
> one. If it happens with the new one, that might be a bug; but IMO it's
> more likely that the session has been curdled.
>
>
I tried it on a freshly started emacs, and it happens again. I am attach my
init.org as well.


Giuseppe Lipari



> --
> Nick
>
>
>
* Basic settings

** Startup screen
#+BEGIN_SRC emacs-lisp
(setq-default)
(setq inhibit-splash-screen t)
#+END_SRC


** Package manager (melpa)
#+BEGIN_SRC emacs-lisp
(require 'package)
(package-initialize)
;(add-to-list 'package-archives
; '("elpa" . "http://tromey.com/elpa/;) t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/;) t)
#+END_SRC


** Keyboard shortcuts

#+BEGIN_SRC emacs-lisp
  ;;
  ;;
  ;; Keyboard selections
  ;;
  (global-set-key [f4] 'comment-region)
  (global-set-key [f5] 'uncomment-region)
  (global-set-key (kbd "C-$") 'scroll-up-line)
  (global-set-key (kbd "C-*") 'scroll-down-line)
#+END_SRC


* auto-complete

  #+BEGIN_SRC emacs-lisp
  (require 'auto-complete)  
  #+END_SRC

* Org configuration

** Preliminary

   #+BEGIN_SRC emacs-lisp
 (setq org-export-backends (quote (ascii beamer html icalendar latex odt md))) 
   #+END_SRC


** Agenda and notes

#+BEGIN_SRC emacs-lisp
  (setq org-directory "~/Copy/org")  ;; Set to the location of your Org files on your local system
  (setq org-mobile-inbox-for-pull "~/Copy/org/flagged.org")   ;; Set to the name of the file where new notes will be stored
  (setq org-mobile-directory "~/Dropbox/org")   ;; Set to /MobileOrg

  (setq org-agenda-files 
(quote ("~/Copy/org/work.org" 
"~/Copy/org/conferences.org" 
"~/Copy/org/tasse.org" 
"~/Copy/org/emeraude_meetings.org" 
"~/Copy/org/cours_lille.org" 
"~/Copy/org/programming.org" 
"~/Copy/Documents/reviews/RTSJ-special_issue/paper_list.org" 
"~/Copy/Documents/Buro/candidatures/candidatures.org" 
"~/Copy/org/corso_cpp.org" 
"~/Copy/org/mycal.org" 
"~/Copy/org/notes.org")))
  (setq org-agenda-span 15)
#+END_SRC


** Keyboard selections

#+BEGIN_SRC emacs-lisp
  (global-set-key "\C-cl" 'org-store-link)
  (global-set-key "\C-cc" 'org-capture)
  (global-set-key "\C-ca" 'org-agenda)
  (global-set-key "\C-cb" 'org-iswitchb)
#+END_SRC


** Clocks

#+BEGIN_SRC emacs-lisp
;; this is for storing clocks
(setq org-clock-persist 'history)
(org-clock-persistence-insinuate)
(setq-default org-catch-invisible-edits 'smart) ; preventing edits to hidden trees
#+END_SRC


** Babel 

*** Languages

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((dot . t)
   (emacs-lisp . t)
   (mscgen . t) ; this is the entry to activate mscgen
   (latex . nil)
   (python . t)
   (sh . t)
   (ditaa . t)
   (C . t)
   (java . t)
   (sql . t)
   (haskell . t)
   (makefile . t)
   (plantuml . t)
   ))

  (setq org-plantuml-jar-path
(expand-file-name "~/devel/plantuml/plantuml.jar"))

  (setq exec-path (append exec-path '("/usr/bin/mscgen")))
#+end_src


*** Fontify in babel regions

#+begin_src emacs-lisp
  (setq org-src-fontify-natively  t)
  (setq org-src-tab-acts-natively t)
#+end_src

Load exporter

#+BEGIN_SRC emacs-lisp
  (eval-after-load 'ox
'(add-to-list 'org-export-filter-src-block-functions
  (lambda (x y z)
(replace-regexp-in-string "\t" "" x nil t)))
)
#+END_SRC

*** Evaluation

#+BEGIN_SRC emacs-lisp
  (setq org-confirm-babel-evaluate nil)
#+END_SRC


** org2blog

#+BEGIN_SRC emacs-lisp
  (setq load-path (cons "~/elisp/org2blog/" load-path))
  (require 'org2blog-autoloads)

  (setq org2blog/wp-blog-alist
'(("okpanico"
   :url "http://okpanico.wordpress.com/xmlrpc.php;
   :username "glipari"
   :default-title "Nuovo post"
   :default-categories ("Linguaggi" "C++")
   :tags-as-categories nil)
  ("algoland"
   :url "http://algoland.wordpress.com/xmlrpc.php;
   :username "glipari"
   :default-title "New post"
   :default-categories ("")
   :tags-as-categories nil)))

  (setq org2blog/wp-use-sourcecode-shortcode t)
#+END_SRC


** org-mobile

#+BEGIN_SRC emacs-lisp
  ;;
  ;; Sync with org-mobile at startup and exit
  ;;
  (add-hook 'after-init-hook 'org-mobile-pull)
  

[O] Bug: ox-html.el does not indicate enough languages [8.2.10 (release_8.2.10 @ c:/Users/txiong/emacs-24.5/share/emacs/24.5/lisp/org/)]

2016-03-11 Thread Tianxiang Xiong
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.





In the file "ox-html.el", the following bit of CSS displays the source

code block language's name on hover:



  pre.src:hover:before { display: inline;}

  pre.src-sh:before{ content: 'sh'; }

  pre.src-bash:before  { content: 'sh'; }

  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }

  pre.src-R:before { content: 'R'; }

  pre.src-perl:before  { content: 'Perl'; }

  pre.src-java:before  { content: 'Java'; }

  pre.src-sql:before   { content: 'SQL'; }



Org supports far more languages than this. In Section 14.7 of the Org

manual, the following languages are listed (formatting is screwed up):



  Language Identifier Language Identifier

  Asymptote  asymptote  Awk  awk

  Emacs Calc   calc   CC

  C++  C++Clojure  clojure

  CSS  cssditaaditaa

  Graphviz dotEmacs Lisp   emacs-lisp

  gnuplot  gnuplotHaskell  haskell

  Java java

  Javascript   js LaTeXlatex

  Ledger   ledger Lisp lisp

  Lilypond lilypond   MATLAB   matlab

  Mscgen   mscgen Objective Caml   ocaml

  Octave   octave Org mode org

  Oz   oz Perl perl

  Plantuml plantuml   Python   python

  RR  Ruby ruby

  Sass sass   Scheme   scheme

  GNU Screen   screen shellsh

  SQL  sqlSQLite   sqlite



"ox-html.el" should support at least all the languages that Org mode
supports by default.



Emacs  : GNU Emacs 24.5.1 (i686-pc-mingw32)

 of 2015-04-11 on LEG570

Package: Org-mode version 8.2.10 (release_8.2.10 @ c:/Users/txiong/emacs-24=

.5/share/emacs/24.5/lisp/org/)


Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-11 Thread Shlomi Vaknin
Hey Nicholas,

Thanks for trying to help! Setting org-element-use-cache to nil did the
trick, it now export just fine in both elpa version of org and on master,
thanks!

Without setting it to nil, here is the complete backtrace of an uncompiled
org (I simply erased all elc files, that sufficient, right?)

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (progn (goto-char contents-end) (skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position)))
  (let* ((struct (or structure (org-element--list-struct limit))) (type
(cond ((org-looking-at-p "[ ]*[A-Za-z0-9]") (quote ordered)) ((nth 5 (assq
(point) struct)) (quote descriptive)) (t (quote unordered
(contents-begin (point)) (begin (car affiliated)) (contents-end (let*
((item (assq contents-begin struct)) (ind (nth 1 item)) (pos (nth 6 item)))
(while (and (setq item (assq pos struct)) (= (nth 1 item) ind)) (setq pos
(nth 6 item))) pos)) (end (progn (goto-char contents-end)
(skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position) (list
(quote plain-list) (nconc (list :type type :begin begin :end end
:contents-begin contents-begin :contents-end contents-end :structure struct
:post-blank (count-lines contents-end end) :post-affiliated contents-begin)
(cdr affiliated
  (save-excursion (let* ((struct (or structure (org-element--list-struct
limit))) (type (cond ((org-looking-at-p "[ ]*[A-Za-z0-9]") (quote ordered))
((nth 5 (assq ... struct)) (quote descriptive)) (t (quote unordered
(contents-begin (point)) (begin (car affiliated)) (contents-end (let*
((item (assq contents-begin struct)) (ind (nth 1 item)) (pos (nth 6 item)))
(while (and (setq item ...) (= ... ind)) (setq pos (nth 6 item))) pos))
(end (progn (goto-char contents-end) (skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position) (list
(quote plain-list) (nconc (list :type type :begin begin :end end
:contents-begin contents-begin :contents-end contents-end :structure struct
:post-blank (count-lines contents-end end) :post-affiliated contents-begin)
(cdr affiliated)
  org-element-plain-list-parser(122 (86) ((28 2 "- " nil nil nil 51) (51 2
"-" nil nil nil 55) (55 2 "-" nil nil nil 59) (59 2 "-" nil nil nil 63) (63
2 "- " nil nil nil 99) (99 2 "- " nil nil nil 135) (135 2 "- " nil nil nil
158)))
  (cond ((and (cdr affiliated) (>= (point) limit)) (goto-char (car
affiliated)) (org-element-keyword-parser limit nil)) ((looking-at
org-element--latex-begin-environment) (org-element-latex-environment-parser
limit affiliated)) ((looking-at org-drawer-regexp)
(org-element-drawer-parser limit affiliated)) ((looking-at "[ ]*:\\(
\\|$\\)") (org-element-fixed-width-parser limit affiliated)) ((looking-at
"[ ]*#") (goto-char (match-end 0)) (cond ((looking-at "\\(?: \\|$\\)")
(beginning-of-line) (org-element-comment-parser limit affiliated))
((looking-at "\\+BEGIN_\\(\\S-+\\)") (beginning-of-line) (funcall (let*
((val ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ...) (...
...) (... ...) (t ...))) limit affiliated)) ((looking-at "\\+CALL:")
(beginning-of-line) (org-element-babel-call-parser limit affiliated))
((looking-at "\\+BEGIN:? ") (beginning-of-line)
(org-element-dynamic-block-parser limit affiliated)) ((looking-at
"\\+\\S-+:") (beginning-of-line) (org-element-keyword-parser limit
affiliated)) (t (beginning-of-line) (org-element-paragraph-parser limit
affiliated ((looking-at org-footnote-definition-re)
(org-element-footnote-definition-parser limit affiliated))
((looking-at "[ ]*-\\{5,\\}[
]*$") (org-element-horizontal-rule-parser limit affiliated)) ((looking-at
"%%(") (org-element-diary-sexp-parser limit affiliated)) ((looking-at
"[ ]*\\(|\\|\\+\\(-+\\+\\)+[
]*$\\)") (org-element-table-parser limit affiliated)) ((looking-at
(org-item-re)) (org-element-plain-list-parser limit affiliated (or
structure (org-element--list-struct limit (t
(org-element-paragraph-parser limit affiliated)))
  (let ((affiliated (org-element--collect-affiliated-keywords limit)))
(cond ((and (cdr affiliated) (>= (point) limit)) (goto-char (car
affiliated)) (org-element-keyword-parser limit nil)) ((looking-at
org-element--latex-begin-environment) (org-element-latex-environment-parser
limit affiliated)) ((looking-at org-drawer-regexp)
(org-element-drawer-parser limit affiliated)) ((looking-at "[ ]*:\\(
\\|$\\)") (org-element-fixed-width-parser limit affiliated)) ((looking-at
"[ ]*#") (goto-char (match-end 0)) (cond ((looking-at "\\(?: \\|$\\)")
(beginning-of-line) (org-element-comment-parser limit affiliated))
((looking-at "\\+BEGIN_\\(\\S-+\\)") (beginning-of-line) (funcall (let*
(...) (cond ... ... ... ... ... ... ... ...)) limit affiliated))
((looking-at "\\+CALL:") (beginning-of-line) (org-element-babel-call-parser
limit affiliated)) ((looking-at "\\+BEGIN:? ") (beginning-of-line)
(org-element-dynamic-block-parser limit affiliated)) ((looking-at
"\\+\\S-+:") 

Re: [O] Latex code inbetween beamer frames

2016-03-11 Thread Eric S Fraga
On Friday, 11 Mar 2016 at 13:01, Giacomo M wrote:
> Dear all,
> I would like to set a background image for some slides. AFAIK, the way
> to achieve this in beamer is by using sth like:
> \usebackgroundtemplate{\tikz\node
> {\includegraphics[width=\textwidth]{mybackpic}};}
> before the \begin{frame} of the slide of interest (and after the
> \end{frame}).

Use the ignoreheading environment in beamer to create an empty slide
before the one you want with a background and then one after to reset
the background, as in:

#+begin_src org
  ,* define background:B_ignoreheading:
  :PROPERTIES:
  :BEAMER_env: ignoreheading
  :END:
  ,#+latex: \usebackgroundtemplate{\tikz\node 
{\includegraphics[width=\textwidth]{mybackpic}};}
  ,* My slide with background
  is here
#+end_src

The above assumes that top level headlines are frames, i.e. H:1 default.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.91.1, Org release_8.3.4-626-gb62d55



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-11 Thread Kyle Meyer
Kyle Meyer  writes:

> Since in this case the branch only consists of one commit, you could
> also just make a new branch off of maint and cherry pick the commit from
> the original branch.

This was a misleading way for me to describe this.  git cherry-pick has
accepted a range of commits since v1.7.2, so ignore the "one commit"
part.

-- 
Kyle



Re: [O] org-babel C math.h issue

2016-03-11 Thread Oz Ben-Ami
Thanks for the response.

On my machine, I get the undefined references even with GCC 5 (gcc version
5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)), if I put -lm before the source
file name.

As far as a patch, I can try but this would be my first time really playing
with org-mode code. As far as I can see, I would need to add the following
lines in ob-C.el:
L133: (libs (cdr (assoc :libs params)))
 (libs (mapconcat 'identity
   (if (listp libs) libs (list libs)) " "))
L142: (format "%s -o %s %s %s %s" ;; (added %s)
L147: libs

Am I missing anything?

Oz

On Fri, Mar 11, 2016 at 1:52 PM, Thierry Banel  wrote:

> To summarize this thread:
> It seems there was an issue long ago.
> Version 5 of GCC magically fixed it.
> But it is still here for older compilers.
>
> -
>
> To debug, execute the following piece of lisp code:
>
> (defadvice org-babel-eval (before xxx (cmd body))
>   ""
>   (message "org-babel-eval : %s" cmd))
> (ad-activate 'org-babel-eval)
>
> The actual compilation command will be displayed in the *Messages* buffer.
>
> With your example, we get
>
>gcc -o /tmp/babel-8412zIw/C-bin-8412IZR -lm
> /tmp/babel-8412zIw/C-src-84127OL.c
>
> --
>
> You are right, Oz, this can be fixed in line 147.
> But :flags is intended for flags like -g or -O, which need to appear
> before the source file.
>
> Probably we are missing an additional flag, which could be named :libs
> Then your example would be:
>
>   #+BEGIN_SRC C :includes '( ) :libs -lm
>   int i=9;
>   printf("%d\n",(int)sqrt(i));
>   #+END_SRC
>
> --
>
> Oz, do you think you would be able to provide a patch?
> The way to contribute is documented here:
> http://orgmode.org/worg/org-contribute.html#orgheadline1
>
> Thanks for reporting.
> Thierry
>
>
> Le 06/03/2016 23:44, Oz Ben-Ami a écrit :
> > Hi,
> >
> > I'm a new org user, and I'm sorry if I'm missing something obvious.
> > When executing a C code snippet with org-babel, that contains a math
> > function, I get the famous "undefined reference" errors. I tried
> > adding ":flags -lm", but that doesn't help. Looking at the code, it
> > seems the -lm flag is inserted in the wrong place, before the source
> > file. An easy change would be in line 147 of ob-C.el version
> > 8.3.4-634, moving "flags" to after the source file. This seems to
> > work, but I don't know if it would break anything else.
> >
> > A minimal working example, attached, includes the following snippet:
> >
> > #+BEGIN_SRC C :includes '( ) :flags -lm
> > int i=9;
> > printf("%d\n",(int)sqrt(i));
> > #+END_SRC
> >
> > Note the issue disappears if constants are directly used rather than
> > variables, presumably because the function call is optimized away
> > entirely.
> >
> > Any thoughts are appreciated.
> >
> > Oz
>
>
>


Re: [O] org-babel C math.h issue

2016-03-11 Thread Thierry Banel
To summarize this thread:
It seems there was an issue long ago.
Version 5 of GCC magically fixed it.
But it is still here for older compilers.

-

To debug, execute the following piece of lisp code:

(defadvice org-babel-eval (before xxx (cmd body))
  ""
  (message "org-babel-eval : %s" cmd))
(ad-activate 'org-babel-eval)

The actual compilation command will be displayed in the *Messages* buffer.

With your example, we get

   gcc -o /tmp/babel-8412zIw/C-bin-8412IZR -lm
/tmp/babel-8412zIw/C-src-84127OL.c

--

You are right, Oz, this can be fixed in line 147.
But :flags is intended for flags like -g or -O, which need to appear
before the source file.

Probably we are missing an additional flag, which could be named :libs
Then your example would be:

  #+BEGIN_SRC C :includes '( ) :libs -lm
  int i=9;
  printf("%d\n",(int)sqrt(i));
  #+END_SRC

--

Oz, do you think you would be able to provide a patch?
The way to contribute is documented here:
http://orgmode.org/worg/org-contribute.html#orgheadline1

Thanks for reporting.
Thierry


Le 06/03/2016 23:44, Oz Ben-Ami a écrit :
> Hi,
>
> I'm a new org user, and I'm sorry if I'm missing something obvious.
> When executing a C code snippet with org-babel, that contains a math
> function, I get the famous "undefined reference" errors. I tried
> adding ":flags -lm", but that doesn't help. Looking at the code, it
> seems the -lm flag is inserted in the wrong place, before the source
> file. An easy change would be in line 147 of ob-C.el version
> 8.3.4-634, moving "flags" to after the source file. This seems to
> work, but I don't know if it would break anything else.
>
> A minimal working example, attached, includes the following snippet:
>
> #+BEGIN_SRC C :includes '( ) :flags -lm
> int i=9;
> printf("%d\n",(int)sqrt(i));
> #+END_SRC
>
> Note the issue disappears if constants are directly used rather than
> variables, presumably because the function call is optimized away
> entirely.
>
> Any thoughts are appreciated.
>
> Oz




Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-11 Thread Kyle Meyer
Kaushal Modi  writes:

> Patch (after rebasing to 5a735b0) attached. I hope it works.

Thanks.  It almost works :)

Applying the patch fails because there's a whitespace change in one of
the context lines (the first one above the org-table-align change).  You
should be able to see the same failure on your end if you make a test
branch off of maint and then try to apply your patch.  But the patch
applies fine with the --ignore-whitespace flag to git am, so there is no
need to resend it.

I'll have another look at the changes tonight and will push it then
unless there are more comments from me or others.

> Git newbie question:
>
> Making the changes in the maint version of these 4 files manually was a bit
> of a pain. What's the right way of porting changes from one branch to
> another?

You can rebase the patch branch from master to maint.  From Magit, you
can use the magit-rebase-subset command ("rs").  From the command line,
you could do something like

git rebase --onto maint master 

Since in this case the branch only consists of one commit, you could
also just make a new branch off of maint and cherry pick the commit from
the original branch.

In either case, Git will let you know if there are any conflicts you
need to resolve.

> I am curious how the changes will be ported from the maint branch
> to the master branch.

I'll merge maint into master.

--
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-11 Thread Kaushal Modi
Patch (after rebasing to 5a735b0) attached. I hope it works.

Git newbie question:

Making the changes in the maint version of these 4 files manually was a bit
of a pain. What's the right way of porting changes from one branch to
another? I am curious how the changes will be ported from the maint branch
to the master branch. What git command should I be looking at to do this in
future? (because I always use the master branch and if I need to submit a
patch in future, I would need to switch to maint branch and port changes
from my master.

Thanks.

--
Kaushal Modi

On Fri, Mar 11, 2016 at 12:12 AM, Kyle Meyer  wrote:

> Kaushal Modi  writes:
>
> > About the patch not merging, I am surprised why that happened because I
> > first rebased to
> >
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e69e18dd71bdf0c9bae9546bf026a1123b9a8c53
> > and then created the patch. I redo the steps using git send-email
> tomorrow
> > and understand the difference.
>
> Please make the patch against the maint branch (currently 5a735b0b8)
> rather than master.  Also, you don't need to bother configuring git
> send-email; an attachment with the output of git format-patch is OK too.
>
> > About the org-contribute page, it is pointing to a different version of
> > emacs CONTRIBUTE, different from the one on emacs-25 branch (
> > http://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE ). Can you
> > please review that?
>
> Thanks for pointing that out.  I'll update the link.
>
> --
> Kyle
>


0001-Display-quotes-in-key-bindings-as-straight-quotes.patch
Description: Binary data


Re: [O] set default width for figure floats?

2016-03-11 Thread Rasmus
Rainer M Krug  writes:

> I think this has been asked before, but I can't find it:
>
> Is there a way of setting the default width for images included as
>
> [[file:map-All.png]]
>
> in org documents? It seems that the default is
>
> \includegraphics[width=.9\linewidth]{map-All.png}
>
> and I don't want the images to be scaled, but to let them keep their own
> size.

Maybe: org-latex-image-default-width
Or per image via #+attr_latex :width :height

Rasmus

-- 
What will be next?




Re: [O] error on org-reload (Symbol's value as variable is void: load-uncore)

2016-03-11 Thread Nick Dokos
Giuseppe Lipari  writes:

> Hello,
>
> I want to have a backtrace of an error I am encountering. So I followed the 
> instructions here,
> 1) I enabled "enter debugger on error"
> 2) M-x org-reload
>
> And I obtain the following error
>
> and: Symbol's value as variable is void: load-uncore
>

I think it's time to kill the running emacs session and start a new
one. If it happens with the new one, that might be a bug; but IMO it's
more likely that the session has been curdled.

-- 
Nick




Re: [O] org-babel C math.h issue

2016-03-11 Thread Nick Dokos
Anssi Saari  writes:

> Nick Dokos  writes:
>
>> You can test that that's the case: put your program into a file, say foo.c, 
>> and
>> execute
>>
>>   gcc -o foo.out -lm foo.c
>>
>> Does that give you undefined references?
>
> Does for me. gcc --version says
> gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
>
> So is it gcc that has changed then?
>

Possibly. I use

gcc (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)

on Fedora 22.

-- 
Nick




Re: [O] using vref in latex export, and normal links in html export

2016-03-11 Thread Alan Schmitt
On 2016-03-11 16:05, Alan Schmitt  writes:

> On 2016-03-11 15:02, John Kitchin  writes:
>
>> Try:
>>
>> (setq org-latex-prefer-user-labels t)
>>
>> I think this does what you want for org 8.3.4 at least.
>
> Thank you! This is what I was missing.

As a followup question, I read the documentation for `org-add-link-type`
which says "Org mode has a built-in default for exporting links." What
is the name of that function? I would like to change Eric's function to
something like:

#+begin_src elisp
  (org-add-link-type "vref" nil
 (lambda (path desc format)
   (cond
((eq format 'latex)
 (format "\\vref{%s}" path))
(t (call org default)
#+end_src

I searched through ox.el but could not find that function.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-02, Mauna Loa Obs.): 404.02


signature.asc
Description: PGP signature


Re: [O] using vref in latex export, and normal links in html export

2016-03-11 Thread Alan Schmitt
On 2016-03-11 15:02, John Kitchin  writes:

> Try:
>
> (setq org-latex-prefer-user-labels t)
>
> I think this does what you want for org 8.3.4 at least.

Thank you! This is what I was missing.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-02, Mauna Loa Obs.): 404.02


signature.asc
Description: PGP signature


[O] error on org-reload (Symbol's value as variable is void: load-uncore)

2016-03-11 Thread Giuseppe Lipari
Hello,

I want to have a backtrace of an error I am encountering. So I followed the
instructions here,
1) I enabled "enter debugger on error"
2) M-x org-reload

And I obtain the following error

and: Symbol's value as variable is void: load-uncore

with the following backtrace:

Debugger entered--Lisp error: (void-variable load-uncore)
add-to-list(load-uncore "ob-sh" append) (and (load (concat
(file-name-directory (or (locate-library f) "")) f) (quote noerror) nil nil
(quote mustsuffix)) (add-to-list (quote load-uncore) f (quote append))
(quote t)) (or (load (concat org-dir f) (quote noerror) nil nil (quote
mustsuffix)) (and (string= org-dir contrib-dir) (load (concat contrib-dir
f) (quote noerror) nil nil (quote mustsuffix))) (and (load (concat
(file-name-directory (or (locate-library f) "")) f) (quote noerror) nil nil
(quote mustsuffix)) (add-to-list (quote load-uncore) f (quote append))
(quote t)) f) (closure ((load-misses) (load-uncore) (lfeat "ob" "ob-C"
"ob-comint" "ob-core" "ob-ditaa" "ob-dot" "ob-emacs-lisp" "ob-eval"
"ob-exp" "ob-haskell" "ob-java" "ob-keys" "ob-lob" "ob-makefile"
"ob-mscgen" "ob-plantuml" "ob-python" "ob-ref" "ob-sh" "ob-sql" "ob-table"
"ob-tangle" "org-agenda" "org-bbdb" "org-bibtex" "org-clock" "org-compat"
"org-docview" "org-element" "org-entities" "org-faces" "org-footnote"
"org-gnus" "org-info" "org-install" "org-irc" "org-list" "org-macro"
"org-macs" "org-mhe" "org-mobile" "org-pcomplete" "org-rmail" "org-src"
"org-w3m" "org2blog-autoloads" "org-version" "org") (feats "org-rmail"
"org-src" "org-w3m" "org2blog-autoloads") (remove-re .
"^org-colview-xemacs$\\|^org$\\|^org-loaddefs$\\|^org-version$")
(feature-re . "^\\(org\\|ob\\|ox\\)\\(-.*\\)?") (contrib-dir .
"/home/lipari/elisp/org-mode/contrib/lisp/") (org-dir .
"/home/lipari/elisp/org-mode/lisp/") (uncompiled)
org-table-coordinate-overlays org-table-auto-blank-field org-clock-history
org-agenda-current-date parse-time-weekdays org-with-time org-defdecode
org-def org-read-date-inactive org-ans2 org-ans1 org-ts-what
org-columns-current-fmt-compiled org-clock-current-task org-clock-effort
org-agenda-skip-function org-agenda-skip-comment-trees
org-indent-indentation-per-level org-agenda-archives-mode
org-end-time-was-given org-time-was-given org-log-note-extra
org-log-note-purpose org-log-post-message org-last-inserted-timestamp
org-last-changed-timestamp org-entry-property-inherited-from
org-blocked-by-checkboxes org-state
org-agenda-headline-snapshot-before-repeat org-capture-last-stored-marker
ange-ftp-name-format org-agenda-start-on-weekday org-agenda-buffer-tmp-name
clean-buffer-list-kill-buffer-names org-id-link-to-org-use-id
org-agenda-buffer-name org-priority-regexp orgstruct-mode
org-goto-local-auto-isearch-map org-goto-start-pos ...) (f) (or (load
(concat org-dir f) (quote noerror) nil nil (quote mustsuffix)) (and
(string= org-dir contrib-dir) (load (concat contrib-dir f) (quote noerror)
nil nil (quote mustsuffix))) (and (load (concat (file-name-directory (or
(locate-library f) "")) f) (quote noerror) nil nil (quote mustsuffix))
(add-to-list (quote load-uncore) f (quote append)) (quote t)) f))("ob-sh")
mapcar((closure ((load-misses) (load-uncore) (lfeat "ob" "ob-C" "ob-comint"
"ob-core" "ob-ditaa" "ob-dot" "ob-emacs-lisp" "ob-eval" "ob-exp"
"ob-haskell" "ob-java" "ob-keys" "ob-lob" "ob-makefile" "ob-mscgen"
"ob-plantuml" "ob-python" "ob-ref" "ob-sh" "ob-sql" "ob-table" "ob-tangle"
"org-agenda" "org-bbdb" "org-bibtex" "org-clock" "org-compat" "org-docview"
"org-element" "org-entities" "org-faces" "org-footnote" "org-gnus"
"org-info" "org-install" "org-irc" "org-list" "org-macro" "org-macs"
"org-mhe" "org-mobile" "org-pcomplete" "org-rmail" "org-src" "org-w3m"
"org2blog-autoloads" "org-version" "org") (feats "org-rmail" "org-src"
"org-w3m" "org2blog-autoloads") (remove-re .
"^org-colview-xemacs$\\|^org$\\|^org-loaddefs$\\|^org-version$")
(feature-re . "^\\(org\\|ob\\|ox\\)\\(-.*\\)?") (contrib-dir .
"/home/lipari/elisp/org-mode/contrib/lisp/") (org-dir .
"/home/lipari/elisp/org-mode/lisp/") (uncompiled)
org-table-coordinate-overlays org-table-auto-blank-field org-clock-history
org-agenda-current-date parse-time-weekdays org-with-time org-defdecode
org-def org-read-date-inactive org-ans2 org-ans1 org-ts-what
org-columns-current-fmt-compiled org-clock-current-task org-clock-effort
org-agenda-skip-function org-agenda-skip-comment-trees
org-indent-indentation-per-level org-agenda-archives-mode
org-end-time-was-given org-time-was-given org-log-note-extra
org-log-note-purpose org-log-post-message org-last-inserted-timestamp
org-last-changed-timestamp org-entry-property-inherited-from
org-blocked-by-checkboxes org-state
org-agenda-headline-snapshot-before-repeat org-capture-last-stored-marker
ange-ftp-name-format org-agenda-start-on-weekday org-agenda-buffer-tmp-name
clean-buffer-list-kill-buffer-names org-id-link-to-org-use-id
org-agenda-buffer-name org-priority-regexp orgstruct-mode
org-goto-local-auto-isearch-map 

Re: [O] set default width for figure floats?

2016-03-11 Thread John Kitchin

Rainer M Krug writes:

> John Kitchin  writes:
>
>> Maybe you want org-image-actual-width
>>
>> This sets teh width in org, if you have a working imagemagick.
>
> No - I don't want any scaling. They are graphs I have created in R and I
> want to conserve the font sizes in the paper.
This is only scaling in the org buffer. I find high resolution (high
dpi) are often too large in my emacs, so I set this to be something like
300 to 600 to keep the figures reasonably sized in the buffer. It has no
effect on the LaTeX export.

>
>>
>> org-latex-image-default-width contains the default latex scaling.
>> Probably you can set this to nil to avoid scaling.
>
> Setting it to "" works perfectly. I have now set:
>
> --8<---cut here---start->8---
> #+BIND: org-latex-image-default-width ""
> --8<---cut here---end--->8---
>
> as well as
>
> --8<---cut here---start->8---
> # Local Variables:
> # eval: (visual-line-mode 1)
> # org-latex-image-default-width: ""
> # End:
> --8<---cut here---end--->8---
>
> I don't know if one is sufficient - I just leave them in and might try
> later.
>
> Thanks a lot,
>
> Rainer
>
>>
>>
>> Rainer M Krug writes:
>>
>>> I think this has been asked before, but I can't find it:
>>>
>>> Is there a way of setting the default width for images included as
>>>
>>> [[file:map-All.png]]
>>>
>>> in org documents? It seems that the default is
>>>
>>> \includegraphics[width=.9\linewidth]{map-All.png}
>>>
>>> and I don't want the images to be scaled, but to let them keep their own
>>> size.
>>>
>>> Is this possible (I'd like to avoid having to use #+ATTR_LATEX :width
>>> before each - and even then I would have no idea to unset the value)
>>>
>>> Thanks,
>>>
>>> Rainer
>>
>>
>> --
>> 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


--
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



Re: [O] set default width for figure floats?

2016-03-11 Thread Rainer M Krug
John Kitchin  writes:

> Maybe you want org-image-actual-width
>
> This sets teh width in org, if you have a working imagemagick.

No - I don't want any scaling. They are graphs I have created in R and I
want to conserve the font sizes in the paper.

>
> org-latex-image-default-width contains the default latex scaling.
> Probably you can set this to nil to avoid scaling.

Setting it to "" works perfectly. I have now set:

--8<---cut here---start->8---
#+BIND: org-latex-image-default-width ""
--8<---cut here---end--->8---

as well as

--8<---cut here---start->8---
# Local Variables:
# eval: (visual-line-mode 1)
# org-latex-image-default-width: ""
# End:
--8<---cut here---end--->8---

I don't know if one is sufficient - I just leave them in and might try
later.

Thanks a lot,

Rainer

>
>
> Rainer M Krug writes:
>
>> I think this has been asked before, but I can't find it:
>>
>> Is there a way of setting the default width for images included as
>>
>> [[file:map-All.png]]
>>
>> in org documents? It seems that the default is
>>
>> \includegraphics[width=.9\linewidth]{map-All.png}
>>
>> and I don't want the images to be scaled, but to let them keep their own
>> size.
>>
>> Is this possible (I'd like to avoid having to use #+ATTR_LATEX :width
>> before each - and even then I would have no idea to unset the value)
>>
>> Thanks,
>>
>> Rainer
>
>
> --
> 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

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] using vref in latex export, and normal links in html export

2016-03-11 Thread John Kitchin
Try:

(setq org-latex-prefer-user-labels t)

I think this does what you want for org 8.3.4 at least.


Alan Schmitt writes:

> Hello Eric,
>
> On 2016-03-11 12:03, Eric S Fraga  writes:
>
>> On Friday, 11 Mar 2016 at 11:20, Alan Schmitt wrote:
>>> Hello,
>>>
>>> I'm converting a latex document into org-mode to easily export it both
>>> to latex and html. I've just encountered something that I don't know how
>>> to do: export a \vref reference. I would like to have something that
>>> exports to \vref in latex, and to a normal link in html.
>>>
>>> I thought I could do this trick with a macro:
>>>
>>> #+macro: vref @@latex:\myvref{$1}{@@[[$1]]@@latex:}@@
>>
>> I may be missing something but could you not simply use
>>
>>   [[vref:fig:log-expt-7]]
>>
>> (along with description text if you wished) and define an org link as
>> below?
>>
>> #+begin_src elisp
>>   (org-add-link-type "vref" nil
>>  (lambda (path desc format)
>>(cond
>> ((eq format 'latex)
>>  (format "\\vref{%s}" path)
>> #+end_src
>>
>> (untested)
>
> Thank you for the suggestion, but I end up with the same thing as with
> the macro: the reference generated is to "fig:log-expt-7", but this does
> not work as the label assigned by org to the figure is
> "fig:orgparagraph1".
>
> Here is a small example of a similar problem. Exporting this to latex
>
> This is a \ref{fig:foo} and this is a link [[fig:foo]]
>
> #+label: fig:foo
> #+begin_figure
> Test
> #+end_figure
>
> results in
>
> #+begin_src latex
> This is a \ref{fig:foo} and this is a link \ref{orgspecialblock1}
>
> \begin{figure}
> Test
> \label{orgspecialblock1}
> \end{figure}
> #+end_src
>
> Alan


--
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



Re: [O] set default width for figure floats?

2016-03-11 Thread John Kitchin
Maybe you want org-image-actual-width

This sets teh width in org, if you have a working imagemagick.

org-latex-image-default-width contains the default latex scaling.
Probably you can set this to nil to avoid scaling.


Rainer M Krug writes:

> I think this has been asked before, but I can't find it:
>
> Is there a way of setting the default width for images included as
>
> [[file:map-All.png]]
>
> in org documents? It seems that the default is
>
> \includegraphics[width=.9\linewidth]{map-All.png}
>
> and I don't want the images to be scaled, but to let them keep their own
> size.
>
> Is this possible (I'd like to avoid having to use #+ATTR_LATEX :width
> before each - and even then I would have no idea to unset the value)
>
> Thanks,
>
> Rainer


--
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



Re: [O] using vref in latex export, and normal links in html export

2016-03-11 Thread Alan Schmitt
Hello Eric,

On 2016-03-11 12:03, Eric S Fraga  writes:

> On Friday, 11 Mar 2016 at 11:20, Alan Schmitt wrote:
>> Hello,
>>
>> I'm converting a latex document into org-mode to easily export it both
>> to latex and html. I've just encountered something that I don't know how
>> to do: export a \vref reference. I would like to have something that
>> exports to \vref in latex, and to a normal link in html.
>>
>> I thought I could do this trick with a macro:
>>
>> #+macro: vref @@latex:\myvref{$1}{@@[[$1]]@@latex:}@@
>
> I may be missing something but could you not simply use
>
>   [[vref:fig:log-expt-7]]
>
> (along with description text if you wished) and define an org link as
> below?
>
> #+begin_src elisp
>   (org-add-link-type "vref" nil
>  (lambda (path desc format)
>(cond
> ((eq format 'latex)
>  (format "\\vref{%s}" path)
> #+end_src
>
> (untested)

Thank you for the suggestion, but I end up with the same thing as with
the macro: the reference generated is to "fig:log-expt-7", but this does
not work as the label assigned by org to the figure is
"fig:orgparagraph1".

Here is a small example of a similar problem. Exporting this to latex

This is a \ref{fig:foo} and this is a link [[fig:foo]]

#+label: fig:foo
#+begin_figure
Test
#+end_figure

results in

#+begin_src latex
This is a \ref{fig:foo} and this is a link \ref{orgspecialblock1}

\begin{figure}
Test
\label{orgspecialblock1}
\end{figure}
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-02, Mauna Loa Obs.): 404.02


signature.asc
Description: PGP signature


[O] set default width for figure floats?

2016-03-11 Thread Rainer M Krug

I think this has been asked before, but I can't find it:

Is there a way of setting the default width for images included as

[[file:map-All.png]]

in org documents? It seems that the default is

\includegraphics[width=.9\linewidth]{map-All.png}

and I don't want the images to be scaled, but to let them keep their own
size.

Is this possible (I'd like to avoid having to use #+ATTR_LATEX :width
before each - and even then I would have no idea to unset the value)

Thanks,

Rainer
-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature


[O] Latex code inbetween beamer frames

2016-03-11 Thread Giacomo M

Dear all,
I would like to set a background image for some slides. AFAIK, the way 
to achieve this in beamer is by using sth like:
\usebackgroundtemplate{\tikz\node 
{\includegraphics[width=\textwidth]{mybackpic}};}
before the \begin{frame} of the slide of interest (and after the 
\end{frame}).
I would like to be able to do this in org-mode, and couldn't find a 
solution so far.

Any suggestion would be really appreciated.

Thanks,

Giacomo




Re: [O] using vref in latex export, and normal links in html export

2016-03-11 Thread Eric S Fraga
On Friday, 11 Mar 2016 at 11:20, Alan Schmitt wrote:
> Hello,
>
> I'm converting a latex document into org-mode to easily export it both
> to latex and html. I've just encountered something that I don't know how
> to do: export a \vref reference. I would like to have something that
> exports to \vref in latex, and to a normal link in html.
>
> I thought I could do this trick with a macro:
>
> #+macro: vref @@latex:\myvref{$1}{@@[[$1]]@@latex:}@@

I may be missing something but could you not simply use

  [[vref:fig:log-expt-7]]

(along with description text if you wished) and define an org link as
below?

#+begin_src elisp
  (org-add-link-type "vref" nil
 (lambda (path desc format)
   (cond
((eq format 'latex)
 (format "\\vref{%s}" path)
#+end_src

(untested)

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.91.1, Org release_8.3.4-626-gb62d55



[O] using vref in latex export, and normal links in html export

2016-03-11 Thread Alan Schmitt
Hello,

I'm converting a latex document into org-mode to easily export it both
to latex and html. I've just encountered something that I don't know how
to do: export a \vref reference. I would like to have something that
exports to \vref in latex, and to a normal link in html.

I thought I could do this trick with a macro:

#+macro: vref @@latex:\myvref{$1}{@@[[$1]]@@latex:}@@

then define the latex command to ignore the second argument:

\newcommand{\myvref}{2}{\vref{#1}}

Unfortunately this does not work, as the name of the label is changed
during export:

Figure \myvref{fig:log-expt-7}{\ref{fig:orgparagraph1}} 

So my question is: is anyone using vref with org-mode? Or should I just
convert this to a plain reference?

Thanks,

Alan


-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-02, Mauna Loa Obs.): 404.02


signature.asc
Description: PGP signature