Pasting \cite multiple items as discrete terms

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
mwra
Posts: 48
Joined: Mon Jun 15, 2015 7:01 am

Pasting \cite multiple items as discrete terms

Post by mwra »

Is there a way to select lots of items in the main window list and have each item's citation paste as a separate citation? Currently they are all run together. As I was trying to transfer some 50+ items, I'd prefer to avoid doing 50 x individual copy/paste operations.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Pasting \cite multiple items as discrete terms

Post by Jon »

That works for normal citing, but not BibTeX. I'd have to look into it.

Jon
Sonny Software
mwra
Posts: 48
Joined: Mon Jun 15, 2015 7:01 am

Re: Pasting \cite multiple items as discrete terms

Post by mwra »

Thanks. I guess I can use BBEdit and some regex for now.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Pasting \cite multiple items as discrete terms

Post by Jon »

Sorry, I misread your original post. No, you can't make many individual citations at once. When you select more than one citation and Copy Citation they're put into the same citation group. You could create a format in Bookends, though, that would essentially do this for you. Something like

$\cite{$u1$}$

would output the key field surrounded by the citation delimiters like this

\cite{smith2018}

for every hit in your library.

Jon
Sonny Software
mwra
Posts: 48
Joined: Mon Jun 15, 2015 7:01 am

Re: Pasting \cite multiple items as discrete terms

Post by mwra »

Thanks. I'll give that a try. Meanwhile, using BBEdit (or a grep-replace capable text editor), you can do:

Find: , (single comma)
Replace: }\n\\cite{ (close curly bracket, line return, (escaped) backslash, 'cite', open curly bracket.

Then do 'replace all'. Works like a charm.

Also tested your format suggestion, the steps I took were:
  • Open the formats manager
  • Select my BibTeX format
  • Add a new format based on the selected format, using the option to "replicate all type", calling the format "BibTeX cite list".
  • Select the new format. In turn select each existing type (journal, proceedings, etc.). Select all the code in the 'Field Order' box and replace it with the string '$\cite{$u1$}$' (no quotes) as per Jon's post above.
  • Close the format manager dialog.
  • Select multiple hits
  • Instead of copying a citation, use the ''Biblio' menu, 'Bibliography'. Set the format to use as the new format if not already selected.
  • Export to either the bibliography window for copy paste or export to a text file.
Again it works like a charm.

As a precaution of against weird inherited keys with strange characters, I have also (separate thread today) standardised all my BibTeX key values. Lest someone point it out, I do realise this will mean if I try to re-export a bibliography for some past paper the cite values will have changed. Luckily I don't have the issue but i mention it in case others trip on it (I guess if necessary one could save the 'old' key value to the item's notes).

Thanks again for all the rapid and productive help.
Post Reply