Page 1 of 1

Citations before or after punctuation

Posted: Thu Feb 25, 2021 3:26 pm
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

Re: Citations before or after punctuation

Posted: Thu Feb 25, 2021 4:49 pm
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

Re: Citations before or after punctuation

Posted: Fri Feb 26, 2021 1:09 pm
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