Re: Citations and basic processor: examples of some things that don't work

2023-12-07 Thread William Denton

On 7 December 2023, Ihor Radchenko wrote:


This is another, new bug I introduced while fixing the previous one :)
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a59193e47


Fantastic!  Thanks.  Now it all works.


It would be nice to have proper tests for oc-basic and other oc-* backends.


I'll have a look in there and see if I can add some.

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 420.04 ppm (Mauna Loa Observatory, 2023-12-01)

Re: Citations and basic processor: examples of some things that don't work

2023-12-07 Thread Ihor Radchenko
William Denton  writes:

> Thanks for digging into this, Ihor.  It exports now, but I'm afraid it's 
> doing too much capitaliztion.
>
> A name like "van Dongen" should become "Van Dongen" when cited with a caps 
> variant, for example [cite/a/c:@friends].  This is turning it into "VAN 
> DONGEN", 
> upcasing the whole string when it should just be doing the first letter.

This is another, new bug I introduced while fixing the previous one :)
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a59193e47

It would be nice to have proper tests for oc-basic and other oc-* backends.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Citations and basic processor: examples of some things that don't work

2023-12-06 Thread William Denton
Thanks for digging into this, Ihor.  It exports now, but I'm afraid it's 
doing too much capitaliztion.


A name like "van Dongen" should become "Van Dongen" when cited with a caps 
variant, for example [cite/a/c:@friends].  This is turning it into "VAN DONGEN", 
upcasing the whole string when it should just be doing the first letter.


I looked into how the CSL versions handles it.  In citeproc-el's 
citeproc-site.el there's this:  "CAPITALIZE-FIRST is non-nil if the first word 
of the rendered citation should be capitalized."  That goes with this in 
oc-csl.el in the definition of org-cite-csl--create-structure-params for doing a 
/a/c author-caps citation:


   ((or "caps" "c") '(:mode author-only :capitalize-first t))

So for the basic exporter to do what the CSL one does, it should just capitalize 
the first letter.  I hope you don't mind opening up that file one last time for 
this fix ...


Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 420.04 ppm (Mauna Loa Observatory, 2023-12-01)

Re: Citations and basic processor: examples of some things that don't work

2023-12-06 Thread Ihor Radchenko
William Denton  writes:

>> ASCII export:
>
> Huh!  I never tried ASCII export.  I see HTML works, too.
>
> Try LaTeX or ODT.  My apologies, I should have specified that.  It should 
> throw 
> an error that starts like this:
>
> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p (raw nil 
> #("van Dongen, M.R.C." 0 18 (:parent #3

This should be working now.
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Citations and basic processor: examples of some things that don't work

2023-11-29 Thread William Denton

On 29 November 2023, Ihor Radchenko wrote:


William Denton  writes:


Attached (I think attachments work on this list) is a small Org file that has a
table that sets out all the various options possible with the basic processor
for citations.  Most work, but not the author style, and the caps and bare-caps
variants never do.


Seems to work for me on main. Unless I miss something:

ASCII export:


Huh!  I never tried ASCII export.  I see HTML works, too.

Try LaTeX or ODT.  My apologies, I should have specified that.  It should throw 
an error that starts like this:


Debugger entered--Lisp error: (wrong-type-argument char-or-string-p (raw nil 
#("van Dongen, M.R.C." 0 18 (:parent #3

  capitalize((raw nil #("van Dongen, M.R.C." 0 18 (:parent #1
  (if caps (capitalize a) a)
  (org-cite-concat p (if caps (capitalize a) a) ", " y s)
  (closure ((caps "c" "bc")) (p a y s) (org-cite-concat p (if caps (capitalize 
a) a) ", " y s))(nil (raw nil #("van Dongen, M.R.C." 0 18 (:parent #2))) "2012" 
nil)
  funcall((closure ((caps "c" "bc")) (p a y s) (org-cite-concat p (if caps 
(capitalize a) a) ", " y s)) nil (raw nil #("van Dongen, M.R.C." 0 18 (:parent 
#3))) "2012" nil)


I can reproduce this by running "make repro" on main and then loading in that 
basic.org file.



Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 420.59 ppm (Mauna Loa Observatory, 2023-11-28)

Re: Citations and basic processor: examples of some things that don't work

2023-11-29 Thread Ihor Radchenko
William Denton  writes:

> Attached (I think attachments work on this list) is a small Org file that has 
> a 
> table that sets out all the various options possible with the basic processor 
> for citations.  Most work, but not the author style, and the caps and 
> bare-caps 
> variants never do.

Seems to work for me on main. Unless I miss something:

ASCII export:


 style  variant cite result 

:(van Dongen, M.R.C., 2012) 
b (bare)//b: van Dongen, M.R.C., 2012   
c (caps)//c: (Van Dongen, M.R.C., 2012) 
 a (author) /a:  van Dongen, M.R.C. 
 a (author) c (caps)/a/c:Van Dongen, M.R.C. 
 ft (note)  /ft: [1]
 ft (note)  b (bare)/ft/b:   [2]
 ft (note)  bc (bare-caps)  /ft/bc:  [3]
 ft (note)  c (caps)/ft/c:   [4]
 n (nocite) /n: 
 na (noauthor)  /na: (2012) 
 na (noauthor)  b (bare)/na/b:   2012   
 nb (numeric)   /nb: (1)
 t (text)   /t:  van Dongen, M.R.C. (2012)  
 t (text)   b (bare)/t/b:van Dongen, M.R.C. 2012
 t (text)   bc (bare-caps)  /t/bc:   Van Dongen, M.R.C. 2012
 t (text)   c (caps)/t/c:Van Dongen, M.R.C. (2012)  


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Citations and basic processor: examples of some things that don't work

2023-11-28 Thread William Denton
Attached (I think attachments work on this list) is a small Org file that has a 
table that sets out all the various options possible with the basic processor 
for citations.  Most work, but not the author style, and the caps and bare-caps 
variants never do.


To test try changing parentheses to square brackets, for example 
(cite/t/c:@friends) to [cite/t/c:@friends], and exporting.  From what I see in 
oc-basic.el, everything in the table should work.  Changing the processor to use 
CSL, they all do.



Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.47 ppm (Mauna Loa Observatory, 2023-11-24)@book{chassellIntro,
  title = {An Introduction to Programming in {{Emacs Lisp}}},
  author = {Chassell, Robert},
  date = {2023},
  publisher = {{GNU Press}},
  location = {Boston},
  url = {https://www.gnu.org/software/emacs/manual/eintr.html}
}

@book{friends,
  title = {{{LaTeX}} and Friends},
  author = {van Dongen, M.R.C.},
  date = {2012},
  location = {Berlin},
  publisher = {Springer},
  doi = {10.1007/978-3-642-23816-1},
  isbn = {9783642238161}
}
#+title: Org citations with the basic processor
#+author:
#+date:

#+startup: showall align
#+options: num:nil ^:nil  toc:nil

#+bibliography: Basic.bib

#+cite_export: basic

Something like =(cite//c:@friends)= is a citation that does not work.  Test by 
changing the parentheses to square brackets and exporting.

#+attr_latex: :environment longtable
| style | variant| cite| result|
|---++-+---|
|   || :   | [cite:@friends]   |
|   | b (bare)   | //b:| [cite//b:@friends]|
|   | c (caps)   | //c:| (cite//c:@friends)|
| a (author)|| /a: | (cite/a:@friends) |
| a (author)| c (caps)   | /a/c:   | (cite/a/c:@friends)   |
| ft (note) || /ft:| [cite/ft:@friends]|
| ft (note) | b (bare)   | /ft/b:  | [cite/ft/b:@friends]  |
| ft (note) | bc (bare-caps) | /ft/bc: | (cite/ft/bc:@friends) |
| ft (note) | c (caps)   | /ft/c:  | (cite/ft/c:@friends)  |
| n (nocite)|| /n: | [cite/n:@friends] |
| na (noauthor) || /na:| [cite/na:@friends]|
| na (noauthor) | b (bare)   | /na/b:  | [cite/na/b:@friends]  |
| nb (numeric)  || /nb:| [cite/nb:@friends]|
| t (text)  || /t: | [cite/t:@friends] |
| t (text)  | b (bare)   | /t/b:   | [cite/t/b:@friends]   |
| t (text)  | bc (bare-caps) | /t/bc:  | (cite/t/bc:@friends)  |
| t (text)  | c (caps)   | /t/c:   | (cite/t/c:@friends)   |

* Bibliography

# You can specify "plain" or "numeric," and anything else turns into 
author-year.
#+print_bibliography: