Re: org-cite-list-bibliography-files

2021-07-26 Thread John Kitchin
I think it should work like setting header args on src-blocks, where
there is a hierarchy that the most local setting always overrides the
less local setting, described at 
https://orgmode.org/manual/Using-Header-Arguments.html.

This gives you the opportunity for system wide args, e.g. a global set
of bib files via a variable setting,

file-level options via keyword settings

header-level options via property settings

src-block level options

For bibliographies, it is only necessary to go to file-level I think.

Bruce D'Arcus  writes:

> Hi Greg,
>
> On Mon, Jul 26, 2021 at 1:56 AM Greg Minshall  wrote:
>
>> is a reasonable approach: if local, use just that; if no local, use
>> global (if it exists).
>>
>> then, the "alternative" might be: use both local and global?
>
> That should be the default.
>
> But as Emmanual noted last week, there are cases where one might want
> to combine them.
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2021-07/msg00495.html
>
> It's just not the common case.
>
> Bruce


--
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
Pronouns: he/him/his



Re: org-cite-list-bibliography-files

2021-07-26 Thread Eric S Fraga
On Sunday, 25 Jul 2021 at 15:36, Titus von der Malsburg wrote:
> Personally, I can’t think of a use case where you would like to use a
> mix of multiple bibliographies, local and global, 

I do do this often.  I'm not sure why but I tend to have a local
bibliography which I add to as I am writing a paper.  When I am finished
with the paper, I then usually merge all the entries in the local
bibliography into my global bibliography.  But, as I said, I don't know
why I got into the habit of doing this... ;-)

But I don't particularly care which way org decides to handle multiple
bibliographies as I will adapt.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-598-g604bfd
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Multilingual quotes inside paragraphs

2021-07-26 Thread Juan Manuel Macías
Hi all,

I'm experimenting with `org-link-set-parameters' to create multilingual
quotes (chunks of text) inside paragraphs. Although I focus mainly on
the export to LaTeX with babel and csquotes packages, I also want extend
support for HTML and odt output. I leave here some sketches.

For the `:face' parameter I use for laziness a face already defined in
Magit :-). `:display' with the value 'full can be removed.

First, we have the LaTeX babel command \foreignlanguage{lang}{chunk of
text}. The language can be expressed by abbreviation ("de" for German;
here I reuse `org-latex-babel-language-alist') or explicitly preceded by
a "!": "!german" (the reason for the latter is that in babel we can
define new languages):

[[lang:de][some text in German]]

or

[[lang:!german][some text in German]]

The code:

(org-link-set-parameters "lang"
   :display 'full
   :face 'magit-header-line-key
   :export (lambda (target desc format)
 (cond
  ((eq format 'latex)
   (let ((langs 
org-latex-babel-language-alist))
 (concat
  "\\foreignlanguage{"
  (if (string-match-p "!" target)
  (replace-regexp-in-string "!" "" 
target)
(cdr (assoc target langs)))
  "}{" desc "}")))
  ;; TODO
  ((or (eq format 'html)
   (eq format 'odt))
   (format "%s" desc)

We also have this command from the csquotes package for foreign quoted
texts (loads only the hyphenation rules for the language and sets the
text between quotation marks): \hyphentextquote{lang}{quoted text}. For
this I have defined a new link "qlang":

  (org-link-set-parameters "qlang"
   :display 'full
   :face 'magit-header-line-key
   :export (lambda (target desc format)
 (cond
  ((eq format 'latex)
   (let ((langs 
org-latex-babel-language-alist))
 (concat
  "\\hyphentextquote{"
  (if (string-match-p "!" target)
  (replace-regexp-in-string "!" "" 
target)
(cdr (assoc target langs)))
  "}{" desc "}")))
  ((or (eq format 'html)
   (eq format 'odt))
   ;; TODO (use here the proper quotes)
   (format "«%s»" desc)

We can even make the citations come out in color when we are in draft
mode, thanks to the LaTeX ifdraft package:

(org-link-set-parameters "qlang"
 :display 'full
 :face 'magit-header-line-key
 :export (lambda (target desc format)
   (cond
((eq format 'latex)
 (let ((langs 
org-latex-babel-language-alist))
   (concat

"{\\ifdraft{\\color{teal}}{}\\hyphentextquote{"
(if (string-match-p "!" target)
(replace-regexp-in-string "!" "" 
target)
  (cdr (assoc target langs)))
"}{"
desc "}}")))
((or (eq format 'html)
 (eq format 'odt))
 ;; TODO
 (format "«%s»" desc)


Best regards,

Juan Manuel 



Re: org-cite-list-bibliography-files

2021-07-26 Thread Bruce D'Arcus
Hi Greg,

On Mon, Jul 26, 2021 at 1:56 AM Greg Minshall  wrote:

> is a reasonable approach: if local, use just that; if no local, use
> global (if it exists).
>
> then, the "alternative" might be: use both local and global?

That should be the default.

But as Emmanual noted last week, there are cases where one might want
to combine them.

https://lists.gnu.org/archive/html/emacs-orgmode/2021-07/msg00495.html

It's just not the common case.

Bruce