# Jackey's 感悟

Do Research

## Add a word count script for TeXWorks

We can add a new script to count the words of one tex file like this

Here is the script “wordcouter.js”

```// TeXworksScript
// Title: Count the words in tex file
// Description: counter
// Author: Jackey Lu
// Version: 0.1
// Date: 2011-09-21
// Script-Type: standalone
// Context: TeXDocument

var cmd = "e:\\local\\texlive\\2010\\bin\\win32\\texcount.exe " + TW.target.fileName;
var result = TW.system(cmd);
result.output;

```

Put the script in the TeXworks profile directory “scripts”, in windows 7, it is like this, C:\Users\[your username]\TeXworks\scripts.

PS: you must change the path of  texcount.exe with your real path.

To enable it, You should change the preference.

then you can count the words of your tex file now, use the menu Script –> Count the words in tex file.

## Bibliography Entry Types for .bib file

Bibliography Entry Types for .bib file

# Entry types

When entering a reference in the bibliography database, the first thing to decide is what type of entry it is. No fixed classification scheme can be complete, but BibTeX provides enough entry types to handle almost any reference reasonably well.

References to different types of publications contain different information; a reference to a journal might include the volume and number of the journal, which is usually not meaningful for a book. Therefore, database entries of different types have different fields for each entry type, the fields are divided into three classes:

Required
omitting the field will produce an error message and may result in a badly formatted bibliography entry. If the required information is not meaningful, you are using the wrong entry type.
Optional
the field’s information will be used if present, but can be omitted without causing any formatting problems. A reference should contain any available information that might help the reader, so you should include the optional field if it is applicable.
Ignored
the field is ignored. BibTeX ignores any field that is not required or optional, so you can include any fields you want in a bibliography entry. It’s often a good idea to put all relevant information about a reference in its bibliography entry – even information that may never appear in the bibliography. For example, if you want to keep an abstract of a paper in a computer file, put it in an ‘abstract’ field in the paper’s bibliography entry. The bibliography database file is likely to be as good a place as any for the abstract, and it is possible to design a bibliography style for printing selected abstracts.

BibTeX ignores the case of letters in the entry type.

# article entry

An article from a journal or magazine.

Format:

```     @ARTICLE{citation_key,
required_fields [, optional_fields] }
```

Optional fields: volume, number, pages, month, note, key

# book entry

A book with an explicit publisher.

Format:

```     @BOOK{citation_key,
required_fields [, optional_fields] }
```

Optional fields: volume, series, address, edition, month, note, key

# booklet entry

A work that is printed and bound, but without a named publisher or sponsoring institution.

Format:

```     @BOOKLET{citation_key,
required_fields [, optional_fields] }
```

Optional fields: author, howpublished, address, month, year, note, key

# conference entry

An article in the proceedings of a conference. This entry is identical to the ‘inproceedings’ entry and is included for compatibility with another text formatting system.

Format:

```     @CONFERENCE{citation_key,
required_fields [, optional_fields] }
```

Optional fields: editor, pages, organization, publisher, address, month, note, key

# inbook entry

A part of a book, which may be a chapter and/or a range of pages.

Format:

```     @INBOOK{citation_key,
required_fields [, optional_fields] }
```

Optional fields: volume, series, address, edition, month, note, key

# incollection entry

A part of a book with its own title.

Format:

```     @INCOLLECTION{citation_key,
required_fields [, optional_fields] }
```

Optional fields: editor, pages, organization, publisher, address, month, note, key

# inproceedings entry

An article in the proceedings of a conference.

Format:

```     @INPROCEEDINGS{citation_key,
required_fields [, optional_fields] }
```

Optional fields: editor, pages, organization, publisher, address, month, note, key

# manual entry

Technical documentation.

Format:

```     @MANUAL{citation_key,
required_fields [, optional_fields] }
```

Optional fields: author, organization, address, edition, month, year, note, key

# mastersthesis entry

A Master’s thesis.

Format:

```     @MASTERSTHESIS{citation_key,
required_fields [, optional_fields] }
```

Optional fields: address, month, note, key

# misc entry

Use this type when nothing else seems appropriate.

Format:

```     @MISC{citation_key,
required_fields [, optional_fields] }
```

Optional fields: author, title, howpublished, month, year, note, key

# phdthesis entry

A PhD thesis.

Format:

```     @PHDTHESIS{citation_key,
required_fields [, optional_fields] }
```

Optional fields: address, month, note, key

# proceedings entry

The proceedings of a conference.

Format:

```     @PROCEEDINGS{citation_key,
required_fields [, optional_fields] }
```

Optional fields: editor, publisher, organization, address, month, note, key

# techreport entry

A report published by a school or other institution, usually numbered within a series.

Format:

```     @TECHREPORT{citation_key,
required_fields [, optional_fields] }
```

Optional fields: type, number, address, month, note, key

# unpublished entry

A document with an author and title, but not formally published.

Format:

```     @UNPUBLISHED{citation_key,
required_fields [, optional_fields] }
```