Citations before or after punctuation

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
madde001
Posts: 2
Joined: Tue Apr 21, 2020 2:11 pm

Citations before or after punctuation

Post by madde001 »

If I want to use a superscript-number citation format in my final document, I would prefer to put the Bookends placeholder citations after punctuation, like this:
"This is one reference,{Smith et al., 2013, #80735} whereas this is another.{Jones, 2011, #2594}"
After scanning, this would result in:
"This is one reference,¹ whereas this is another.²"

If I later decide I want to use a citation format using brackets instead of superscripts, the position relative to the punctuation would be different:
"This is one reference {Smith et al., 2013, #80735}; whereas this is another {Jones, 2011, #2594}."
After scanning, this would result in:
"This is one reference [1]; whereas this is another [2]."

Is there a way to automate repositioning the citation location relative to punctuation, if I decide to change my citation format as above?
Thanks!!
John

Jon
Site Admin
Posts: 9023
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Citations before or after punctuation

Post by Jon »

It's simple. In your word processor do a find/replace for with " {" and replace with "{", or vice versa, depending on whether you want a space in front of the final citation or not.

Jon
Sonny Software

madde001
Posts: 2
Joined: Tue Apr 21, 2020 2:11 pm

Re: Citations before or after punctuation

Post by madde001 »

Thanks, Jon. It's a bit more complicated than that, since I need to reposition the reference relative to the punctuation mark. I actually figured out a way to do it with a couple of regexes.

To go from superscript to brackets, the regex is find "([\.,;:\)])( ?\{[^\}]*\}) ?" and replace with " $2$1 ". It's best to follow with find " {2,}" and replace " ", because occasionally you end up with multiple spaces.

To go from brackets to superscript, the regex is find " (\{[^\}]*\})([\.,;:–])" and replace "$2$1".

I use Textsoap to do this, as my word processor doesn't allow saving custom regex searches.

John

Post Reply