Skip to content

Instantly share code, notes, and snippets.

@shane5ul
Last active November 29, 2022 19:40
Show Gist options
  • Save shane5ul/987de65d74603cc76b8abe1ec8d83f51 to your computer and use it in GitHub Desktop.
Save shane5ul/987de65d74603cc76b8abe1ec8d83f51 to your computer and use it in GitHub Desktop.
sed oneliner to move \cite *after* punctuation to before
sed 's/\([,.;:]\)\\cite{\([A-Za-z0-9, ]*\)}/ \\cite{\2}\1/g'
# use script below for Before2After
# sed 's/\\cite{\([A-Za-z0-9, ]*\)}\([,.;:]\)/\2\\cite{\1}/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment