Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BibTeX inspection for unused entry #1717

Merged
merged 7 commits into from
Jan 6, 2021
Merged

Conversation

slideclimb
Copy link
Collaborator

@slideclimb slideclimb commented Jan 5, 2021

Summary of additions and changes

  • Added an inspection to BibTeX to detect entries that are not referenced, along with a quick fix to remove the unused entry.
  • Removed the comma from the BibTeX id in the parser.

How to test this pull request

  • Don't forget to test the fix all quick fix.
\documentclass[11pt]{article}

\usepackage{biblatex}
\addbibresource{references.bib}

\begin{document}

    Test cite~\cite{goossens1993}.

\end{document}
@string{mytext = "This is a note."}

@Book{knuth1990,
    author    = {Knuth, Donald E.},
    title     = {The {\TeX}book },
    year      = {1990},
    isbn      = {0-201-13447-0},
    publisher = {Addison\,\textendash\,Wesley},
}

@Article{greenwade1993,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351",
    note    = mytext,
}

@Book{goossens1993,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

See tests.

Wiki

  • [] Updated the wiki:

@slideclimb slideclimb self-assigned this Jan 5, 2021
@slideclimb slideclimb changed the title Bib unused entry BibTeX inspection for unused entry Jan 5, 2021
Copy link
Member

@HannahSchellekens HannahSchellekens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Was a bit worried that this might not be suited for a warning, then I saw the LIKE_UNUSED_SYMBOL. Awesome :)

@PHPirates PHPirates added this to the b0.7.3 milestone Jan 6, 2021
@HannahSchellekens HannahSchellekens merged commit 66da4fd into master Jan 6, 2021
@HannahSchellekens HannahSchellekens deleted the bib-unused-entry branch January 6, 2021 12:07
@HannahSchellekens HannahSchellekens added the enhancement New feature or (non bug related) change to the program. label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants