Skill Tracer
Skills › Scientific Agent Skills › citation-management › citation_validation.md

citation_validation.md

832 lines · skills/citation-management/references/citation_validation.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Citation Validation Guide
2
3Comprehensive guide to validating citation accuracy, completeness, and formatting in BibTeX files.
4

Citation Validation Guide

Comprehensive guide to validating citation accuracy, completeness, and formatting in BibTeX files.

Raw lines 1 to 4
5## Overview
6
7Citation validation ensures:
8- All citations are accurate and complete
9- DOIs resolve correctly
10- Required fields are present
11- No duplicate entries
12- Proper formatting and syntax
13- Links are accessible
15Validation should be performed:
16- After extracting metadata
17- Before manuscript submission
18- After manual edits to BibTeX files
19- Periodically for maintained bibliographies

Overview

Citation validation ensures:

  • All citations are accurate and complete
  • DOIs resolve correctly
  • Required fields are present
  • No duplicate entries
  • Proper formatting and syntax
  • Links are accessible

Validation should be performed:

  • After extracting metadata
  • Before manuscript submission
  • After manual edits to BibTeX files
  • Periodically for maintained bibliographies
Raw lines 5 to 20
21## Validation Categories

Validation Categories

Raw lines 21 to 22
23### 1. DOI Verification
25**Purpose**: Ensure DOIs are valid and resolve correctly.
27#### What to Check
29**DOI format**:
30```
31Valid: 10.1038/s41586-021-03819-2
32Valid: 10.1126/science.aam9317
33Syntactically plausible but requires lookup: 10.1038/invalid
34Invalid: doi:10.1038/... (should omit "doi:" prefix in BibTeX)
35```
37**DOI resolution**:
38- DOI should resolve via https://doi.org/
39- Should redirect to actual article
40- Should not return 404 or error
42**Metadata consistency**:
43- CrossRef metadata should match BibTeX
44- Author names should align
45- Title should match
46- Year should match
48#### How to Validate
50**Manual check**:
511. Copy DOI from BibTeX
522. Visit https://doi.org/10.1038/nature12345
533. Verify it redirects to correct article
544. Check metadata matches
56**Automated check** (recommended):
57```bash
58python scripts/validate_citations.py references.bib --check-dois
59```
61**Process**:
621. Extract all DOIs from BibTeX file
632. Query Crossref `/works/{doi}`; on 404, query DataCite `/dois/{doi}`
643. If both lack a record, GET `doi.org/{doi}` without following the redirect
654. A registration record or resolver redirect confirms registration; resolver 404 is an error
665. Report timeouts, 429/5xx, and malformed responses as `doi_unverified` warnings
68The script does not compare bibliographic fields or test the publisher landing
69page. Review title/authors/year manually; a registered DOI can still identify
70the wrong work. Retraction status also requires a separate publisher check.
72#### Common Issues
74**Broken DOIs**:
75- Typos in DOI
76- Publisher changed DOI (rare)
77- A retracted article normally retains its DOI; check its publication status separately
78- Solution: Find correct DOI from publisher site
80**Mismatched metadata**:
81- BibTeX has old/incorrect information
82- Solution: Re-extract metadata from CrossRef
84**Missing DOIs**:
85- Older articles may not have DOIs
86- Acceptable for pre-2000 publications
87- Add URL or PMID instead

1. DOI Verification

Purpose: Ensure DOIs are valid and resolve correctly.

What to Check

DOI format:

Valid:   10.1038/s41586-021-03819-2
Valid:   10.1126/science.aam9317
Syntactically plausible but requires lookup: 10.1038/invalid
Invalid: doi:10.1038/... (should omit "doi:" prefix in BibTeX)

DOI resolution:

  • DOI should resolve via https://doi.org/
  • Should redirect to actual article
  • Should not return 404 or error

Metadata consistency:

  • CrossRef metadata should match BibTeX
  • Author names should align
  • Title should match
  • Year should match

How to Validate

Manual check:

  1. Copy DOI from BibTeX
  2. Visit https://doi.org/10.1038/nature12345
  3. Verify it redirects to correct article
  4. Check metadata matches

Automated check (recommended):

python scripts/validate_citations.py references.bib --check-dois

Process:

  1. Extract all DOIs from BibTeX file
  2. Query Crossref /works/{doi}; on 404, query DataCite /dois/{doi}
  3. If both lack a record, GET doi.org/{doi} without following the redirect
  4. A registration record or resolver redirect confirms registration; resolver 404 is an error
  5. Report timeouts, 429/5xx, and malformed responses as doi_unverified warnings

The script does not compare bibliographic fields or test the publisher landing page. Review title/authors/year manually; a registered DOI can still identify the wrong work. Retraction status also requires a separate publisher check.

Common Issues

Broken DOIs:

  • Typos in DOI
  • Publisher changed DOI (rare)
  • A retracted article normally retains its DOI; check its publication status separately
  • Solution: Find correct DOI from publisher site

Mismatched metadata:

  • BibTeX has old/incorrect information
  • Solution: Re-extract metadata from CrossRef

Missing DOIs:

  • Older articles may not have DOIs
  • Acceptable for pre-2000 publications
  • Add URL or PMID instead
