Re: [O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-23 Thread Andreas Reuleaux
Ah, yes, you are right, thanks. Have used class before, 
but start out with style usually when experimenting.

Thanks,
  Andreas


Richard Lawrence <richard.lawre...@berkeley.edu> writes:

> Hi Andreas,
>
> Andreas Reuleaux <r...@a-rx.info> writes:
>
>> Leaving out the double quotes may be comfortable, but I am not sure
>> if this was a good idea: makes it difficult to see which parts
>> belong to the style, and where the alt attribute starts: 
>>
>>  #+attr_html: :style float: right; border: 1px solid brown; :alt
>> foo  this would have been easier to read I think 
>>
>>   #+attr_html: :style "float: right; border: 1px solid brown;"
>> :alt "foo"
>
> This would be a good place to use a CSS class.
>
> In your CSS file (or between 

Re: [O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-23 Thread Andreas Reuleaux
adding to my own mail:

I have progressed since: I can add style attributes if I start them with
a colon (:style) and then don't use quotes (not: :style "float: right;" )

this sample.org thus works for me:

-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. 
#+attr_html: :style float: right; border: 1px solid brown;
[[./imgs/org-mode-unicorn.png]]

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.
#+attr_html: :style float: left ; border: 1px solid brown;
[[./imgs/org-mode-unicorn.png]]

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 
-

Leaving out the double quotes may be comfortable, but I am not sure if
this was a good idea: makes it difficult to see which parts belong to
the style, and where the alt attribute starts:

 #+attr_html: :style float: right; border: 1px solid brown; :alt foo
 
this would have been easier to read I think

  #+attr_html: :style "float: right; border: 1px solid brown;" :alt "foo"



Anyway, in the example above: if I remove the newlines, like so:

-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. 
#+attr_html: :style float: right; border: 1px solid brown;
[[./imgs/org-mode-unicorn.png]]
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.
#+attr_html: :style float: left ; border: 1px solid brown;
[[./imgs/org-mode-unicorn.png]]
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 
-

then I get brown boxes around the paragraphs as well, the style is applied
to the image and the paragraph, why is that?

rendered by org mode:
--


Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
...
--

All I want is: images floated to the right/left, and text that flows around
these images. Or: text that appears to flow around the images (even
though technically the img tags are not children of a paragraph (p)
tag).


The situation gets more difficult / confusing if I try to add captions
to the images

--
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. 

#+caption: the famous unicorn
#+attr_html: :style float: right;
[[./imgs/org-mode-unicorn.png]]

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.

#+caption: another one
#+attr_html: :style float: left;
[[./imgs/org-mode-unicorn.png]]

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 
---



First observation:
the rendered output does not use the html5
figure, figcaption tags -even though I have requested
(setq org-html-html-fancy t)
instead: some div with class figure, and likewise span with class
figure (cf below), OK, fine with me, can live with that.


but more importantly: I would have expected the whole image+caption
to be floated to the left/right, but njet:
the image is floated to the right, but the caption text is on the left:

-



Figure 1: the famous unicorn

...

-


Now that gets in my way.

Am I missing something?

And hm: not sure how to say this properly: org mode is very nice,
it has a thousand bells and whistles that I don't need, but of course
I understand that people have different tastes/needs. But writing
some paragraphs with left/right floated images is essential to me,
and has not been and smooth/easy experience so far, as explained in
detail above (how do I get image+caption floated to the right eg.?)

Thanks.

-Andreas




Re: [O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-22 Thread Andreas Reuleaux
Nicolas Goaziou  writes:

> I think the correct syntax is
>
>   #+ATTR_HTML: :style float:right;
>
> The tutorial is probably outdated.
>
>
> Regards,

Thanks a lot, and yes: I found that out myself already in the meantime.

I had sent another mail to the mailing list is this regard, which hasn't
made it to the list yet (not sure why it's taking that long, but I am in
contact with Bastien already).

Thanks, 
  Andreas





[O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-21 Thread Andreas Reuleaux
Hi,

following this tutorial

  https://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html

I am trying to export some sample.org file to html, and have the images
floated to the right, with no success however.

to that end ATTR_HTML is used in the tutorial and in my sample.org:
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. 
#+ATTR_HTML: style="float:right;"
[[./img/org-mode-unicorn.png]]
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.
#+ATTR_HTML: style="float:right;"
[[./img/org-mode-unicorn.png]]
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 
-

but no matter how I export this sample.org snippet, the html attributes 
(ATTR_HTML)
are ignored. - below is an emacs bash script that I use for the export
(making my results reproducible hopefully).

all I get is the plain html image tags, no style attributes:


---



Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.



Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 

...
---

I have no idea why these attributes are ignored, or how to make them appear:

- attr_html seems a fairly standard mechanism, and works for
  everybody but me ?, cf eg.

https://linevi.ch/en/org-link-extra-attrs.html

- I have tried with different export options, but of course there
  are endless possibilies / combinations, and I have no
  clue here.

  I have tried to keep my export script below simple, but
  have kept a few lines as comments (or not) to more easily experiment
  with different export setting, like

  (setq org-html-head-include-default-style nil)
  (setq org-html-head-include-scripts nil)
  (setq org-html-doctype "html5")
  (setq org-html-html-fancy t)
  ;; (setq org-html-htmlize-output-type 'css)

  with no impact for the export of my html attributes however.

- maybe the org mode syntax / behaviour has changed ? - however
  I have tried both:

  - org version 9.1.9 - as comes with my debian elpa-org package

  - and org version 8.2.10 - as comes with my emacs 25.2.2 on debian
buster.

  I can can choose either one be commenting / uncommenting the first
  few lines in my export script below

  
(let ((package-dir (car (file-expand-wildcards (concat
   "/usr/share/"
   ;; emacs25
   (symbol-name debian-emacs-flavor)
   "/site-lisp/elpa/org-*")))
   ))

  (when (file-directory-p package-dir)
(add-to-list 'load-path package-dir)
(add-to-list 'auto-mode-alist '("\\.org\\(-mode\\)?\\'" . org-mode))
)
  )
  
  ie. I try to load from "/usr/share/emacs25/site-lisp/elpa/org-*" if not
  commented out.

  the script will respond by printing either org mode version:

org version 8.2.10
org version 9.1.9


- I *can* have extra style config added at the beginning of my export with

  
  #+html_head: 
  #+html_head:
  #+html_head: 
  

  but in general don't want *all* my images floated to the right:
  I want to be able to assign attributes to individual images:
  one image floated to the right, say, another one to the left.
  and of course I may want to assign other attributes (besides float) 
  as well.


OK, thanks in advance. Find my export script below, and call with
  
  $ ./exporthtml.el sample.org sample.html

or 

  $ ./exporthtml.el sample.org

that way either org-html-export-as-html or org-html-export-to-html
gets used.

-Andreas


exporthtml.el
-
:;exec /usr/bin/env emacs -batch -Q -l "$0" -f main "$@"



(let ((package-dir (car (file-expand-wildcards (concat
   "/usr/share/"
   ;; emacs25
   (symbol-name debian-emacs-flavor)
   "/site-lisp/elpa/org-*")))
   ))

  (when (file-directory-p package-dir)
(add-to-list 'load-path package-dir)
(add-to-list 'auto-mode-alist '("\\.org\\(-mode\\)?\\'" . org-mode))
)
  )



(require 'cl)
(toggle-debug-on-error)



;; (require 'cask "~/cfg/emacs/cask/cask.el")
;; (cask-initialize)




(defun main ()
  (interactive)
  
  (destructuring-bind (org-file  outfile) 

Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not

2016-06-16 Thread Andreas Reuleaux

I gave it another try, and I got it finally!
I have to press C-u and then return (not just C-u),
then the helm menu to chose the citation type pops up

Thanks again,
  Andreas



John Kitchin <jkitc...@andrew.cmu.edu> writes:

> Andreas Reuleaux writes:
>
>> But what does not currently work for me (and what used to work):
>> getting a choice of citation: cite/citep/citeauthor/nocite/whatever.
>
> To get this, you press C-u enter on the candidate you select, and that
> should give you a new helm selection for citation type. This is
> currently only possible in the helm backend. I am not sure if it can be
> done with ivy yet.




Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not

2016-06-11 Thread Andreas Reuleaux
Thanks again,

John Kitchin  writes:

>> But what does not currently work for me (and what used to work):
>> getting a choice of citation: cite/citep/citeauthor/nocite/whatever.
>
> To get this, you press C-u enter on the candidate you select, and that
> should give you a new helm selection for citation type. This is
> currently only possible in the helm backend. I am not sure if it can be
> done with ivy yet.

still can't get that to work, sorry, giving up for now, ie. resorting
to org w/ plain old reftex.



> I think C-u C-c ] will give a list of labels to make a ref link to.
> Maybe you don't have any labels, so it looks empty.

This is fine now, that I have some links


Thanks anyway,
  Andreas




Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not

2016-06-11 Thread Andreas Reuleaux
John - thanks for your fast reply, and I am learning: 
didn't know that it should be possible to C-u on the candidate
selected - still: it's not working for me (yet), - I assume the error
is on my side, but I need more time to find it: start out from a fresh,
barely nothing config maybe, will get back, in case I get lost.

-Andreas




John Kitchin <jkitc...@andrew.cmu.edu> writes:

> Andreas Reuleaux writes:
>
>> I have used org-ref in the past and I liked it,
>> now I am trying to get it working again.
>> In a way this has become easier:
>>
>> * I can install org-ref from Melpa now, instead of
>>   tangling from the org-ref.org file in the past
>>
>> * with a fairly simple setup (omitting the details for now,
>>   but can give them of course), and the default
>>
>> (setq org-ref-completion-library 'org-ref-helm-bibtex)
>>   
>>   I get to chose my papers/books to cite in a quite comfortable way
>>   when I press C-c ]
>>
>> But what does not currently work for me (and what used to work):
>> getting a choice of citation: cite/citep/citeauthor/nocite/whatever.
>
> To get this, you press C-u enter on the candidate you select, and that
> should give you a new helm selection for citation type. This is
> currently only possible in the helm backend. I am not sure if it can be
> done with ivy yet.
>
>> Basically I want 
>>
>> * a list to choose from in the first place
>>
>> * preferrably have my own list of choices, allowing me to focus on the
>>   ones that I really do use (not get distracted by other more exotic
>>   ones), and that what I can also switch on a per document basis
>>   between bitex/natbib/biblatex and the available options there
>
> You can customize org-ref-cite-types for this. Make it shorter, a local
> var, etc...
>
>>
>> I know that org-ref is relying on reftex in this regard,
>> and when I just use plain reftex, or even (require 'org-ref-reftex),
>> I get to chose cite/citep/citeauthor etc., but I loose the comfort
>> of the org-ref-helm-bibtex input method.
>>
>> Ideally - I guess I am dreaming - I would want to rely
>> on ivy (or helm) for narrowing down my choice of cite/citep/citeauthor
>> etc - rather than type some retex keystroke.
>>
>> I got some help from this list in past, how to configure my reftex
>> list of choices, to use biblatex entries: parencite etc. - thanks again,
>> and can go through these old emails of mine of course, but I am not
>> sure in how far these things still apply, given that org-ref has
>> changed quite a lot in between. Also at the time, I was at least
>> presented some menu when I typed C-u C-c ] - so it was just a matter
>
> I think C-u C-c ] will give a list of labels to make a ref link to.
> Maybe you don't have any labels, so it looks empty.
>
>> of modifying that menu, now I only get to see "pattern:" in the minibuffer.
>>
>> Thanks,
>>   Andreas




[O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not

2016-06-11 Thread Andreas Reuleaux
I have used org-ref in the past and I liked it,
now I am trying to get it working again.
In a way this has become easier:

* I can install org-ref from Melpa now, instead of
  tangling from the org-ref.org file in the past

* with a fairly simple setup (omitting the details for now,
  but can give them of course), and the default

(setq org-ref-completion-library 'org-ref-helm-bibtex)
  
  I get to chose my papers/books to cite in a quite comfortable way
  when I press C-c ]

But what does not currently work for me (and what used to work):
getting a choice of citation: cite/citep/citeauthor/nocite/whatever.

Basically I want 

* a list to choose from in the first place

* preferrably have my own list of choices, allowing me to focus on the
  ones that I really do use (not get distracted by other more exotic
  ones), and that what I can also switch on a per document basis
  between bitex/natbib/biblatex and the available options there

I know that org-ref is relying on reftex in this regard,
and when I just use plain reftex, or even (require 'org-ref-reftex),
I get to chose cite/citep/citeauthor etc., but I loose the comfort
of the org-ref-helm-bibtex input method.

Ideally - I guess I am dreaming - I would want to rely
on ivy (or helm) for narrowing down my choice of cite/citep/citeauthor
etc - rather than type some retex keystroke.

I got some help from this list in past, how to configure my reftex
list of choices, to use biblatex entries: parencite etc. - thanks again,
and can go through these old emails of mine of course, but I am not
sure in how far these things still apply, given that org-ref has
changed quite a lot in between. Also at the time, I was at least
presented some menu when I typed C-u C-c ] - so it was just a matter
of modifying that menu, now I only get to see "pattern:" in the minibuffer.

Thanks,
  Andreas




Re: [O] issues with org-contacts

2016-02-27 Thread Andreas Reuleaux
Nicolas Goaziou  writes:

> It looks like a lexical binding problem. We switched "org.el" to lexical
> binding in development version. You may be having a mixed installation,
> somehow.
>
> Regards,

Ah, OK, thanks a lot (and as already answered in private e-mail):
I will take a closer look at my installation in terms of lexical
binding then.

-Andreas




[O] issues with org-contacts

2016-02-26 Thread Andreas Reuleaux
I have been using Julien Danjou's org-contacts for a while now,
cf

  http://orgmode.org/worg/org-contrib/
  org-contacts.el – manage contacts
 Written by Julien Danjou. Link to raw file.
  https://julien.danjou.info/projects/emacs-packages#org-contacts

and happily so far, ie. I haven't changed my config.

I would eg. type

st+ in my To: field of a message, that I am composing

  To: st+

hit tab, and the contact address would be completed from my
(list of) org-contacts-files (find an address matching st...)

When I do so (hit tab ie.) in my current environment: emacs (24.5.1) / org 
(8.2.10,
the one that comes with emacs, as I understand), on debian testing ie., I get:

  org-make-tags-matcher: `org-make-tags-matcher' expects todo-only to be scoped 
in
 
I get the same error message, when I use a newer org version (8.3.3),
install the debian package org-mode ie.

I did contact Julien about this issue, but he pointed me to the org mailing
list instead, as he isn't maintaining the code any more.

Can anyone first: confirm my issue, and then: point me in the right
direction, please?

I should say that I have gone through some efforts in the past, to make 
(the single tab key) behave "normally" (not be occupied by 'yas-expand
ie.) in some modes. But now in message-mode (the mode that I am in when 
composing
a mail), when I define any of these (that would usually do):

  (local-set-key (kbd "")   #'message-tab)
  (local-set-key (kbd "")   #'completion-at-point)
  (local-set-key (kbd "")   #'indent-for-tab-command)
 
I still get the above message above:
  
  org-make-tags-matcher: `org-make-tags-matcher' expects todo-only to be scoped 
in



Thanks in advance,
  Andreas





Re: [O] org-ref for biblatex

2014-05-19 Thread Andreas Reuleaux
Thanks a lot, looks good!
(but I haven't had a chance yet to try it out myself,
will do so of course)

-Andreas


John Kitchin jkitc...@andrew.cmu.edu writes:

 good news, I think org-ref works with biblatex pretty well now, see
 http://kitchingroup.cheme.cmu.edu/blog/2014/05/19/Exporting-citations-with-biblatex/

 org-ref also makes a reasonable html bibliography now too!

 John

 ---
 John Kitchin
 Associate Professor
 Doherty Hall A207F
 Department of Chemical Engineering
 Carnegie Mellon University
 Pittsburgh, PA 15213
 412-268-7803
 http://kitchingroup.cheme.cmu.edu



 On Sun, May 18, 2014 at 6:38 PM, Andreas Reuleaux andr...@a-rx.info wrote:

 John,

 thanks a lot, I will try them out, and let you know.

 Never mind about the comfort (or lack thereof) of how to add an s or the
 like in org. - I can easily do that by hand.

 Working back ends (exporters) for the various citiation commands seem
 much more important at this point.


 -Andreas


 John Kitchin jkitc...@andrew.cmu.edu writes:

  I added the multicite commands. you have to use cites:foo,bar,baz, and it
  will export to the format you suggested. org-ref is not smart enough to
  automatically add the s to the link type if you add more than one
  reference, you have to be smart enough to do that.
 
  can you try it out and let me know if it does what you need?
 
  John
 
  ---
  John Kitchin
  Associate Professor
  Doherty Hall A207F
  Department of Chemical Engineering
  Carnegie Mellon University
  Pittsburgh, PA 15213
  412-268-7803
  http://kitchingroup.cheme.cmu.edu
 
 
 
  On Sun, May 18, 2014 at 1:16 PM, Andreas Reuleaux andr...@a-rx.info
 wrote:
 
  John,
 
  to come back to org-ref, which basically runs fine for me now, thanks.
 
  I am running biblatex (as opposed to bibtex) though, with meanwhile
  biber as a backend.
 
  The biblatex manual is very comprehensible and explains the different
  citation commands from page 79 onwards.
 
 
 
 http://ctan.mirrorcatalogs.com/macros/latex/contrib/biblatex/doc/biblatex.pdf
 
  I just ran into this: Having added a few citations to an existing
  one with C-u C-c d, I have something like
 
cite:foo,bar,baz
 
  which gets exported to latex as
 
\cite{foo,bar,baz}
 
  whereas biblatex expects
 
\cites{foo}{bar}{baz}
 
  as I understand (note the plural s as well), and there are other config
  tweekings I am doing for biblatex (that I intend to explain some other
  time).
 
  Maybe a switch (an org-ref variable) would be a good idea, that lets
  one choose: use either biblatex or plain old bibtex?
 
  thanks in advance
 
  -Andreas
 
 
 







Re: [O] org-ref for biblatex

2014-05-19 Thread Andreas Reuleaux
John,

yes they work fine for me, I have tested: cites and parencites.

Thanks a lot.

-Andreas


John Kitchin jkitc...@andrew.cmu.edu writes:

 I added the multicite commands. you have to use cites:foo,bar,baz, and it
 will export to the format you suggested. org-ref is not smart enough to
 automatically add the s to the link type if you add more than one
 reference, you have to be smart enough to do that.

 can you try it out and let me know if it does what you need?

 John

 ---
 John Kitchin
 Associate Professor
 Doherty Hall A207F
 Department of Chemical Engineering
 Carnegie Mellon University
 Pittsburgh, PA 15213
 412-268-7803
 http://kitchingroup.cheme.cmu.edu



 On Sun, May 18, 2014 at 1:16 PM, Andreas Reuleaux andr...@a-rx.info wrote:

 John,

 to come back to org-ref, which basically runs fine for me now, thanks.

 I am running biblatex (as opposed to bibtex) though, with meanwhile
 biber as a backend.

 The biblatex manual is very comprehensible and explains the different
 citation commands from page 79 onwards.


 http://ctan.mirrorcatalogs.com/macros/latex/contrib/biblatex/doc/biblatex.pdf

 I just ran into this: Having added a few citations to an existing
 one with C-u C-c d, I have something like

   cite:foo,bar,baz

 which gets exported to latex as

   \cite{foo,bar,baz}

 whereas biblatex expects

   \cites{foo}{bar}{baz}

 as I understand (note the plural s as well), and there are other config
 tweekings I am doing for biblatex (that I intend to explain some other
 time).

 Maybe a switch (an org-ref variable) would be a good idea, that lets
 one choose: use either biblatex or plain old bibtex?

 thanks in advance

 -Andreas







[O] org-ref for biblatex

2014-05-18 Thread Andreas Reuleaux
John,

to come back to org-ref, which basically runs fine for me now, thanks.

I am running biblatex (as opposed to bibtex) though, with meanwhile
biber as a backend.

The biblatex manual is very comprehensible and explains the different
citation commands from page 79 onwards.

  http://ctan.mirrorcatalogs.com/macros/latex/contrib/biblatex/doc/biblatex.pdf

I just ran into this: Having added a few citations to an existing
one with C-u C-c d, I have something like

  cite:foo,bar,baz
  
which gets exported to latex as

  \cite{foo,bar,baz}

whereas biblatex expects

  \cites{foo}{bar}{baz}

as I understand (note the plural s as well), and there are other config
tweekings I am doing for biblatex (that I intend to explain some other
time).

Maybe a switch (an org-ref variable) would be a good idea, that lets
one choose: use either biblatex or plain old bibtex?

thanks in advance

-Andreas




Re: [O] org-ref for biblatex

2014-05-18 Thread Andreas Reuleaux
John,

thanks a lot, I will try them out, and let you know.

Never mind about the comfort (or lack thereof) of how to add an s or the
like in org. - I can easily do that by hand.

Working back ends (exporters) for the various citiation commands seem
much more important at this point.


-Andreas


John Kitchin jkitc...@andrew.cmu.edu writes:

 I added the multicite commands. you have to use cites:foo,bar,baz, and it
 will export to the format you suggested. org-ref is not smart enough to
 automatically add the s to the link type if you add more than one
 reference, you have to be smart enough to do that.

 can you try it out and let me know if it does what you need?

 John

 ---
 John Kitchin
 Associate Professor
 Doherty Hall A207F
 Department of Chemical Engineering
 Carnegie Mellon University
 Pittsburgh, PA 15213
 412-268-7803
 http://kitchingroup.cheme.cmu.edu



 On Sun, May 18, 2014 at 1:16 PM, Andreas Reuleaux andr...@a-rx.info wrote:

 John,

 to come back to org-ref, which basically runs fine for me now, thanks.

 I am running biblatex (as opposed to bibtex) though, with meanwhile
 biber as a backend.

 The biblatex manual is very comprehensible and explains the different
 citation commands from page 79 onwards.


 http://ctan.mirrorcatalogs.com/macros/latex/contrib/biblatex/doc/biblatex.pdf

 I just ran into this: Having added a few citations to an existing
 one with C-u C-c d, I have something like

   cite:foo,bar,baz

 which gets exported to latex as

   \cite{foo,bar,baz}

 whereas biblatex expects

   \cites{foo}{bar}{baz}

 as I understand (note the plural s as well), and there are other config
 tweekings I am doing for biblatex (that I intend to explain some other
 time).

 Maybe a switch (an org-ref variable) would be a good idea, that lets
 one choose: use either biblatex or plain old bibtex?

 thanks in advance

 -Andreas







Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
OK, thanks.

-Andreas


John Kitchin jkitc...@andrew.cmu.edu writes:

 I think you are restricted to single characters. That key is used by
 reftex, so it would be a limitation in reftex. You can always define your
 own function with a key-binding for something specific.

 John




Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
Eric S Fraga e.fr...@ucl.ac.uk writes:


 How do I specify the bibstyle for org-ref?


I am not sure if I understand your question correctly
and John certainly has more insight here, but I have in
my org document

#+LaTeX_HEADER: \include{ltxhdr}

and within that ltxhdr.tex I have among other config settings

  \usepackage[backend=bibtex,style=authoryear]{biblatex}
  \addbibresource{refs.bib}

I could have written several lines of 

#+LaTeX_HEADER: \usepackage[backend=bibtex,style=authoryear]{biblatex}
#+LaTeX_HEADER: \addbibresource{refs.bib}

instead.

There is no specific bibstyle of org-ref (correct, John?), that's the
job of latex, you will be happy if:

* your org mode has clickable citations links,

* let's you insert citations in a comfortably manner

* you can jump between refs and labels etc.

* all of those citations get exported to their latex
  equivalents

If for some reason your citations get exported to latex, say
cite:foo to \cite{foo}, but still don't appear in your
final pdf, than you have to tweek your latex settings,
obviously. - Maybe forgot to call bibtex(8) on your document?

I run these:
* an emacs batch script, tex.el to get the document.tex
  from document.org
* xelatex -8bit -shell-escape document.tex
* bibtex8 document
* xelatex document
  again, etc.

You can check your latex toolchain independently from
your org-ref config.

HTH,
  -Andreas
  




Re: [O] org-ref code

2014-05-14 Thread Andreas Reuleaux
Well, I know how to write shell scripts,
and have something similar encoded in a shake file
(haskell make replacement), for that matter,
but prefer to have xelatex not called 5 times
during every little development step.
Anyway thanks a lot.

My point here really was, that org-ref and
the latex chains are separate and can be
separately tested.

-Andreas


Sharon Kimble boudic...@skimble.plus.com writes:

 Andreas Reuleaux andr...@a-rx.info writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:


 How do I specify the bibstyle for org-ref?


 I am not sure if I understand your question correctly
 and John certainly has more insight here, but I have in
 my org document

 #+LaTeX_HEADER: \include{ltxhdr}

 and within that ltxhdr.tex I have among other config settings

   \usepackage[backend=bibtex,style=authoryear]{biblatex}
   \addbibresource{refs.bib}

 I could have written several lines of 

 #+LaTeX_HEADER: \usepackage[backend=bibtex,style=authoryear]{biblatex}
 #+LaTeX_HEADER: \addbibresource{refs.bib}

 instead.

 There is no specific bibstyle of org-ref (correct, John?), that's the
 job of latex, you will be happy if:

 * your org mode has clickable citations links,

 * let's you insert citations in a comfortably manner

 * you can jump between refs and labels etc.

 * all of those citations get exported to their latex
   equivalents

 If for some reason your citations get exported to latex, say
 cite:foo to \cite{foo}, but still don't appear in your
 final pdf, than you have to tweek your latex settings,
 obviously. - Maybe forgot to call bibtex(8) on your document?

 I run these:
 * an emacs batch script, tex.el to get the document.tex
   from document.org
 * xelatex -8bit -shell-escape document.tex
 * bibtex8 document
 * xelatex document
   again, etc.

 You can check your latex toolchain independently from
 your org-ref config.

 HTH,
   -Andreas

 That seems a very long winded way round things! For your information
 this is a batch script that I'm using for generating a PDF in pure
 latex, and all I have to do is to cd to the directory where the
 files are, and then just enter pdfbuild in the command-line. It
 does all the rest itself, and you could easily adapt it for your
 circumstances
 #!/bin/bash
 set -e
 #set -x

 #variables
 filename=uh2014

 #
 xelatex $filename
 biber $filename
 biber $filename
 xelatex $filename 
 biber $filename
 xelatex $filename 
 makeindex $filename
 makeindex $filename
 xelatex $filename
 makeglossaries $filename
 xelatex $filename
 xelatex $filename

 It handles and generates the references, the glossary, and the index
 as well as the body of the document. 

 All you have to do is enter your foo.tex where foo is the name of
 your generated tex file, and then let the script take over.

 Sharon.




Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 You can see a document I wrote using org-ref here:
 http://kitchingroup.cheme.cmu.edu/org/2014/05/13/Using-org-ref-for-citations-and-references.org

 You will want to pull a current version. I added some code so it is in
 principle easy for you to add your own citation types and use the org-ref
 machinery to insert citations.


 I made a little screencast here: http://screencast.com/t/bxfafVydE


Thanks for the sample file and the screencast, very nice.

still a bit confused about org-ref-cite-types:

Say, I want to add two new link types:


  textcite - somehow standard in biblatex,
 cf. the biblatex.pdf manual, p 81

  citeauthorfull - my own creation - author with first- and lastname,
   cf below.


from my document.org I load some latex preparation stuff like this

  #+LaTeX_HEADER: \include{ltxhdr}

I was just getting tired of prefixing so many lines with #+LaTeX_HEADER:
and collected some of those in a lxthdr.tex file.
there I have prepared something for this citeauthorfull thingy:


  %% cf
  %% 
http://tex.stackexchange.com/questions/24979/citing-authors-full-name-in-biblatex
  %% called citeauthorfirstlast... there


  \DeclareCiteCommand{\citeauthorfull}
{\boolfalse{citetracker}%
 \boolfalse{pagetracker}%
 \DeclareNameAlias{labelname}{first-last}%
 \usebibmacro{prenote}}
{\ifciteindex
   {\indexnames{labelname}}
   {}%
 \printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}

this does the job, don't ask me details.

now back to org-ref:

with your advice I add:

  ;; add new format
  (setf (nth 2 (assoc 'org reftex-cite-format-builtin))
(append (nth 2 (assoc 'org reftex-cite-format-builtin))
'(

  ;; C-t like text
  (?\C-t  . textcite:%l)


  ;; f like full
  (?f  . citeauthorfull:%l)

  )))

and I get the comfort of two additional citation formats to chose from
when typing C-u C-c ] - nice, indeed. this is basically what you
said in your e-mail before, now also on the org-ref.org webpage,
(just shortcut and don't define that format variable)

Now I can add these:

  (add-to-list 'org-ref-cite-types textcite)
  (add-to-list 'org-ref-cite-types citeauthorfull)

but this is of limited use to me currently, at least I don't get
the point, not sure if I am doing something wrong:

say, I have added a few of these

  textcite:foo

  citeauthorfull:bar

in my document.org, there are some problems with these:

* first: they don't appear blue and clickable in my document.org

* second: they don't get exported in the latex in a reasonable way,
  they appear there just as

textcite:foo
citeauthorfull:bar

Well I can cure the situation by adding by adding


(org-add-link-type
 textcite
 'org-ref-cite-onclick-minibuffer-menu
 ;; formatting
 (lambda (keyword desc format)
   (cond
((eq format 'html) (format (textcite%s/textcite) path))
((eq format 'latex)
 (concat \\textcite{
 (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
 })



(org-add-link-type
 citeauthorfull
 'org-ref-cite-onclick-minibuffer-menu
 ;; formatting
 (lambda (keyword desc format)
   (cond
((eq format 'html) (format (citeauthorfull%s/citeauthorfull) path))
((eq format 'latex)
 (concat \\citeauthorfull{
 (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
 })


now they appear clickable in blue, and get properly exported
to \textcite{...} and \citeauthorfull{...}

Now, what was the deal of this adding them  to 'org-ref-cite-types
in the first place, if I had to take care of the details by hand anyway?
Is there anything I could have left out / shortcut / I have forgotten maybe?

Thanks.

-Andreas




Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 with the most recent org-ref, it should be sufficient to put this in your
 init file:

 (org-ref-define-citation-link textcite ?I)
 (org-ref-define-citation-link citeauthorfull ?F)

 this will create a textcite link and create a reftex menu you select with
 the key I, and the other link with the key F. these should automatically be
 links, and have completion functions. These will get exported as
 \textcite{label} and \citeauthorfull{label}. The
 org-ref-define-citation-link function adds the link, creates the functions
 necessary, and adds the types to the right places.

 You do not need to do the manual additions unless you manually define the
 link like you did with org-add-link-type.



OK, I see, and works fine, thanks.

One minor thing: Am I restricted to single-letter keystrokes
above ? like:

  I (...?I)
  F (... ?F)
  C-t   (... ?\C-t)

I tried to get working something like

 C-r C-t 

with something like this

  (... ?(kbd C-r C-t))

with no success, but I am unsure, if there is just something simple
missing like a quote or a backslash, or if it's just not possible
at this point.

-Andreas




Re: [O] org-ref code

2014-05-13 Thread Andreas Reuleaux
Eric,

I don't have auctex installed, and org-ref works fine for me.

But I do run a recent self-compiled emacs 24 (haven't tested yet,
if it works with my older emacs24 from debian as well),
and I get updated packages like dash relatively often via cask
( https://github.com/cask/cask , http://cask.github.io/ ),
i. e. I have in my Cask file

  (depends-on dash)

so it wouldn't have happend to me to have an outdated dash pkg,
isolating your problem and pointing at what exactly is causing your
trouble is of course more difficult (and creating a minimal config that
works for me takes more time than I currently have, sorry).

Hope this helps, nevertheless


-Andreas



Eric S Fraga e.fr...@ucl.ac.uk writes:

 John,

 another data point.  When I try to load an org file, once org-ref is
 loaded, I get the following problem:

 Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   re-search-forward(nil 10001 t)
   tex-main-file()
   reftex-TeX-master-file()
   reftex-tie-multifile-symbols()
   reftex-access-scan-info((16))
   reftex-parse-all()
   (and (buffer-file-name) (file-exists-p (buffer-file-name))
 (global-auto-revert-mode t) (reftex-parse-all))
   org-mode-reftex-setup()
   run-hooks(change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook)
   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook
 outline-mode-hook org-mode-hook))
   run-mode-hooks(org-mode-hook)

 Because of this, org-ref doesn't get initialised properly.

 Any idea what may be causing this?  Do I need to configure auctex or
 similar?

 thanks,
 eric




Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:


 C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
 in a hook function in line 104 of org-ref.org.

 I made a custom variable to store the key-binding, but I realized it
 probably doesn't help, since the binding



 1. C-u on it does not give me a choice of citation method


 If you type C-u M-x  org-ref-insert-cite-link

 do you get a choice?

 I just tried this on a fresh pull and it does work for me. I am not sure
 why this wouldn't work for you.  Do you tangle the .el file from the .org
 file? I have this code somewhere else to build it when needed:


I can confirm that C-c ] and C-u C-c ]
work fine for me.

my setup if fairly simple (with org-ref.el tangled from org-ref.org)

  (require 'org-ref)

  (custom-set-variables
   '(org-ref-bibliography-notes notes.org)
   '(org-ref-default-bibliography  (list refs.bib))
   ;; '(org-ref-pdf-directory ...)
   ;; '(org-ref-default-citation-link ...)
   ;; '(org-ref-insert-cite-key ...)
   )

looking forward to discover more of org-ref.

FWIW, I was using textcite:... (with biblatex) as well, helped myself by
just inserting a cite:... and then changing the link with C-c C-l from
cite to textcite. But I really need read up on all those different
citations commands once more, maybe textcite is not really necessary?
Could I add it somehow to the list of choices available in C-u C-c ] ?
(I realized there are citetext, citep*, citep as well, that I yet have
to discover).

By the way: the org-ref.org literate programming docs are fine
for someone interested in the gory details / relatively experienced.
Ist there a simpler document just describing its usage - that
you would hand out to your chemistry students e. g. ?

Somehting maybe explaining the differences from the other approaches
that can be found e g in 

  
http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

  
http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/

Thanks for org-ref.

-Andreas




Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Is there some org variable I have not set that tells org to treat cite:
 plain text as a link on export?  Obviously org already recognises it as
 a link but the export doesn't...  org-link-protocols and org-link-types
 look fine.


Being just a org-ref beginner, I don't know if there is a more
straightforward solution but, I have configured:


  (org-add-link-type
   cite
   'org-ref-cite-onclick-minibuffer-menu
   ;; formatting
   (lambda (keyword desc format)
 (cond
  ((eq format 'html) (format (cite%s/cite) path))
  ((eq format 'latex)
   (concat \\cite{
   (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ,)
   })


and similarily for autocite and textcite (the citation types that I am
using), that works for me. Adapted (copied) from the org-add-link-type
for autocite given in the org-ref.org description.  Not sure if this
should just work out of the box (without configuration), but then, it's
not that much code.

-Andreas





Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin jkitc...@andrew.cmu.edu writes:

 that should work out of the box, and that link is defined in org-ref as

 (org-add-link-type
  cite
  'org-ref-cite-onclick-minibuffer-menu
  'org-ref-cite-link-format)

 I am not sure why it would not work out of the box.


They *do* work out of the box, as I can see now.


-Andreas




[O] tab completion for org-contacts not working for me in emacs 24

2014-05-11 Thread Andreas Reuleaux
I have just downloaded org-contacts.el

load it in my .emacs/init.el like this


 (setq load-path (cons ~/cfg/emacs/el/org load-path))
(require 'org-contacts)
(setq org-contact-files (list
 ~/work/org/contacts.org
 ))


and have a minimal ~/work/org/contacts.org file as described
in the manual

  https://julien.danjou.info/projects/emacs-packages#org-contacts

Now in gnus, in a new message that I am creating if I type +tab in the
To: field, something is happening:

I get a message:

  Updating Org Contacts Database...done

and my curser moves a tab, leaving me with

  To: +curser here

just no contacts / tags are found!?

I *am* using emacs24, a recent one in fact: 24.4.50.1

(I saw some similar messages of people having difficultis of
getting org-contacts to work nicely with gnus together, who were
using using emacs 23, and that turned out to be the problem, not in my
case).

Thanks.

-Andreas




Re: [O] tab completion for org-contacts not working for me in emacs 24

2014-05-11 Thread Andreas Reuleaux
Alexander,

that was it, thanks a lot.


-Andreas


Alexander Baier alexander.ba...@mailbox.org writes:

 (setq org-contact-files (list
 


 For me this is org-contacts-files, maybe that is the problem?

 HTH,