[Latex] Remove “Cited by” from bib

Problem:

Sometimes .bib generated contains useless contents which make their way to your references, see Figure 1. you cloud have 10 or 300 citations depend on the article that you are working on. Here how to clean it up in a few key strokes.

Before

before

Figure 1, some .bib generated include “cite by …”

 

 

Solution:

Make a copy of your .bib file. Get sublime -> use replace function -> enable regular express as shown in Figure 2. – > use regular express:

.* \{cited by.*

.* means to match anything, so this regular express match anything before an after “{cited by”.

Replace it with nothing.

  • You can search to see if the replacing is what you expected before actually hitting the replace button. See Figure 2.

 

Make good use of Sublime

regex

Figure 2, enable, use regular expression search in Sublime 2

 

Figure 3 shown the result. Just do the compilation normally and it is all cleanup.

After

after

Figure 3, cleaned up 🙂

 

Other thoughts

  • alternatively, a shell script can be written to do the something, but sublime works on Linux, OS X and Windows.
  • this trick can be used for other unwanted content in .bib or even for other type of file.
  • remember  to make a copy of the original file before you make the changes.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s