Raw lines 23 to 88
Runs code python scripts/validate_citations.py :58
89### 2. Required Fields
91**Purpose**: Ensure all necessary information is present.
93#### Required by Entry Type
95**@article**:
96```bibtex
97author % REQUIRED
98title % REQUIRED
99journal % REQUIRED
100year % REQUIRED
101volume % Highly recommended
102pages % Highly recommended
103doi % Highly recommended for modern papers
104```
106**@book**:
107```bibtex
108author OR editor % REQUIRED (at least one)
109title % REQUIRED
110publisher % REQUIRED
111year % REQUIRED
112isbn % Recommended
113```
115**@inproceedings**:
116```bibtex
117author % REQUIRED
118title % REQUIRED
119booktitle % REQUIRED (conference/proceedings name)
120year % REQUIRED
121pages % Recommended
122```
124**@incollection** (book chapter):
125```bibtex
126author % REQUIRED
127title % REQUIRED (chapter title)
128booktitle % REQUIRED (book title)
129publisher % REQUIRED
130year % REQUIRED
131editor % Recommended
132pages % Recommended
133```
135**@phdthesis**:
136```bibtex
137author % REQUIRED
138title % REQUIRED
139school % REQUIRED
140year % REQUIRED
141```
143**@misc** (preprints, datasets, etc.):
144```bibtex
145author % REQUIRED
146title % REQUIRED
147year % REQUIRED
148howpublished % Recommended (bioRxiv, Zenodo, etc.)
149doi OR url % At least one required
150```
152#### Validation Script
154```bash
155python scripts/validate_citations.py references.bib
156```
158**Output**:
159```
160Error: Entry 'Smith2024' missing required field 'journal'
161Error: Entry 'Doe2023' missing required field 'year'
162Warning: Entry 'Jones2022' missing recommended field 'volume'
163```

2. Required Fields

Purpose: Ensure all necessary information is present.

Required by Entry Type

@article:

author   % REQUIRED
title    % REQUIRED
journal  % REQUIRED
year     % REQUIRED
volume   % Highly recommended
pages    % Highly recommended
doi      % Highly recommended for modern papers

@book:

author OR editor  % REQUIRED (at least one)
title            % REQUIRED
publisher        % REQUIRED
year             % REQUIRED
isbn             % Recommended

@inproceedings:

author     % REQUIRED
title      % REQUIRED
booktitle  % REQUIRED (conference/proceedings name)
year       % REQUIRED
pages      % Recommended

@incollection (book chapter):

author     % REQUIRED
title      % REQUIRED (chapter title)
booktitle  % REQUIRED (book title)
publisher  % REQUIRED
year       % REQUIRED
editor     % Recommended
pages      % Recommended

@phdthesis:

author  % REQUIRED
title   % REQUIRED
school  % REQUIRED
year    % REQUIRED

@misc (preprints, datasets, etc.):

author  % REQUIRED
title   % REQUIRED
year    % REQUIRED
howpublished  % Recommended (bioRxiv, Zenodo, etc.)
doi OR url    % At least one required

Validation Script

python scripts/validate_citations.py references.bib

Output:

Error: Entry 'Smith2024' missing required field 'journal'
Error: Entry 'Doe2023' missing required field 'year'
Warning: Entry 'Jones2022' missing recommended field 'volume'
Raw lines 89 to 164
Runs code python scripts/validate_citations.py :155
165### 3. Author Name Formatting
167**Purpose**: Ensure consistent, correct author name formatting.
169#### Proper Format
171**Recommended BibTeX format**:
172```bibtex
173author = {Last1, First1 and Last2, First2 and Last3, First3}
174```
176**Examples**:
177```bibtex
178% Correct
179author = {Smith, John}
180author = {Smith, John A.}
181author = {Smith, John Andrew}
182author = {Smith, John and Doe, Jane}
183author = {Smith, John and Doe, Jane and Johnson, Mary}
185% For many authors
186author = {Smith, John and Doe, Jane and others}
188% Incorrect
189author = {John Smith} % First Last format (not recommended)
190author = {Smith, J.; Doe, J.} % Semicolon separator (wrong)
191author = {Smith J, Doe J} % Missing commas
192```
194#### Special Cases
196**Suffixes (Jr., III, etc.)**:
197```bibtex
198author = {King, Jr., Martin Luther}
199```
201**Multiple surnames (hyphenated)**:
202```bibtex
203author = {Smith-Jones, Mary}
204```
206**Van, von, de, etc.**:
207```bibtex
208author = {van der Waals, Johannes}
209author = {de Broglie, Louis}
210```
212**Organizations as authors**:
213```bibtex
214author = {{World Health Organization}}
215% Double braces treat as single author
216```
218#### Validation Checks
220**Automated validation**:
221```bash
222python scripts/validate_citations.py references.bib
223```
225**Checks for**:
226- Proper separator (and, not &, ; , etc.)
227- Comma placement
228- Empty author fields
229- Malformed names

3. Author Name Formatting

Purpose: Ensure consistent, correct author name formatting.

Proper Format

Recommended BibTeX format:

author = {Last1, First1 and Last2, First2 and Last3, First3}

Examples:

% Correct
author = {Smith, John}
author = {Smith, John A.}
author = {Smith, John Andrew}
author = {Smith, John and Doe, Jane}
author = {Smith, John and Doe, Jane and Johnson, Mary}

% For many authors
author = {Smith, John and Doe, Jane and others}

% Incorrect
author = {John Smith}  % First Last format (not recommended)
author = {Smith, J.; Doe, J.}  % Semicolon separator (wrong)
author = {Smith J, Doe J}  % Missing commas

Special Cases

Suffixes (Jr., III, etc.):

author = {King, Jr., Martin Luther}

Multiple surnames (hyphenated):

author = {Smith-Jones, Mary}

Van, von, de, etc.:

author = {van der Waals, Johannes}
author = {de Broglie, Louis}

Organizations as authors:

author = {{World Health Organization}}
% Double braces treat as single author

Validation Checks

Automated validation:

python scripts/validate_citations.py references.bib

Checks for:

  • Proper separator (and, not &, ; , etc.)
  • Comma placement
  • Empty author fields
  • Malformed names
Raw lines 165 to 230
Runs code python scripts/validate_citations.py :222
231### 4. Data Consistency
233**Purpose**: Ensure all fields contain valid, reasonable values.
235#### Year Validation
237**Valid years**:
238```bibtex
239year = {2024} % Current/recent
240year = {1953} % Watson & Crick DNA structure (historical)
241year = {1665} % Hooke's Micrographia (very old)
242```
244**Invalid years**:
245```bibtex
246year = {24} % Two digits (ambiguous)
247year = {202} % Typo
248year = {3025} % Implausible future year
249year = {0} % Obviously wrong
250```
252**Check**:
253- Four digits
254- Reasonable range (1600-current+1)
255- Not all zeros
257#### Volume/Number Validation
259```bibtex
260volume = {123} % Numeric
261volume = {12} % Valid
262number = {3} % Valid
263number = {S1} % Supplement issue (valid)
264```
266**Invalid**:
267```bibtex
268volume = {Vol. 123} % Should be just number
269number = {Issue 3} % Should be just number
270```
272#### Page Range Validation
274**Correct format**:
275```bibtex
276pages = {123--145} % En-dash (two hyphens)
277pages = {e0123456} % PLOS-style article ID
278pages = {123} % Single page
279```
281**Incorrect format**:
282```bibtex
283pages = {123-145} % Single hyphen (use --)
284pages = {pp. 123-145} % Remove "pp."
285pages = {123–145} % Unicode en-dash (may cause issues)
286```
288#### URL Validation
290**Check**:
291- URLs are accessible (return 200 status)
292- HTTPS when available
293- No obvious typos
294- Permanent links (not temporary)
296**Valid**:
297```bibtex
298url = {https://www.nature.com/articles/nature12345}
299url = {https://arxiv.org/abs/2103.14030}
300```
302**Questionable**:
303```bibtex
304url = {http://...} % HTTP instead of HTTPS
305url = {file:///...} % Local file path
306url = {bit.ly/...} % URL shortener (not permanent)
307```

4. Data Consistency

Purpose: Ensure all fields contain valid, reasonable values.

Year Validation

Valid years:

year = {2024}    % Current/recent
year = {1953}    % Watson & Crick DNA structure (historical)
year = {1665}    % Hooke's Micrographia (very old)

Invalid years:

year = {24}      % Two digits (ambiguous)
year = {202}     % Typo
year = {3025}    % Implausible future year
year = {0}       % Obviously wrong

Check:

  • Four digits
  • Reasonable range (1600-current+1)
  • Not all zeros

Volume/Number Validation

volume = {123}      % Numeric
volume = {12}       % Valid
number = {3}        % Valid
number = {S1}       % Supplement issue (valid)

Invalid:

volume = {Vol. 123}  % Should be just number
number = {Issue 3}   % Should be just number

Page Range Validation

Correct format:

pages = {123--145}    % En-dash (two hyphens)
pages = {e0123456}    % PLOS-style article ID
pages = {123}         % Single page

Incorrect format:

pages = {123-145}     % Single hyphen (use --)
pages = {pp. 123-145} % Remove "pp."
pages = {123–145}     % Unicode en-dash (may cause issues)

URL Validation

Check:

  • URLs are accessible (return 200 status)
  • HTTPS when available
  • No obvious typos
  • Permanent links (not temporary)

Valid:

url = {https://www.nature.com/articles/nature12345}
url = {https://arxiv.org/abs/2103.14030}

Questionable:

url = {http://...}  % HTTP instead of HTTPS
url = {file:///...} % Local file path
url = {bit.ly/...}  % URL shortener (not permanent)
Raw lines 231 to 308
309### 5. Duplicate Detection
311**Purpose**: Find and remove duplicate entries.
313#### Types of Duplicates
315**Exact duplicates** (same DOI):
316```bibtex
317@article{Smith2024a,
318 doi = {10.1038/nature12345},
319 ...
322@article{Smith2024b,
323 doi = {10.1038/nature12345}, % Same DOI!
324 ...
326```
328**Near duplicates** (similar title/authors):
329```bibtex
330@article{Smith2024,
331 title = {Machine Learning for Drug Discovery},
332 ...
335@article{Smith2024method,
336 title = {Machine learning for drug discovery}, % Same, different case
337 ...
339```
341**Preprint + Published**:
342```bibtex
343@misc{Smith2023arxiv,
344 title = {AlphaFold Results},
345 howpublished = {arXiv},
346 ...
349@article{Smith2024,
350 title = {AlphaFold Results}, % Same paper, now published
351 journal = {Nature},
352 ...
354% Keep published version only
355```
357#### Detection Methods
359**By DOI** (most reliable):
360- Same DOI = exact duplicate
361- Keep one, remove other
363**By title similarity**:
364- Normalize: lowercase, remove punctuation
365- Calculate similarity (e.g., Levenshtein distance)
366- Flag if >90% similar
368**By author-year-title**:
369- Same first author + year + similar title
370- Likely duplicate
372**Automated detection**:
373```bash
374python scripts/validate_citations.py references.bib
375```
377**Output**:
378```
379Warning: Possible duplicate entries:
380 - Smith2024a (DOI: 10.1038/nature12345)
381 - Smith2024b (DOI: 10.1038/nature12345)
382 Recommendation: Keep one entry, remove the other.
383```

5. Duplicate Detection

Purpose: Find and remove duplicate entries.

Types of Duplicates

Exact duplicates (same DOI):

@article{Smith2024a,
  doi = {10.1038/nature12345},
  ...
}

@article{Smith2024b,
  doi = {10.1038/nature12345},  % Same DOI!
  ...
}

Near duplicates (similar title/authors):

@article{Smith2024,
  title = {Machine Learning for Drug Discovery},
  ...
}

@article{Smith2024method,
  title = {Machine learning for drug discovery},  % Same, different case
  ...
}

Preprint + Published:

@misc{Smith2023arxiv,
  title = {AlphaFold Results},
  howpublished = {arXiv},
  ...
}

@article{Smith2024,
  title = {AlphaFold Results},  % Same paper, now published
  journal = {Nature},
  ...
}
% Keep published version only

Detection Methods

By DOI (most reliable):

  • Same DOI = exact duplicate
  • Keep one, remove other

By title similarity:

  • Normalize: lowercase, remove punctuation
  • Calculate similarity (e.g., Levenshtein distance)
  • Flag if >90% similar

By author-year-title:

  • Same first author + year + similar title
  • Likely duplicate

Automated detection:

python scripts/validate_citations.py references.bib

Output:

Warning: Possible duplicate entries:
  - Smith2024a (DOI: 10.1038/nature12345)
  - Smith2024b (DOI: 10.1038/nature12345)
  Recommendation: Keep one entry, remove the other.
Raw lines 309 to 384
Runs code python scripts/validate_citations.py :374
385### 6. Format and Syntax
387**Purpose**: Ensure valid BibTeX syntax.
389#### Common Syntax Errors
391**Missing commas**:
392```bibtex
393@article{Smith2024,
394 author = {Smith, John} % Missing comma!
395 title = {Title}
397% Should be:
398 author = {Smith, John}, % Comma after each field
399```
401**Unbalanced braces**:
402```bibtex
403title = {Title with {Protected} Text % Missing closing brace
404% Should be:
405title = {Title with {Protected} Text}
406```
408**Missing closing brace for entry**:
409```bibtex
410@article{Smith2024,
411 author = {Smith, John},
412 title = {Title}
413 % Missing closing brace!
414% Should end with:
416```
418**Invalid characters in keys**:
419```bibtex
420@article{Smith&Doe2024, % & not allowed in key
421 ...
423% Use:
424@article{SmithDoe2024,
425 ...
427```
429#### BibTeX Syntax Rules
431**Entry structure**:
432```bibtex
433@TYPE{citationkey,
434 field1 = {value1},
435 field2 = {value2},
436 ...
437 fieldN = {valueN}
439```
441**Citation keys**:
442- Alphanumeric and some punctuation (-, _, ., :)
443- No spaces
444- Case-sensitive
445- Unique within file
447**Field values**:
448- Enclosed in {braces} or "quotes"
449- Braces preferred for complex text
450- Numbers can be unquoted: `year = 2024`
452**Special characters**:
453- `{` and `}` for grouping
454- `\` for LaTeX commands
455- Protect capitalization: `{AlphaFold}`
456- Accents: `{\"u}`, `{\'e}`, `{\aa}`
458#### Validation
460```bash
461python scripts/validate_citations.py references.bib
462```
464The bundled parser checks entries it can parse and duplicate keys; it is not
465a complete BibTeX syntax validator. Malformed entries may be skipped, and
466`@string` macros are not expanded. Compare input/output counts and compile the
467bibliography with the actual BibTeX/Biber toolchain before submission.

6. Format and Syntax

Purpose: Ensure valid BibTeX syntax.

Common Syntax Errors

Missing commas:

@article{Smith2024,
  author = {Smith, John}   % Missing comma!
  title = {Title}
}
% Should be:
  author = {Smith, John},  % Comma after each field

Unbalanced braces:

title = {Title with {Protected} Text  % Missing closing brace
% Should be:
title = {Title with {Protected} Text}

Missing closing brace for entry:

@article{Smith2024,
  author = {Smith, John},
  title = {Title}
  % Missing closing brace!
% Should end with:
}

Invalid characters in keys:

@article{Smith&Doe2024,  % & not allowed in key
  ...
}
% Use:
@article{SmithDoe2024,
  ...
}

BibTeX Syntax Rules

Entry structure:

@TYPE{citationkey,
  field1 = {value1},
  field2 = {value2},
  ...
  fieldN = {valueN}
}

Citation keys:

  • Alphanumeric and some punctuation (-, _, ., :)
  • No spaces
  • Case-sensitive
  • Unique within file

Field values:

  • Enclosed in {braces} or "quotes"
  • Braces preferred for complex text
  • Numbers can be unquoted: year = 2024

Special characters:

  • { and } for grouping
  • \ for LaTeX commands
  • Protect capitalization: {AlphaFold}
  • Accents: {\"u}, {\'e}, {\aa}

Validation

python scripts/validate_citations.py references.bib

The bundled parser checks entries it can parse and duplicate keys; it is not a complete BibTeX syntax validator. Malformed entries may be skipped, and @string macros are not expanded. Compare input/output counts and compile the bibliography with the actual BibTeX/Biber toolchain before submission.

Raw lines 385 to 468
Runs code python scripts/validate_citations.py :461
469## Validation Workflow

Validation Workflow

Raw lines 469 to 470
471### Step 1: Basic Validation
473Run comprehensive validation:
475```bash
476python scripts/validate_citations.py references.bib
477```
479**Checks**:
480- DOI registration only when `--check-dois` is requested
481- Required fields
482- Author formatting
483- Data consistency
484- Duplicates
485- Syntax

Step 1: Basic Validation

Run comprehensive validation:

python scripts/validate_citations.py references.bib

Checks:

  • DOI registration only when --check-dois is requested
  • Required fields
  • Author formatting
  • Data consistency
  • Duplicates
  • Syntax
Raw lines 471 to 486
Runs code python scripts/validate_citations.py :476
487### Step 2: Review Report
489Examine validation report:
491```json
493 "total_entries": 150,
494 "valid_entries": 140,
495 "errors": [
496 {
497 "entry": "Smith2024",
498 "error": "missing_required_field",
499 "field": "journal",
500 "severity": "high"
501 },
502 {
503 "entry": "Doe2023",
504 "error": "invalid_doi",
505 "doi": "10.1038/broken",
506 "severity": "high"
507 }
508 ],
509 "warnings": [
510 {
511 "entry": "Jones2022",
512 "warning": "missing_recommended_field",
513 "field": "volume",
514 "severity": "medium"
515 }
516 ],
517 "duplicates": [
518 {
519 "entries": ["Smith2024a", "Smith2024b"],
520 "reason": "same_doi",
521 "doi": "10.1038/nature12345"
522 }
523 ]
525```

Step 2: Review Report

Examine validation report:

{
  "total_entries": 150,
  "valid_entries": 140,
  "errors": [
    {
      "entry": "Smith2024",
      "error": "missing_required_field",
      "field": "journal",
      "severity": "high"
    },
    {
      "entry": "Doe2023",
      "error": "invalid_doi",
      "doi": "10.1038/broken",
      "severity": "high"
    }
  ],
  "warnings": [
    {
      "entry": "Jones2022",
      "warning": "missing_recommended_field",
      "field": "volume",
      "severity": "medium"
    }
  ],
  "duplicates": [
    {
      "entries": ["Smith2024a", "Smith2024b"],
      "reason": "same_doi",
      "doi": "10.1038/nature12345"
    }
  ]
}
Raw lines 487 to 526
527### Step 3: Fix Issues
529**High-priority** (errors):
5301. Add missing required fields
5312. Fix broken DOIs
5323. Remove duplicates
5334. Correct syntax errors
535**Medium-priority** (warnings):
5361. Add recommended fields
5372. Improve author formatting
5383. Fix page ranges
540**Low-priority**:
5411. Standardize formatting
5422. Add URLs for accessibility

Step 3: Fix Issues

High-priority (errors):

  1. Add missing required fields
  2. Fix broken DOIs
  3. Remove duplicates
  4. Correct syntax errors

Medium-priority (warnings):

  1. Add recommended fields
  2. Improve author formatting
  3. Fix page ranges

Low-priority:

  1. Standardize formatting
  2. Add URLs for accessibility
Raw lines 527 to 543
544### Step 4: Apply the safe corrections
546`validate_citations.py` only reports; `format_bibtex.py` is what rewrites.
547Send the result to a new file so the original survives a bad run:
549```bash
550python scripts/format_bibtex.py references.bib \
551 --output fixed_references.bib
552```
554**It can**:
555- Fix page range format (- to --), and expand abbreviated ranges (1123-30)
556- Remove "pp." from pages
557- Standardize author separators
558- Strip URL prefixes from DOIs
559- Normalize field order
560- Rewrite citation keys to one scheme (`--rekey`)
561- Drop duplicates by DOI or key (`--deduplicate`)
563**It cannot**:
564- Add missing information
565- Find correct DOIs
566- Determine which duplicate to keep — it keeps the first
567- Fix semantic errors

Step 4: Apply the safe corrections

validate_citations.py only reports; format_bibtex.py is what rewrites. Send the result to a new file so the original survives a bad run:

python scripts/format_bibtex.py references.bib \
  --output fixed_references.bib

It can:

  • Fix page range format (- to --), and expand abbreviated ranges (1123-30)
  • Remove "pp." from pages
  • Standardize author separators
  • Strip URL prefixes from DOIs
  • Normalize field order
  • Rewrite citation keys to one scheme (--rekey)
  • Drop duplicates by DOI or key (--deduplicate)

It cannot:

  • Add missing information
  • Find correct DOIs
  • Determine which duplicate to keep — it keeps the first
  • Fix semantic errors
Raw lines 544 to 568
Runs code python scripts/format_bibtex.py :550
569### Step 5: Manual Review
571Review auto-fixed file:
572```bash
573# Check what changed
574diff references.bib fixed_references.bib
576# Review specific entries that had errors
577grep -A 10 "Smith2024" fixed_references.bib
578```

Step 5: Manual Review

Review auto-fixed file:

# Check what changed
diff references.bib fixed_references.bib

# Review specific entries that had errors
grep -A 10 "Smith2024" fixed_references.bib
Raw lines 569 to 579
580### Step 6: Re-Validate
582Validate after fixes:
584```bash
585python scripts/validate_citations.py fixed_references.bib --verbose
586```
588Inspect `errors`, `warnings`, and `duplicates` in the JSON report. Zero high-severity
589errors does not mean every DOI was verified: review any `doi_unverified` warnings
590and compile the bibliography separately.

Step 6: Re-Validate

Validate after fixes:

python scripts/validate_citations.py fixed_references.bib --verbose

Inspect errors, warnings, and duplicates in the JSON report. Zero high-severity errors does not mean every DOI was verified: review any doi_unverified warnings and compile the bibliography separately.

Raw lines 580 to 591
Runs code python scripts/validate_citations.py :585
592## Validation Checklist
594Use this checklist before final submission:

Validation Checklist

Use this checklist before final submission:

Raw lines 592 to 595
596### DOI Validation
597- [ ] All DOIs resolve correctly
598- [ ] Metadata matches between BibTeX and CrossRef
599- [ ] No broken or invalid DOIs

DOI Validation

  • [ ] All DOIs resolve correctly
  • [ ] Metadata matches between BibTeX and CrossRef
  • [ ] No broken or invalid DOIs
Raw lines 596 to 600
601### Completeness
602- [ ] All entries have required fields
603- [ ] DOIs are included when assigned; absence is verified, not inferred from year
604- [ ] Authors properly formatted
605- [ ] Journals/conferences properly named

Completeness

  • [ ] All entries have required fields
  • [ ] DOIs are included when assigned; absence is verified, not inferred from year
  • [ ] Authors properly formatted
  • [ ] Journals/conferences properly named
Raw lines 601 to 606
607### Consistency
608- [ ] Years are 4-digit numbers
609- [ ] Page ranges use -- not -
610- [ ] Volume/number are numeric
611- [ ] URLs are accessible

Consistency

  • [ ] Years are 4-digit numbers
  • [ ] Page ranges use -- not -
  • [ ] Volume/number are numeric
  • [ ] URLs are accessible
Raw lines 607 to 612
613### Duplicates
614- [ ] No entries with same DOI
615- [ ] No near-duplicate titles
616- [ ] Preprints updated to published versions

Duplicates

  • [ ] No entries with same DOI
  • [ ] No near-duplicate titles
  • [ ] Preprints updated to published versions
Raw lines 613 to 617
618### Formatting
619- [ ] Valid BibTeX syntax
620- [ ] Balanced braces
621- [ ] Proper commas
622- [ ] Unique citation keys

Formatting

  • [ ] Valid BibTeX syntax
  • [ ] Balanced braces
  • [ ] Proper commas
  • [ ] Unique citation keys
Raw lines 618 to 623
624### Final Checks
625- [ ] Bibliography compiles without errors
626- [ ] All citations in text appear in bibliography
627- [ ] All bibliography entries cited in text
628- [ ] Citation style matches journal requirements

Final Checks

  • [ ] Bibliography compiles without errors
  • [ ] All citations in text appear in bibliography
  • [ ] All bibliography entries cited in text
  • [ ] Citation style matches journal requirements
Raw lines 624 to 629
630## Best Practices

Best Practices

Raw lines 630 to 631
632### 1. Validate Early and Often
634```bash
635# After extraction
636python scripts/extract_metadata.py --doi ... --output refs.bib
637python scripts/validate_citations.py refs.bib
639# After manual edits
640python scripts/validate_citations.py refs.bib
642# Before submission
643python scripts/validate_citations.py refs.bib --check-dois
644```

1. Validate Early and Often

# After extraction
python scripts/extract_metadata.py --doi ... --output refs.bib
python scripts/validate_citations.py refs.bib

# After manual edits
python scripts/validate_citations.py refs.bib

# Before submission
python scripts/validate_citations.py refs.bib --check-dois
Raw lines 632 to 645
Runs code python scripts/extract_metadata.py :636
Runs code python scripts/validate_citations.py :637
646### 2. Use Automated Tools
648Don't validate manually - use scripts:
649- Faster
650- More comprehensive
651- Catches errors humans miss
652- Generates reports

2. Use Automated Tools

Don't validate manually - use scripts:

  • Faster
  • More comprehensive
  • Catches errors humans miss
  • Generates reports
Raw lines 646 to 653
654### 3. Write to a new file and diff before replacing
656`format_bibtex.py` writes only where you tell it to: with neither `--output`
657nor `--in-place` it prints to stdout and leaves the input alone.
659```bash
660# Reformat into a separate file
661python scripts/format_bibtex.py references.bib \
662 --output references_fixed.bib
664# Review changes
665diff references.bib references_fixed.bib
667# If satisfied, replace
668mv references_fixed.bib references.bib
669```

3. Write to a new file and diff before replacing

format_bibtex.py writes only where you tell it to: with neither --output nor --in-place it prints to stdout and leaves the input alone.

# Reformat into a separate file
python scripts/format_bibtex.py references.bib \
  --output references_fixed.bib

# Review changes
diff references.bib references_fixed.bib

# If satisfied, replace
mv references_fixed.bib references.bib
Raw lines 654 to 670
Runs code python scripts/format_bibtex.py :661
671### 4. Fix High-Priority First
673**Priority order**:
6741. Syntax errors (prevent compilation)
6752. Missing required fields (incomplete citations)
6763. Broken DOIs (broken links)
6774. Duplicates (confusion, wasted space)
6785. Missing recommended fields
6796. Formatting inconsistencies

4. Fix High-Priority First

Priority order:

  1. Syntax errors (prevent compilation)
  2. Missing required fields (incomplete citations)
  3. Broken DOIs (broken links)
  4. Duplicates (confusion, wasted space)
  5. Missing recommended fields
  6. Formatting inconsistencies
Raw lines 671 to 680
681### 5. Document Exceptions
683For entries that can't be fixed:
685```bibtex
686@article{Old1950,
687 author = {Smith, John},
688 title = {Title},
689 journal = {Obscure Journal},
690 year = {1950},
691 volume = {12},
692 pages = {34--56},
693 note = {No DOI found in the checked publisher record}
695```

5. Document Exceptions

For entries that can't be fixed:

@article{Old1950,
  author = {Smith, John},
  title = {Title},
  journal = {Obscure Journal},
  year = {1950},
  volume = {12},
  pages = {34--56},
  note = {No DOI found in the checked publisher record}
}
Raw lines 681 to 696
697### 6. Validate Against Journal Requirements
699Different journals have different requirements:
700- Citation style (numbered, author-year)
701- Abbreviations (journal names)
702- Maximum reference count
703- Format (BibTeX, EndNote, manual)
705Check journal author guidelines!

6. Validate Against Journal Requirements

Different journals have different requirements:

  • Citation style (numbered, author-year)
  • Abbreviations (journal names)
  • Maximum reference count
  • Format (BibTeX, EndNote, manual)

Check journal author guidelines!

Raw lines 697 to 706
707## Common Validation Issues

Common Validation Issues

Raw lines 707 to 708
709### Issue 1: Metadata Mismatch
711**Problem**: BibTeX says 2023, CrossRef says 2024.
713**Cause**:
714- Online-first vs print publication
715- Correction/update
716- Extraction error
718**Solution**:
7191. Check actual article
7202. Use more recent/accurate date
7213. Update BibTeX entry
7224. Re-validate

Issue 1: Metadata Mismatch

Problem: BibTeX says 2023, CrossRef says 2024.

Cause:

  • Online-first vs print publication
  • Correction/update
  • Extraction error

Solution:

  1. Check actual article
  2. Use more recent/accurate date
  3. Update BibTeX entry
  4. Re-validate
Raw lines 709 to 723
724### Issue 2: Special Characters
726**Problem**: LaTeX compilation fails on special characters.
728**Cause**:
729- Accented characters (é, ü, ñ)
730- Chemical formulas (H₂O)
731- Math symbols (α, β, ±)
733**Solution**:
734```bibtex
735% Use LaTeX commands
736author = {M{\"u}ller, Hans} % Müller
737title = {Study of H\textsubscript{2}O} % H₂O
738% Or use UTF-8 with proper LaTeX packages
739```

Issue 2: Special Characters

Problem: LaTeX compilation fails on special characters.

Cause:

  • Accented characters (é, ü, ñ)
  • Chemical formulas (H₂O)
  • Math symbols (α, β, ±)

Solution:

% Use LaTeX commands
author = {M{\"u}ller, Hans}  % Müller
title = {Study of H\textsubscript{2}O}  % H₂O
% Or use UTF-8 with proper LaTeX packages
Raw lines 724 to 740
741### Issue 3: Incomplete Extraction (REQUIRES WEB SEARCH)
743**Problem**: Extracted metadata missing fields (volume, pages, DOI, issue number).
745**Cause**:
746- Source API doesn't provide all metadata
747- Extraction error
748- Incomplete database record
749- Online-first publication without final pagination
751**Solution — MANDATORY web search to fill gaps**:
7531. **Identify the missing fields** by scanning the BibTeX entry for empty or absent `volume`, `pages`, `number`, `doi` fields.
7552. **Search for the missing metadata using web search** (parallel-web skill):
756 ```bash
757 # Search by author + title to find complete citation info
758 parallel-cli search "AUTHOR_NAME PAPER_TITLE JOURNAL volume pages DOI" \
759 --json --max-results 10 \
760 -o sources/search_citation_CITATIONKEY.json
761 ```
7633. **If DOI is known, extract from DOI resolver page**:
764 ```bash
765 parallel-cli extract "https://doi.org/DOI_HERE" --json \
766 --objective "extract volume, issue number, page range, publication date" \
767 -o sources/extract_doi_CITATIONKEY.json
768 ```
7704. **If DOI is unknown, search for it**:
771 ```bash
772 parallel-cli search "AUTHOR_NAME PAPER_TITLE JOURNAL_NAME DOI" \
773 --json --max-results 10 \
774 -o sources/search_find_doi_CITATIONKEY.json
775 ```
7775. **Try alternative metadata sources**:
778 - CrossRef API (via DOI): Most reliable for volume/pages
779 - PubMed (via PMID): Good for biomedical papers
780 - Google Scholar: Fallback for hard-to-find papers
781 - Publisher website: Last resort
7836. **Update the BibTeX entry** with the found metadata and log:
784 ```
785 [HH:MM:SS] METADATA ENRICHED: [CitationKey] - added volume, pages, doi ✅
786 ```
7887. **If truly unfindable** (rare), add a note field:
789 ```bibtex
790 note = {Complete pagination not yet assigned — online-first publication}
791 ```
793Verify applicable fields against the publisher record. Online-first volume/pages, DOI-less articles, and article-number journals are valid cases; log the reason for absence and use the style-appropriate locator without fabricating metadata.

Issue 3: Incomplete Extraction (REQUIRES WEB SEARCH)

Problem: Extracted metadata missing fields (volume, pages, DOI, issue number).

Cause:

  • Source API doesn't provide all metadata
  • Extraction error
  • Incomplete database record
  • Online-first publication without final pagination

Solution — MANDATORY web search to fill gaps:

  1. Identify the missing fields by scanning the BibTeX entry for empty or absent volume, pages, number, doi fields.
  1. Search for the missing metadata using web search (parallel-web skill): ``bash # Search by author + title to find complete citation info parallel-cli search "AUTHOR_NAME PAPER_TITLE JOURNAL volume pages DOI" \ --json --max-results 10 \ -o sources/search_citation_CITATIONKEY.json
  1. If DOI is known, extract from DOI resolver page: ``bash parallel-cli extract "https://doi.org/DOI_HERE" --json \ --objective "extract volume, issue number, page range, publication date" \ -o sources/extract_doi_CITATIONKEY.json
  1. If DOI is unknown, search for it: ``bash parallel-cli search "AUTHOR_NAME PAPER_TITLE JOURNAL_NAME DOI" \ --json --max-results 10 \ -o sources/search_find_doi_CITATIONKEY.json
  1. Try alternative metadata sources:
  2. CrossRef API (via DOI): Most reliable for volume/pages
  3. PubMed (via PMID): Good for biomedical papers
  4. Google Scholar: Fallback for hard-to-find papers
  5. Publisher website: Last resort
  1. Update the BibTeX entry with the found metadata and log: `` [HH:MM:SS] METADATA ENRICHED: [CitationKey] - added volume, pages, doi ✅
  1. If truly unfindable (rare), add a note field: ``bibtex note = {Complete pagination not yet assigned — online-first publication}

Verify applicable fields against the publisher record. Online-first volume/pages, DOI-less articles, and article-number journals are valid cases; log the reason for absence and use the style-appropriate locator without fabricating metadata.

Raw lines 741 to 794
Names a skill parallel-web :755
795### Issue 4: Cannot Find Duplicate
797**Problem**: Same paper appears twice, not detected.
799**Cause**:
800- Different DOIs (should be rare)
801- Different titles (abbreviated, typo)
802- Different citation keys
804**Solution**:
805- Manual search for author + year
806- Check for similar titles
807- Remove manually

Issue 4: Cannot Find Duplicate

Problem: Same paper appears twice, not detected.

Cause:

  • Different DOIs (should be rare)
  • Different titles (abbreviated, typo)
  • Different citation keys

Solution:

  • Manual search for author + year
  • Check for similar titles
  • Remove manually
Raw lines 795 to 808
809## Summary
811Validation ensures citation quality:
813✓ **Accuracy**: DOIs resolve, metadata correct
814✓ **Completeness**: All required fields present
815✓ **Consistency**: Proper formatting throughout
816✓ **No duplicates**: Each paper cited once
817✓ **Valid syntax**: BibTeX compiles without errors
819**Always validate** before final submission!
821Use automated tools:
822```bash
823python scripts/validate_citations.py references.bib
824```
826Follow workflow:
8271. Extract metadata
8282. Validate
8293. Fix errors
8304. Re-validate
8315. Submit

Summary

Validation ensures citation quality:

✓ Accuracy: DOIs resolve, metadata correct ✓ Completeness: All required fields present ✓ Consistency: Proper formatting throughout ✓ No duplicates: Each paper cited once ✓ Valid syntax: BibTeX compiles without errors

Always validate before final submission!

Use automated tools:

python scripts/validate_citations.py references.bib

Follow workflow:

  1. Extract metadata
  2. Validate
  3. Fix errors
  4. Re-validate
  5. Submit
Raw lines 809 to 832
Runs code python scripts/validate_citations.py :823