patchGNU Octave - Patches: patch #7960, Added citation() command

 
 

patch #7960: Added citation() command

Submitted by:  Júlio Hoffimann Mendes <juliohm>
Submitted on:  Tue 26 Feb 2013 12:25:10 AM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Carnë Draug <carandraug> Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Mar 2013 11:49:03 AM UTC, comment #5: 

Perfect Carnë! Thanks.

Júlio Hoffimann Mendes <juliohm>
Sun 03 Mar 2013 02:45:01 AM UTC, comment #4: 

It's done. See http://hg.savannah.gnu.org/hgweb/octave/rev/3a93af21d206

Note that this is a complete rewrite of the original function. It looks for a CITATION file and displays it. I have also made pkg aware of possible CITATION in packages.

Carnë Draug <carandraug>
Project MemberIn charge of this item.
Sat 02 Mar 2013 05:49:46 PM UTC, comment #3: 

From the thread on the mailing list:

On 28 February 2013 12:03, Juan Pablo Carbajal <ajuanpi+dev@gmail.com> wrote:

> On Tue, Feb 26, 2013 at 1:28 AM, Júlio Hoffimann <julio.hoffimann@gmail.com> wrote:
>> The patch follows: https://savannah.gnu.org/patch/index.php?7960
>>
>> Carnë, could you guide me on how packages should be integrated? Feel free to
>> do it yourself if you want. ;)
>>
>
> After Carnë's addition it looks great.


I disagree. I'm not very happy with my submission at all. Specially,
using an empty string to remove the entry from the citation list seems
like very poor design (there's only me to blame here). And using it as
command rather than function allows for people to very easily
overwrite citation instructions by accident without chance to recover
them.

So I just did what I should have done before and checked what R does
and I found their solution much more elegant. Basically R and its
package comes with a CITATION file and citation() simple display the
contents of the file. In this case, citation() becomes very much like
what we already have for news().

I find this a much better approach. If someone adds the citation file
to the build system, I'll submit a patch for citation() and make pkg()
deal with the CITATION file.

Carnë Draug <carandraug>
Project MemberIn charge of this item.
Wed 27 Feb 2013 05:17:33 PM UTC, comment #2: 

It's great, i would just add an extra comma immediately after "@book{" in the core message.

I need do more investigation on how packages are integrated into Octave, i can't contribute much in that matter, sorry.

Júlio Hoffimann Mendes <juliohm>
Wed 27 Feb 2013 12:26:47 AM UTC, comment #1: 

Here's some improvement though in hindsight I should have gave it some thought before coding.

Basically, this makes "citation image" display a citation for the image package, and "citation ("image", "some text"), create the entry for image, and "citation ("image", "")" remove it.

This does not allow for example to get a list of the packages that have citations associated with it. I could make the first argument to be register, unregister, list or a package name. That means  no package could ever have any of the first 3 options.

Suggestions?

(file #27536)

Carnë Draug <carandraug>
Project MemberIn charge of this item.
Tue 26 Feb 2013 12:25:10 AM UTC, original submission:  

This patch mimics the R citation() command.

The BibTeX entry was generated using ISBN to BibTeX converter with 978-1441413000 from GNU Octave manual

GNU Octave packages were left for someone with more experience to implement.

Júlio Hoffimann Mendes <juliohm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27536:  citation.m added by carandraug (3KiB - text/x-objcsrc)
file #27530:  citation.m added by juliohm (2KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by juliohm (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-03-03 carandraug StatusIn Progress => Done
        Assigned toNone => carandraug
        Open/ClosedOpen => Closed
    2013-03-02 carandraug StatusNone => In Progress
    2013-02-27 carandraug Attached File- => Added citation.m, #27536
    2013-02-26 juliohm Attached File- => Added citation.m, #27530

    Back to the top


    Powered by Savane 3.5