├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── checks.yml │ ├── codeql-analysis.yml │ └── commit-build-changes.yml ├── .gitignore ├── .pre-commit-hooks.yaml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── bibtex-tidy.0 ├── bibtex-tidy.d.ts ├── bibtex-tidy.js ├── bin └── bibtex-tidy ├── biome.json ├── build.ts ├── docker └── docker-compose.yml ├── docs ├── IBMPlexSans-Light-SATUMA4V.woff2 ├── IBMPlexSans-Medium-ILA6RNXQ.woff2 ├── Inconsolata-Regular-CEGDCP7X.woff2 ├── bundle.css ├── bundle.js ├── favicon.png ├── index.html └── manual │ └── key-generation.html ├── package-lock.json ├── package.json ├── scripts ├── cover.sh ├── prepare-release.sh └── validate-test-files.sh ├── src ├── ASTProxy.ts ├── __generated__ │ ├── manPage.ts │ ├── optionsType.ts │ └── version.ts ├── cli │ ├── argsToOptions.spec.ts │ ├── argsToOptions.ts │ └── cli.ts ├── debug.ts ├── duplicates.spec.ts ├── duplicates.ts ├── format.ts ├── generateKeys.spec.ts ├── generateKeys.ts ├── index.ts ├── optionDefinitions.ts ├── optionUtils.ts ├── optionsToCLIArgs.ts ├── parsers │ ├── argsParser.spec.ts │ ├── argsParser.ts │ ├── bibtexParser.spec.ts │ ├── bibtexParser.ts │ ├── entryKeyTemplateParser.spec.ts │ ├── entryKeyTemplateParser.ts │ ├── latexParser.spec.ts │ ├── latexParser.ts │ ├── nameFieldParser.spec.ts │ └── nameFieldParser.ts ├── pipeline.ts ├── tidy.ts ├── transforms │ ├── abbreviateMonths.ts │ ├── alignValues.ts │ ├── blankLines.ts │ ├── dropAllCaps.ts │ ├── dropAllCapsModifier.ts │ ├── encloseBraces.ts │ ├── encodeUrls.ts │ ├── escapeCharacters.ts │ ├── fieldCommas.ts │ ├── formatPageRange.ts │ ├── generateKeys.ts │ ├── indentFields.ts │ ├── limitAuthors.ts │ ├── lowercaseEntryType.ts │ ├── lowercaseFields.ts │ ├── mergeEntries.ts │ ├── preferCurly.ts │ ├── preferNumeric.ts │ ├── removeBraces.ts │ ├── removeComments.ts │ ├── removeDuplicateFields.ts │ ├── removeEmptyFields.ts │ ├── removeEnclosingBraces.ts │ ├── removeSpecifiedFields.ts │ ├── resetWhitespace.ts │ ├── sortEntries.ts │ ├── sortEntriesModifier.ts │ ├── sortFields.ts │ └── wrapValues.ts ├── types.ts ├── ui │ ├── App.svelte │ ├── Checkbox.svelte │ ├── CleanupOptions.svelte │ ├── Cli.svelte │ ├── Collapsible.svelte │ ├── CopyButton.svelte │ ├── DuplicateOptions.svelte │ ├── Editor.svelte │ ├── Feedback.svelte │ ├── FeedbackError.svelte │ ├── FeedbackSuccess.svelte │ ├── IndentOptions.svelte │ ├── Label.svelte │ ├── Option.svelte │ ├── Radio.svelte │ ├── Sidebar.svelte │ ├── SortingOptions.svelte │ ├── SubOptions.svelte │ ├── ValueOptions.svelte │ ├── WhitespaceOptions.svelte │ ├── codemirrorExtensions │ │ ├── __generated__ │ │ │ ├── bibtex.terms.ts │ │ │ └── bibtex.ts │ │ ├── bibtex.grammar │ │ └── index.ts │ ├── defaultBibtex.ts │ ├── fonts │ │ ├── Inconsolata │ │ │ ├── Inconsolata-Regular.woff2 │ │ │ └── OFL.txt │ │ └── Plex │ │ │ ├── IBMPlexSans-Light.woff2 │ │ │ ├── IBMPlexSans-Medium.woff2 │ │ │ └── LICENSE.txt │ └── index.ts ├── unicode.ts └── utils.ts ├── test ├── abbreviate-months.spec.ts ├── align.spec.ts ├── at-symbol-in-comment.spec.ts ├── at-symbol-in-title.spec.ts ├── bibliographies │ ├── autocomplete-bibtex │ │ ├── LICENSE │ │ ├── PaglioneBibTeX.bib │ │ ├── citation_name_starts_w_numer.bib │ │ ├── citation_w_publisher.bib │ │ ├── citations.bib │ │ ├── commentTest.bib │ │ ├── crazy_delimiter.bib │ │ ├── cross_ref.bib │ │ ├── inproceedings.bib │ │ ├── inspiredHEP │ │ ├── latex_test.bib │ │ ├── quote.bib │ │ └── wikipedia_exmaple.bib │ ├── better-bibtex │ │ ├── Async_import_large_library_720.bib │ │ ├── Author_splitter_failure.bib │ │ ├── BBT_does_not_import_groups_from_JabRef_5.1_1641.bib │ │ ├── Better_BibLaTeX_import_improvements_549.bib │ │ ├── Better_BibTeX.001.bib │ │ ├── Better_BibTeX.003.bib │ │ ├── Better_BibTeX.004.bib │ │ ├── Better_BibTeX.005.bib │ │ ├── Better_BibTeX.006.bib │ │ ├── Better_BibTeX.008.bib │ │ ├── Better_BibTeX.009.bib │ │ ├── Better_BibTeX.010.bib │ │ ├── Better_BibTeX.011.bib │ │ ├── Better_BibTeX.012.bib │ │ ├── Better_BibTeX.014.bib │ │ ├── Better_BibTeX.015.bib │ │ ├── Better_BibTeX_Import_2.bib │ │ ├── BibLaTeX_Patent_author_handling_type_1060.bib │ │ ├── BibTeX_import;_preamble_with_def_create_problems_732.bib │ │ ├── Biblatex_Annotation_Import_Bug_613.bib │ │ ├── Endnote_should_parse.bib │ │ ├── Failure_to_handle_unparsed_author_names_(92).bib │ │ ├── Import_Jabref_fileDirectory_unexpected_reference_type_1058.bib │ │ ├── Import_fails_to_perform_@String_substitutions_154.bib │ │ ├── Import_location_to_event-place_for_conference_papers.bib │ │ ├── Import_of_langle_and_rangle_TeX_commands_1468.bib │ │ ├── Import_support_for_the_online_type_in_BBT_1358.bib │ │ ├── Import_support_for_the_online_type_in_BBT_1358.roundtrip.bib │ │ ├── Importing_changes_Journal_to_The_Journal_1601.bib │ │ ├── Issues_with_round_instead_of_curly_braces_do_not_import_correctly_871.bib │ │ ├── Jabref_groups_import_does_not_work_717.2.10.bib │ │ ├── Jabref_groups_import_does_not_work_717.3.8.bib │ │ ├── Jabref_import_-_groups_lost_1730-3.bib │ │ ├── Jabref_import_-_groups_lost_1730-5.bib │ │ ├── LICENSE │ │ ├── LaTeX_commands_in_Zotero_should_be_exported_untouched_1380.bib │ │ ├── LaTeX_commands_in_Zotero_should_be_exported_untouched_1380.roundtrip.bib │ │ ├── Literal_names.bib │ │ ├── Maintain_the_JabRef_group_and_subgroup_structure_when_importing_a_BibTeX_db_97.bib │ │ ├── Math_formatting_lost_on_import_627.bib │ │ ├── Math_markup_to_unicode_not_always_imported_correctly_472.bib │ │ ├── Math_markup_to_unicode_not_always_imported_correctly_472.roundtrip.bib │ │ ├── Options_to_use_default_import_process_1562.bib │ │ ├── Overline_during_Import_1467.bib │ │ ├── Problem_when_importing_BibTeX_entries_with_percent_sign_95_or_preamble_96.bib │ │ ├── Problem_when_importing_BibTeX_entries_with_square_brackets_94.bib │ │ ├── Some_bibtex_entries_quietly_discarded_on_import_from_bib_file_873.bib │ │ ├── Spaces_lost_when_expanding_string_variables_during_import_1081.bib │ │ ├── Title_of_German_entry_converted_to_lowercase_during_import_1350.bib │ │ ├── Unabbreviate_on_import_1436-1.bib │ │ ├── Unabbreviate_on_import_1436-2.bib │ │ ├── Unabbreviate_on_import_1436-3.bib │ │ ├── Wrong_ring-above_import_1115.bib │ │ ├── collaborators_to_contributors.bib │ │ ├── eprinttype_field_dropped_on_import_959.bib │ │ ├── import_software_related_biblatex_entries_1544.bib │ │ ├── importing_a_title-cased_bib_1246.bib │ │ ├── importing_a_title-cased_bib_1246.roundtrip.bib │ │ ├── space_after_citekey_creates_confusion_716.bib │ │ ├── support_Local-Zo-Url-x_field_from_BibDesk2Zotero_attachments_667.bib │ │ ├── tex.origdate_ignored_in_citekey_generation_1696.bib │ │ ├── unknown_command_handler_1733.bib │ │ ├── web_page_and_other_mendeley_idiocy.bib │ │ └── zbb_(quietly)_chokes_on_this_.bib_664.bib │ ├── biber │ │ ├── annotations.bib │ │ ├── bibtex-aliases.bib │ │ ├── crossrefs.bib │ │ ├── datalists.bib │ │ ├── dateformats.bib │ │ ├── dm-constraints.bib │ │ ├── encoding1.bib │ │ ├── encoding2.bib │ │ ├── encoding3.bib │ │ ├── encoding4.bib │ │ ├── encoding5.bib │ │ ├── encoding6.bib │ │ ├── examples.bib │ │ ├── extradate.bib │ │ ├── extratitle.bib │ │ ├── extratitleyear.bib │ │ ├── full-bbl.bib │ │ ├── full-bibtex_biber.bib │ │ ├── full-dot.bib │ │ ├── labelalpha.bib │ │ ├── labelalphaname.bib │ │ ├── maps.bib │ │ ├── names.bib │ │ ├── names_x.bib │ │ ├── options.bib │ │ ├── related.bib │ │ ├── sections1.bib │ │ ├── sections2.bib │ │ ├── sections3.bib │ │ ├── sections4.bib │ │ ├── sets.bib │ │ ├── skips.bib │ │ ├── skipsg.bib │ │ ├── sort-case.bib │ │ ├── sort-names.bib │ │ ├── sort-order.bib │ │ ├── sort-uc.bib │ │ ├── sort.bib │ │ ├── tool.bib │ │ ├── translit.bib │ │ ├── truncation.bib │ │ ├── uniqueness1.bib │ │ ├── uniqueness2.bib │ │ ├── uniqueness3.bib │ │ ├── uniqueness4.bib │ │ ├── uniqueness5.bib │ │ ├── uniqueness6.bib │ │ └── xdata.bib │ ├── biblatex │ │ ├── 95-customlists.bib │ │ ├── 97-annotations.bib │ │ └── biblatex-examples.bib │ ├── bibtex-perl-libs │ │ ├── 01.bib │ │ ├── 06.bib │ │ ├── 09-complex.bib │ │ ├── 10-funnyname.bib │ │ ├── 14-extratext.bib │ │ ├── braces.bib │ │ ├── endnote.txt │ │ ├── engineering_village.txt │ │ ├── english.bib │ │ └── mathscinet.txt │ ├── others │ │ ├── 1.bib │ │ ├── 2.bib │ │ ├── 3.bib │ │ ├── bibtex-biblatex-examples.bib │ │ ├── bibtex-embeddedtex.bib │ │ ├── bibtex-field-error.bib │ │ ├── bibtex-quoted.bib │ │ ├── bibtex-simple.bib │ │ ├── bibtex-space.bib │ │ ├── bibtex-symbols.bib │ │ ├── bibtex-var.bib │ │ ├── empty.bib │ │ ├── entry-with-parentheses.bib │ │ ├── example.bib │ │ ├── example1.bib │ │ ├── example2.bib │ │ ├── jabref.bib │ │ ├── orcid-PaglioneBibTeX.bib │ │ ├── orcid-book_citation.bib │ │ ├── orcid-chinese_citation.bib │ │ ├── orcid-citation.bib.bib │ │ ├── orcid-citation_name_starts_w_number.bib │ │ ├── orcid-citation_w_publisher.bib │ │ ├── orcid-citations.bib │ │ ├── orcid-comment.bib │ │ ├── orcid-crazy_delimiter.bib │ │ ├── orcid-cross_ref.bib │ │ ├── orcid-inproceedings.bib │ │ ├── orcid-inspiredHEP.bib │ │ ├── orcid-jan_month.bib │ │ ├── orcid-latex_test.bib │ │ ├── orcid-orcid-arXiv.bib │ │ ├── orcid-persian-citation.bib │ │ ├── orcid-quote.bib │ │ ├── orcid-russian-citations.bib │ │ ├── orcid-sample.bib │ │ ├── orcid-whitespace.bib │ │ ├── orcid-wikipedia_example.bib │ │ └── papers-for-mac.bib │ ├── php-bibtex-parser │ │ ├── LICENSE │ │ ├── abbreviation.bib │ │ ├── authors-simple.bib │ │ ├── basic.bib │ │ ├── citation-key.bib │ │ ├── comment-entry.bib │ │ ├── comment-jabref.bib │ │ ├── comment-only.bib │ │ ├── keywords-simple.bib │ │ ├── multiples-entries.bib │ │ ├── string-var-with-special-char.bib │ │ ├── tag-contents-basic.bib │ │ ├── tag-contents-escaped.bib │ │ ├── tag-contents-latex.bib │ │ ├── tag-contents-multiple.bib │ │ ├── tag-contents-nested-braces.bib │ │ ├── tag-contents-slashes.bib │ │ ├── tag-name-uppercased.bib │ │ ├── tag-name-with-underscore.bib │ │ ├── trailing-comma.bib │ │ └── type-overriding.bib │ └── python-bibtexparser │ │ ├── LICENSE │ │ ├── article.bib │ │ ├── article_comma_first.bib │ │ ├── article_comma_first_and_trailing_comma_output.bib │ │ ├── article_field_name_with_underscore.bib │ │ ├── article_homogenize.bib │ │ ├── article_missing_coma.bib │ │ ├── article_no_braces.bib │ │ ├── article_oneline.bib │ │ ├── article_output.bib │ │ ├── article_start_with_bom.bib │ │ ├── article_start_with_whitespace.bib │ │ ├── article_trailing_comma_output.bib │ │ ├── article_with_annotation.bib │ │ ├── article_with_annotation_output.bib │ │ ├── article_with_protection_braces.bib │ │ ├── article_with_special_characters.bib │ │ ├── article_with_strings.bib │ │ ├── article_with_strings_output.bib │ │ ├── biber-examples.bib │ │ ├── book.bib │ │ ├── book_bom.bib │ │ ├── book_comma_first.bib │ │ ├── book_output.bib │ │ ├── comments_only.bib │ │ ├── comments_only_output.bib │ │ ├── comments_percentage.bib │ │ ├── comments_percentage_nolastcoma.bib │ │ ├── comments_spaces_and_declarations.bib │ │ ├── common_strings.bib │ │ ├── crossref_cascading.bib │ │ ├── crossref_cascading_cycle.bib │ │ ├── crossref_entries.bib │ │ ├── encoding.bib │ │ ├── features.bib │ │ ├── features2.bib │ │ ├── features_output.bib │ │ ├── fieldname.bib │ │ ├── multiline_comments.bib │ │ ├── multiple_entries.bib │ │ ├── multiple_entries_and_comments.bib │ │ ├── multiple_entries_and_comments_output.bib │ │ ├── multiple_entries_output.bib │ │ ├── string.bib │ │ ├── traps.bib │ │ ├── website.bib │ │ ├── wrong.bib │ │ ├── xref_entries.bib │ │ └── xref_missing_entries.bib ├── big-numbers.spec.ts ├── blank-lines.spec.ts ├── cli-backup.spec.ts ├── cli-deprecated-io.spec.ts ├── cli-help.spec.ts ├── cli-infile.spec.ts ├── cli-input-path-with-spaces.spec.ts ├── cli-modify.spec.ts ├── cli-outfile.spec.ts ├── cli-stdin.spec.ts ├── cli-stdout.spec.ts ├── cli-unknown-argument.spec.ts ├── cli-version.spec.ts ├── complex-bib.spec.ts ├── concatenation.spec.ts ├── curly.spec.ts ├── defaults.spec.ts ├── dont-tidy-comments.spec.ts ├── drop-all-caps.spec.ts ├── duplicate-entries.spec.ts ├── duplicate-merge-1.spec.ts ├── duplicate-merge-2.spec.ts ├── duplicate-merge-combine.spec.ts ├── duplicate-merge-first.spec.ts ├── duplicate-merge-keys.spec.ts ├── duplicate-merge-last.spec.ts ├── duplicate-merge-overwrite.spec.ts ├── empty-entry.spec.ts ├── empty-key.spec.ts ├── enclosing-braces-around-command.spec.ts ├── enclosing-braces-with-escape.spec.ts ├── enclosing-braces.spec.ts ├── encode-urls.spec.ts ├── escape.spec.ts ├── extended-name-format.spec.ts ├── generate-keys.spec.ts ├── indent-spaces.spec.ts ├── indent-tab.spec.ts ├── index.ts ├── leading-commas.spec.ts ├── max-authors.spec.ts ├── multiline-field.spec.ts ├── multiple-files.spec.ts ├── no-lowercase.spec.ts ├── numeric.spec.ts ├── omit-properties.spec.ts ├── one-line-bib.spec.ts ├── paragraph.spec.ts ├── remove-braces.spec.ts ├── remove-duplicate-fields.spec.ts ├── remove-empty-fields.spec.ts ├── sort-descending.spec.ts ├── sort-fields.spec.ts ├── sort-key.spec.ts ├── sort-multi-key.spec.ts ├── sort-numeric.spec.ts ├── sort-special.spec.ts ├── sort.spec.ts ├── spacing-before-first-entry.spec.ts ├── strange-keys.spec.ts ├── strip-comments.spec.ts ├── strip-double-brace.spec.ts ├── syntax-error.spec.ts ├── syntax-unbalanced-braces.spec.ts ├── targets │ ├── api.ts │ ├── cli.ts │ └── web.ts ├── trailing-commas.spec.ts ├── utils.ts ├── valid-bibs.spec.ts └── wrap.spec.ts └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | bin/bibtex-tidy linguist-generated=true 2 | src/__generated/**/* linguist-generated=true 3 | package-lock.json linguist-generated=true 4 | bibtex-tidy.js linguist-generated=true 5 | docs/bundle.js linguist-generated=true -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'npm' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'monthly' 12 | -------------------------------------------------------------------------------- /.github/workflows/commit-build-changes.yml: -------------------------------------------------------------------------------- 1 | name: Build PR 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | 12 | - name: Install dependencies 13 | run: npm install 14 | 15 | - name: Build 16 | run: npm run build 17 | 18 | - uses: stefanzweifel/git-auto-commit-action@v4 19 | with: 20 | commit_message: Apply changes from build 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | npm-debug.log* 4 | pids 5 | *.pid 6 | *.seed 7 | *.pid.lock 8 | lib-cov 9 | coverage 10 | .nyc_output 11 | node_modules/ 12 | .npm 13 | *.tgz 14 | test/.tmp* 15 | .test 16 | .tmp 17 | .DS_store 18 | Notes 19 | lcov.info -------------------------------------------------------------------------------- /.pre-commit-hooks.yaml: -------------------------------------------------------------------------------- 1 | - id: bibtex-tidy 2 | name: bibtex-tidy 3 | entry: ./bin/bibtex-tidy --modify 4 | language: script 5 | types: ['bib'] 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Peter West 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | If you have found a security vulnerability (either in bibtex-tidy or its dependencies) then email peter@peter-west.uk. 6 | 7 | For bugs and minor vulnerabilities, please open an issue here: https://github.com/FlamingTempura/bibtex-tidy/issues/new. 8 | -------------------------------------------------------------------------------- /biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "include": [ 4 | "src/**/*", 5 | "test/**/*", 6 | "build.ts", 7 | "package.json", 8 | "tsconfig.json", 9 | "biome.json" 10 | ], 11 | "ignore": [ 12 | "**/__generated__/**", 13 | "src/ui/codemirrorExtensions/bibtex.terms.ts" 14 | ] 15 | }, 16 | "overrides": [ 17 | { 18 | "include": ["*.svelte"], 19 | "linter": { 20 | "rules": { 21 | "style": { 22 | "useConst": "off", 23 | "useImportType": "off" 24 | } 25 | } 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | bibtex-tidy: 3 | image: nginx:1.27.1-alpine-slim 4 | volumes: 5 | - ../docs:/usr/share/nginx/html 6 | ports: 7 | - 8080:80 8 | -------------------------------------------------------------------------------- /docs/IBMPlexSans-Light-SATUMA4V.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/docs/IBMPlexSans-Light-SATUMA4V.woff2 -------------------------------------------------------------------------------- /docs/IBMPlexSans-Medium-ILA6RNXQ.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/docs/IBMPlexSans-Medium-ILA6RNXQ.woff2 -------------------------------------------------------------------------------- /docs/Inconsolata-Regular-CEGDCP7X.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/docs/Inconsolata-Regular-CEGDCP7X.woff2 -------------------------------------------------------------------------------- /docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/docs/favicon.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Online BibTeX Tidy - Clean up BibTeX files 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /scripts/cover.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Generates a coverage report 4 | 5 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 6 | 7 | cd "$SCRIPT_DIR/.." 8 | 9 | # In coverage mode the binary includes sourcemaps, so we create it in a different place. 10 | # I've only got this working if (a) the sourcemap is inline and (b) the file ends with.js. 11 | export BIBTEX_TIDY_BIN=./.tmp/bibtex-tidy.js 12 | 13 | export NODE_ENV=coverage 14 | 15 | export NODE_OPTIONS=--enable-source-maps 16 | 17 | npm run build 18 | 19 | npx c8 \ 20 | --clean \ 21 | --src .tmp \ 22 | --src src \ 23 | --all \ 24 | --include "**/*.ts" \ 25 | --include "**/*.js" \ 26 | --include "**/*.svelte" \ 27 | --reporter html-spa \ 28 | node -r esbuild-register test/index.ts 29 | 30 | echo "Coverage report at ${pwd}/coverage/index.html" -------------------------------------------------------------------------------- /scripts/prepare-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # To trigger a release, use npm version patch 4 | 5 | # Generate the change log from the git log 6 | echo "" >> CHANGELOG.md 7 | echo "### v$npm_package_version" >> CHANGELOG.md 8 | echo '' >> CHANGELOG.md 9 | git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s" >> CHANGELOG.md 10 | 11 | # Build everything so they contain new version 12 | npm run build 13 | 14 | # Allow reviewing staged changes 15 | echo "" 16 | read -p "Ready for release? (Please review/edit changelog then press &) " -n 1 -r 17 | if [[ ! $REPLY =~ ^[Yy]$ ]] 18 | then 19 | exit 1 20 | fi 21 | 22 | git add -A -------------------------------------------------------------------------------- /scripts/validate-test-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Check that all test bibtex files are valid 4 | 5 | mkdir -p .tmp 6 | cd .tmp 7 | 8 | shopt -s globstar 9 | for i in ../test/bibliographies/**/*.bib; do 10 | 11 | echo "$i" 12 | 13 | rm texput.* 14 | 15 | pdflatex > /dev/null < { 8 | it("should flag similar citations", () => { 9 | const ast = parseBibTeX( 10 | [ 11 | '@article{a, author={Smith, James}, title=" something blah BLAH."}', 12 | "@article{b, author={Smith, JA},title={Something blah blah}}", 13 | ].join(""), 14 | ); 15 | const result = checkForDuplicates(new ASTProxy(ast), ["citation"]); 16 | equal(result.warnings.length, 1); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export { tidy } from "./tidy"; 2 | export type { Warning, BibTeXTidyResult } from "./types"; 3 | -------------------------------------------------------------------------------- /src/optionsToCLIArgs.ts: -------------------------------------------------------------------------------- 1 | import { optionDefinitions } from "./optionDefinitions"; 2 | import type { Options } from "./optionUtils"; 3 | 4 | export function optionsToCLIArgs(options: Options): string[] { 5 | return optionDefinitions 6 | .map((def) => def.toCLI?.(options[def.key as keyof Options], options)) 7 | .filter((arg): arg is string => typeof arg === "string"); 8 | } 9 | -------------------------------------------------------------------------------- /src/parsers/entryKeyTemplateParser.spec.ts: -------------------------------------------------------------------------------- 1 | import { deepStrictEqual } from "node:assert"; 2 | import { describe, it } from "node:test"; 3 | import { parseEntryKeyTemplate } from "./entryKeyTemplateParser"; 4 | 5 | describe("entryKeyTemplateParser", () => { 6 | it("parses given template", () => { 7 | const template = parseEntryKeyTemplate("foo[bar][abc:def:ghi]jk[l2]m"); 8 | deepStrictEqual(template, [ 9 | "foo", 10 | { marker: "bar", parameter: undefined, modifiers: [] }, 11 | { marker: "abc", parameter: undefined, modifiers: ["def", "ghi"] }, 12 | "jk", 13 | { marker: "lN", parameter: 2, modifiers: [] }, 14 | "m", 15 | ]); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /src/parsers/entryKeyTemplateParser.ts: -------------------------------------------------------------------------------- 1 | export type EntryKeyTemplateToken = 2 | | string 3 | | { marker: string; parameter?: number; modifiers: string[] }; 4 | 5 | export function parseEntryKeyTemplate( 6 | template: string, 7 | ): EntryKeyTemplateToken[] { 8 | const tokens: EntryKeyTemplateToken[] = []; 9 | const matches = template.matchAll(/\[[^:\]]+(?::[^:\]]+)*\]/g); 10 | 11 | let pos = 0; 12 | for (const match of matches) { 13 | if (match.index === undefined) break; 14 | if (match.index !== pos) { 15 | tokens.push(template.slice(pos, match.index)); 16 | } 17 | const [tokenKeyN, ...modifierKeys] = match[0].slice(1, -1).split(":"); 18 | if (!tokenKeyN) { 19 | throw new Error("Token parse error"); 20 | } 21 | 22 | let n: number | undefined; 23 | const tokenKey = tokenKeyN.replace(/[0-9]+/g, (m) => { 24 | n = Number(m); 25 | return "N"; 26 | }); 27 | 28 | tokens.push({ 29 | marker: tokenKey, 30 | parameter: n, 31 | modifiers: modifierKeys, 32 | }); 33 | pos = match.index + match[0].length; 34 | } 35 | if (pos < template.length) { 36 | tokens.push(template.slice(pos)); 37 | } 38 | 39 | return tokens; 40 | } 41 | -------------------------------------------------------------------------------- /src/tidy.ts: -------------------------------------------------------------------------------- 1 | import { ASTProxy } from "./ASTProxy"; 2 | import { logAST } from "./debug"; 3 | import { formatBibtex } from "./format"; 4 | import { normalizeOptions } from "./optionUtils"; 5 | import type { Options } from "./optionUtils"; 6 | import { parseBibTeX } from "./parsers/bibtexParser"; 7 | import { generateTransformPipeline } from "./pipeline"; 8 | import type { BibTeXTidyResult, Warning } from "./types"; 9 | import { convertCRLF } from "./utils"; 10 | 11 | const verbose = false; 12 | 13 | export function tidy(input: string, options_: Options = {}): BibTeXTidyResult { 14 | const options = normalizeOptions(options_); 15 | const inputFixed = convertCRLF(input); 16 | const ast = parseBibTeX(inputFixed); 17 | const cache = new ASTProxy(ast); 18 | const pipeline = generateTransformPipeline(options); 19 | 20 | const warnings: Warning[] = cache 21 | .entries() 22 | .filter((entry) => !entry.key) 23 | .map((entry) => ({ 24 | code: "MISSING_KEY", 25 | message: `${entry.parent.command} entry does not have a citation key.`, 26 | })); 27 | 28 | if (verbose) { 29 | console.log(logAST(ast)); 30 | } 31 | 32 | for (const transform of pipeline) { 33 | const result = transform.apply(cache); 34 | if (verbose) { 35 | console.log(`\n\n## Applying transform: ${transform.name}`); 36 | console.log(logAST(ast)); 37 | } 38 | if (result) warnings.push(...result); 39 | } 40 | 41 | const bibtex = formatBibtex(ast); 42 | 43 | return { bibtex, warnings, count: cache.entries().length }; 44 | } 45 | -------------------------------------------------------------------------------- /src/transforms/alignValues.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createAlignValuesTransform(column: number): Transform { 4 | return { 5 | name: "align-values", 6 | apply: (astProxy) => { 7 | const fields = astProxy.fields(); 8 | for (const field of fields) { 9 | const gap = Math.max(column - field.name.length, 1); 10 | field.value.whitespacePrefix = " ".repeat(gap); 11 | } 12 | return undefined; 13 | }, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /src/transforms/blankLines.ts: -------------------------------------------------------------------------------- 1 | import type { BlockNode, TextNode } from "../parsers/bibtexParser"; 2 | import type { Transform } from "../types"; 3 | 4 | export function createBlankLinesTransform(): Transform { 5 | return { 6 | name: "blank-lines", 7 | apply: (astProxy) => { 8 | const children = astProxy.root().children; 9 | let prev: TextNode | BlockNode | undefined; 10 | for (const child of children) { 11 | if (prev && !isComment(prev)) { 12 | child.whitespacePrefix = "\n\n"; 13 | } 14 | prev = child; 15 | } 16 | return undefined; 17 | }, 18 | }; 19 | } 20 | 21 | function isComment(node: TextNode | BlockNode): boolean { 22 | return node.type === "text" || node.block?.type === "comment"; 23 | } 24 | -------------------------------------------------------------------------------- /src/transforms/dropAllCaps.ts: -------------------------------------------------------------------------------- 1 | import type { ASTProxy } from "../ASTProxy"; 2 | import type { FieldNode } from "../parsers/bibtexParser"; 3 | import type { Transform } from "../types"; 4 | 5 | export function createDropAllCapsTransform(): Transform { 6 | return { 7 | name: "drop-all-caps", 8 | apply: (astProxy) => { 9 | for (const field of astProxy.fields()) { 10 | dropAllCapsInField(astProxy, field); 11 | } 12 | return undefined; 13 | }, 14 | }; 15 | } 16 | 17 | function dropAllCapsInField(astProxy: ASTProxy, field: FieldNode) { 18 | if (!astProxy.lookupRenderedEntryValue(field).match(/[a-z]/)) { 19 | console.log(astProxy.lookupRenderedEntryValue(field)); 20 | for (const node of field.value.concat) { 21 | node.value = titleCase(node.value); 22 | } 23 | astProxy.invalidateField(field); 24 | } 25 | } 26 | 27 | function titleCase(str: string): string { 28 | return str.replace(/(\w)(\S*)/g, (_, first, rest) => { 29 | const word = first + rest; 30 | if (isRomanNumeral(word)) return word; 31 | return first.toLocaleUpperCase() + rest.toLocaleLowerCase(); 32 | }); 33 | } 34 | 35 | function isRomanNumeral(str: string): boolean { 36 | return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/.test(str); 37 | } 38 | -------------------------------------------------------------------------------- /src/transforms/dropAllCapsModifier.ts: -------------------------------------------------------------------------------- 1 | import type { ASTProxy } from "../ASTProxy"; 2 | import type { FieldNode } from "../parsers/bibtexParser"; 3 | import type { Transform } from "../types"; 4 | 5 | export function createDropAllCapsTransform(): Transform { 6 | return { 7 | name: "drop-all-caps", 8 | apply: (astProxy) => { 9 | for (const field of astProxy.fields()) { 10 | dropAllCapsInField(astProxy, field); 11 | } 12 | return undefined; 13 | }, 14 | }; 15 | } 16 | 17 | function dropAllCapsInField(astProxy: ASTProxy, field: FieldNode) { 18 | if (!astProxy.lookupRenderedEntryValue(field).match(/[a-z]/)) { 19 | console.log(astProxy.lookupRenderedEntryValue(field)); 20 | for (const node of field.value.concat) { 21 | node.value = titleCase(node.value); 22 | } 23 | astProxy.invalidateField(field); 24 | } 25 | } 26 | 27 | function titleCase(str: string): string { 28 | return str.replace(/(\w)(\S*)/g, (_, first, rest) => { 29 | const word = first + rest; 30 | if (isRomanNumeral(word)) return word; 31 | return first.toLocaleUpperCase() + rest.toLocaleLowerCase(); 32 | }); 33 | } 34 | 35 | function isRomanNumeral(str: string): boolean { 36 | return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/.test(str); 37 | } 38 | -------------------------------------------------------------------------------- /src/transforms/encloseBraces.ts: -------------------------------------------------------------------------------- 1 | import { parseLaTeX, stringifyLaTeX } from "../parsers/latexParser"; 2 | import type { Transform } from "../types"; 3 | 4 | // if the user requested, wrap the value in braces (this forces bibtex 5 | // compiler to preserve case) 6 | export function createEncloseBracesTransform(fields: string[]): Transform { 7 | const set = new Set(fields.map((f) => f.toLocaleLowerCase())); 8 | return { 9 | name: "enclose-braces", 10 | dependencies: ["prefer-curly"], 11 | apply: (ast) => { 12 | for (const field of ast.fields()) { 13 | if (set.has(field.name.toLocaleLowerCase())) { 14 | for (const node of field.value.concat) { 15 | if (node.type === "braced") { 16 | node.value = doubleEnclose(node.value); 17 | } 18 | } 19 | } 20 | } 21 | return undefined; 22 | }, 23 | }; 24 | } 25 | 26 | /** 27 | * Remove all braces (unless part of a command) and enclose entire value in 28 | * braces 29 | */ 30 | export function doubleEnclose(str: string): string { 31 | const latex = parseLaTeX(str); 32 | 33 | const alreadyDoubleEnclosed = 34 | latex.children.length === 1 && 35 | latex.children[0]?.type === "block" && 36 | latex.children[0]?.kind === "curly" && 37 | latex.children[0].children.length === 1 && 38 | latex.children[0].children[0]?.type === "block" && 39 | latex.children[0].children[0]?.kind === "curly"; 40 | 41 | const result = stringifyLaTeX(latex); 42 | return alreadyDoubleEnclosed ? result : `{${result}}`; 43 | } 44 | -------------------------------------------------------------------------------- /src/transforms/encodeUrls.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createEncodeUrlsTransform(): Transform { 4 | return { 5 | name: "encode-urls", 6 | apply: (ast) => { 7 | for (const field of ast.fields()) { 8 | if (field.name.toLocaleLowerCase() === "url") { 9 | for (const entry of field.value.concat) { 10 | entry.value = encodeUrl(entry.value); 11 | } 12 | ast.invalidateField(field); 13 | } 14 | } 15 | return undefined; 16 | }, 17 | }; 18 | } 19 | 20 | function encodeUrl(url: string): string { 21 | return url.replace(/\\?_/g, "\\%5F"); 22 | } 23 | -------------------------------------------------------------------------------- /src/transforms/fieldCommas.ts: -------------------------------------------------------------------------------- 1 | import type { FieldNode } from "../parsers/bibtexParser"; 2 | import type { Transform } from "../types"; 3 | 4 | export function createFieldCommasTransform(trailing: boolean): Transform { 5 | return { 6 | name: "field-commas", 7 | apply: (astProxy) => { 8 | const entries = astProxy.entries(); 9 | for (const entry of entries) { 10 | for (let i = 0; i < entry.fields.length; i++) { 11 | const field = entry.fields[i] as FieldNode; 12 | field.hasComma = i < entry.fields.length - 1 || trailing; 13 | } 14 | } 15 | 16 | return undefined; 17 | }, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/transforms/formatPageRange.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | /** Replace single dash with double dash in page range **/ 4 | export function createFormatPageRangeTransform(): Transform { 5 | return { 6 | name: "format-page-range", 7 | apply(ast) { 8 | for (const field of ast.fields()) { 9 | if (field.name.toLocaleLowerCase() === "pages") { 10 | for (const entry of field.value.concat) { 11 | entry.value = formatPageRange(entry.value); 12 | } 13 | ast.invalidateField(field); 14 | } 15 | } 16 | return undefined; 17 | }, 18 | }; 19 | } 20 | 21 | function formatPageRange(str: string): string { 22 | let result = str; 23 | // TODO: replace with replaceAll when more widespread node support 24 | for (let i = 0; i < 4; i++) { 25 | result = result.replace(/(\d)\s*-\s*(\d)/g, "$1--$2"); 26 | } 27 | return result; 28 | } 29 | -------------------------------------------------------------------------------- /src/transforms/generateKeys.ts: -------------------------------------------------------------------------------- 1 | import { generateKeys } from "../generateKeys"; 2 | import type { Transform } from "../types"; 3 | 4 | export function createGenerateKeysTransform(template: string): Transform { 5 | return { 6 | name: "generate-keys", 7 | apply: (astProxy) => { 8 | const newKeys = generateKeys(astProxy.entries(), astProxy, template); 9 | for (const entry of astProxy.entries()) { 10 | const newKey = newKeys.get(entry); 11 | if (newKey) { 12 | entry.key = newKey; 13 | } 14 | } 15 | return undefined; 16 | }, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/transforms/indentFields.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createIndentFieldsTransform(indent: string): Transform { 4 | return { 5 | name: "indent", 6 | apply: (astProxy) => { 7 | const fields = astProxy.fields(); 8 | for (const field of fields) { 9 | field.whitespacePrefix = `\n${indent}`; 10 | } 11 | return undefined; 12 | }, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /src/transforms/limitAuthors.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createLimitAuthorsTransform(maxAuthors: number): Transform { 4 | return { 5 | name: "limit-authors", 6 | apply: (astProxy) => { 7 | const fields = astProxy.fields(); 8 | for (const field of fields) { 9 | if (field.name.toLocaleLowerCase() === "author") { 10 | for (const node of field.value.concat) { 11 | // TODO: use author parser? 12 | const authors = node.value.split(" and "); 13 | if (authors.length > maxAuthors) { 14 | node.value = [...authors.slice(0, maxAuthors), "others"].join( 15 | " and ", 16 | ); 17 | } 18 | } 19 | } 20 | } 21 | return undefined; 22 | }, 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /src/transforms/lowercaseEntryType.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createLowercaseEntryTypeTransform(): Transform { 4 | return { 5 | name: "lowercase-entry-type", 6 | apply: (ast) => { 7 | for (const entry of ast.entries()) { 8 | entry.parent.command = entry.parent.command.toLocaleLowerCase(); 9 | } 10 | return undefined; 11 | }, 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /src/transforms/lowercaseFields.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createLowercaseFieldsTransform(): Transform { 4 | return { 5 | name: "lowercase-fields", 6 | apply: (ast) => { 7 | for (const field of ast.fields()) { 8 | const newName = field.name.toLocaleLowerCase(); 9 | if (newName !== field.name) { 10 | field.name = newName; 11 | ast.invalidateField(field); 12 | } 13 | } 14 | return undefined; 15 | }, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/transforms/mergeEntries.ts: -------------------------------------------------------------------------------- 1 | import { checkForDuplicates } from "../duplicates"; 2 | import type { MergeStrategy, OptionsNormalized } from "../optionUtils"; 3 | import type { Transform } from "../types"; 4 | import { isEntryNode } from "../utils"; 5 | 6 | export function createMergeEntriesTransform( 7 | duplicatesOpt: OptionsNormalized["duplicates"], 8 | merge?: MergeStrategy, 9 | ): Transform { 10 | // Must happen after generate keys, before sorting entries 11 | return { 12 | name: "merge-entries", 13 | dependencies: ["generate-keys", "sort-entries"], 14 | 15 | apply: (astProxy) => { 16 | const duplicates = checkForDuplicates(astProxy, duplicatesOpt, merge); 17 | 18 | const root = astProxy.root(); 19 | root.children = root.children.filter( 20 | (child) => !isEntryNode(child) || !duplicates.entries.has(child.block), 21 | ); 22 | 23 | return duplicates.warnings; 24 | }, 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/transforms/preferCurly.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | import { monthAliases } from "./abbreviateMonths"; 3 | 4 | export function createPreferCurlyTransform(): Transform { 5 | return { 6 | name: "prefer-curly", 7 | apply: (ast) => { 8 | for (const field of ast.fields()) { 9 | if ( 10 | field.name.toLowerCase() === "month" && 11 | monthAliases[ast.lookupRenderedEntryValue(field)] 12 | ) { 13 | continue; 14 | } 15 | for (const child of field.value.concat) { 16 | child.type = "braced"; 17 | } 18 | ast.invalidateField(field); 19 | } 20 | return undefined; 21 | }, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/transforms/preferNumeric.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createPreferNumericTransform(): Transform { 4 | return { 5 | name: "prefer-numeric", 6 | apply: (ast) => { 7 | for (const field of ast.fields()) { 8 | for (const child of field.value.concat) { 9 | const isNumeric = child.value.match(/^[1-9][0-9]*$/); 10 | if (isNumeric) { 11 | child.type = "literal"; 12 | } 13 | } 14 | ast.invalidateField(field); 15 | } 16 | return undefined; 17 | }, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/transforms/removeBraces.ts: -------------------------------------------------------------------------------- 1 | import { 2 | flattenLaTeX, 3 | parseLaTeX, 4 | stringifyLaTeX, 5 | } from "../parsers/latexParser"; 6 | import type { Transform } from "../types"; 7 | 8 | export function createRemoveBracesTransform(fields: string[]): Transform { 9 | const set = new Set(fields.map((f) => f.toLocaleLowerCase())); 10 | return { 11 | name: "remove-braces", 12 | apply: (ast) => { 13 | for (const field of ast.fields()) { 14 | if (set.has(field.name.toLocaleLowerCase())) { 15 | for (const node of field.value.concat) { 16 | if (node.type === "braced") { 17 | node.value = stringifyLaTeX(flattenLaTeX(parseLaTeX(node.value))); 18 | } 19 | } 20 | } 21 | } 22 | return undefined; 23 | }, 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /src/transforms/removeComments.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createRemoveCommentsTransform(): Transform { 4 | return { 5 | name: "remove-comments", 6 | apply: (astProxy) => { 7 | astProxy.root().children = astProxy 8 | .root() 9 | .children.filter( 10 | (child) => 11 | child.type !== "text" && 12 | (child.type !== "block" || child.block?.type !== "comment"), 13 | ); 14 | 15 | return undefined; 16 | }, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/transforms/removeDuplicateFields.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createRemoveDuplicateFieldsTransform(): Transform { 4 | return { 5 | name: "remove-duplicate-fields", 6 | apply: (astProxy) => { 7 | for (const node of astProxy.root().children) { 8 | if (node.type === "block" && node.block?.type === "entry") { 9 | const fieldSeen = new Set(); 10 | node.block.fields = node.block.fields.filter((field) => { 11 | const nameLc = field.name.toLocaleLowerCase(); 12 | if (fieldSeen.has(nameLc)) { 13 | return false; 14 | } 15 | fieldSeen.add(nameLc); 16 | return true; 17 | }); 18 | } 19 | } 20 | return undefined; 21 | }, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/transforms/removeEmptyFields.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createRemoveEmptyFieldsTransform(): Transform { 4 | return { 5 | name: "remove-empty-fields", 6 | apply: (ast) => { 7 | for (const node of ast.root().children) { 8 | if (node.type === "block" && node.block?.type === "entry") { 9 | const entry = node.block; 10 | entry.fields = entry.fields.filter( 11 | (field) => ast.lookupRenderedEntryValue(field) !== "", 12 | ); 13 | } 14 | } 15 | return undefined; 16 | }, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/transforms/removeEnclosingBraces.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | // if a field's value has double braces {{blah}}, lose the inner brace 4 | export function createRemoveEnclosingBracesTransform(): Transform { 5 | return { 6 | name: "remove-enclosing-braces", 7 | apply: (ast) => { 8 | for (const field of ast.fields()) { 9 | for (const node of field.value.concat) { 10 | if (node.type === "braced") { 11 | node.value = node.value.replace(/^\{([^{}]*)\}$/g, "$1"); 12 | } 13 | ast.invalidateField(field); 14 | } 15 | } 16 | return undefined; 17 | }, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/transforms/removeSpecifiedFields.ts: -------------------------------------------------------------------------------- 1 | import type { Transform } from "../types"; 2 | 3 | export function createRemoveSpecifiedFieldsTransform( 4 | omit: string[], 5 | ): Transform { 6 | return { 7 | name: "remove-specified-fields", 8 | apply(ast) { 9 | const set = new Set(omit.map((f) => f.toLocaleLowerCase())); 10 | for (const field of ast.fields()) { 11 | if (set.has(field.name.toLocaleLowerCase())) { 12 | field.parent.fields = field.parent.fields.filter((f) => f !== field); 13 | } 14 | } 15 | return undefined; 16 | }, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/transforms/resetWhitespace.ts: -------------------------------------------------------------------------------- 1 | import type { BlockNode, TextNode } from "../parsers/bibtexParser"; 2 | import type { Transform } from "../types"; 3 | 4 | export function createResetWhitespaceTransform( 5 | keepCommentWhitespace: boolean, 6 | ): Transform { 7 | return { 8 | name: "reset-whitespace", 9 | apply: (astProxy) => { 10 | const children = astProxy.root().children; 11 | let prev: TextNode | BlockNode | undefined; 12 | for (const child of children) { 13 | const preserve = isComment(child) && keepCommentWhitespace; 14 | const preservePrev = prev && isComment(prev) && keepCommentWhitespace; 15 | 16 | if ( 17 | keepCommentWhitespace && 18 | child.type === "block" && 19 | prev?.type === "text" && 20 | !prev.text.endsWith("\n") 21 | ) { 22 | prev.text = `${prev.text.trimEnd()}\n`; 23 | } 24 | 25 | if (!preserve) { 26 | child.whitespacePrefix = prev && !preservePrev ? "\n" : ""; 27 | if (child.type === "text") { 28 | child.text = child.text.trim(); 29 | } else if (child.block) { 30 | if (child.block.type === "entry") { 31 | for (const field of child.block.fields) { 32 | field.whitespacePrefix = ""; 33 | } 34 | } else if (child.block.type === "comment") { 35 | child.block.raw = child.block.raw.trim(); 36 | } 37 | } 38 | } 39 | 40 | prev = child; 41 | } 42 | return undefined; 43 | }, 44 | }; 45 | } 46 | 47 | function isComment(node: TextNode | BlockNode): boolean { 48 | return node.type === "text" || node.block?.type === "comment"; 49 | } 50 | -------------------------------------------------------------------------------- /src/transforms/sortFields.ts: -------------------------------------------------------------------------------- 1 | import type { EntryNode } from "../parsers/bibtexParser"; 2 | 3 | import type { Transform } from "../types"; 4 | 5 | export function createSortFieldsTransform(sortFields: string[]): Transform { 6 | return { 7 | name: "sort-fields", 8 | apply: (astProxy) => { 9 | const entries = astProxy.entries(); 10 | sortEntryFields(entries, sortFields); 11 | return undefined; 12 | }, 13 | }; 14 | } 15 | 16 | function sortEntryFields(entries: EntryNode[], fieldOrder: string[]): void { 17 | for (const entry of entries) { 18 | entry.fields.sort((a, b) => { 19 | const orderA = fieldOrder.indexOf(a.name.toLocaleLowerCase()); 20 | const orderB = fieldOrder.indexOf(b.name.toLocaleLowerCase()); 21 | if (orderA === -1 && orderB === -1) return 0; 22 | if (orderA === -1) return 1; 23 | if (orderB === -1) return -1; 24 | if (orderB < orderA) return 1; 25 | if (orderB > orderA) return -1; 26 | return 0; 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | import type { ASTProxy } from "./ASTProxy"; 2 | import type { DuplicateRule } from "./optionUtils"; 3 | 4 | export type Transform = { 5 | name: string; 6 | dependencies?: string[]; 7 | apply: (ast: ASTProxy) => Warning[] | undefined; 8 | }; 9 | 10 | export type Warning = ( 11 | | { code: "MISSING_KEY" } 12 | | { code: "DUPLICATE_ENTRY"; rule: DuplicateRule } 13 | ) & { 14 | message: string; 15 | }; 16 | 17 | export type BibTeXTidyResult = { 18 | bibtex: string; 19 | warnings: Warning[]; 20 | count: number; 21 | }; 22 | -------------------------------------------------------------------------------- /src/ui/Checkbox.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | dispatch("change")} 15 | /> 16 | 17 | 53 | -------------------------------------------------------------------------------- /src/ui/Cli.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 |

To run this configuration on the command line:

19 | 20 | bibtex-tidy {#each args as [key, value]} 21 | {key}{#if value && value.length > 0} 22 | ={value} 23 | {/if}{' '} 24 | {/each} YOUR_FILE.bib 25 | 26 |
27 | 28 | 42 | -------------------------------------------------------------------------------- /src/ui/Collapsible.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 | {title} 8 | 9 |
10 | 11 | 48 | -------------------------------------------------------------------------------- /src/ui/Feedback.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | {#if status.status === 'success'} 15 | 16 | {:else} 17 | 18 | {/if} 19 |
20 | 21 | 30 | -------------------------------------------------------------------------------- /src/ui/FeedbackError.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | {#if error instanceof BibTeXSyntaxError} 25 | There's a problem with the bibtex
26 | {error.name} on line {error.line} column {error.column}
27 | {#if error.hint} 28 | {error.hint} 29 | {:else} 30 | Unexpected {JSON.stringify(error.char)} in {error.node.type}. 31 | {/if} 32 | {:else} 33 | There's a problem with the bibtex
34 | Unknown error: {error}
35 | This is probably a bug. 36 | {/if} 37 |
38 |
39 | 40 | 55 | -------------------------------------------------------------------------------- /src/ui/IndentOptions.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 25 | 29 | 30 | {#if indent === 'spaces'} 31 | 32 | 35 | 36 | {/if} 37 | 38 | -------------------------------------------------------------------------------- /src/ui/Label.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 29 | -------------------------------------------------------------------------------- /src/ui/Option.svelte: -------------------------------------------------------------------------------- 1 | 22 | 23 | 31 | {#if $$slots.default} 32 | {#if checked} 33 | 34 | {/if} 35 | {/if} 36 | -------------------------------------------------------------------------------- /src/ui/Radio.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 37 | -------------------------------------------------------------------------------- /src/ui/SubOptions.svelte: -------------------------------------------------------------------------------- 1 |
2 | 3 | 20 | -------------------------------------------------------------------------------- /src/ui/WhitespaceOptions.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 27 | 28 | 34 | 35 | 37 | -------------------------------------------------------------------------------- /src/ui/codemirrorExtensions/__generated__/bibtex.terms.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by lezer-generator. You probably shouldn't edit it. 2 | export const 3 | Program = 1, 4 | CommentCommand = 2, 5 | Braced = 3, 6 | BraceContent = 4, 7 | PreambleCommand = 5, 8 | Quoted = 6, 9 | Number = 7, 10 | Identifier = 8, 11 | StringCommand = 9, 12 | Command = 10, 13 | Key = 11, 14 | Comment = 12 15 | -------------------------------------------------------------------------------- /src/ui/codemirrorExtensions/bibtex.grammar: -------------------------------------------------------------------------------- 1 | @top Program { node* } 2 | 3 | @skip { space } 4 | 5 | node { 6 | blockComment | 7 | preamble | 8 | string | 9 | entry | 10 | Comment 11 | } 12 | 13 | blockComment { 14 | CommentCommand Braced 15 | } 16 | 17 | preamble { 18 | PreambleCommand '{' expression '}' 19 | } 20 | 21 | string { 22 | StringCommand '{' keyValue '}' 23 | } 24 | 25 | entry { 26 | Command '{' Key ',' keyValue (',' keyValue)* ','? '}' 27 | } 28 | 29 | keyValue { 30 | Identifier '=' expression 31 | } 32 | 33 | expression { 34 | literal ('#' literal)* 35 | } 36 | 37 | literal { 38 | Braced | 39 | Quoted | 40 | Number | 41 | Identifier 42 | } 43 | 44 | Braced { 45 | '{' BraceContent? (Braced BraceContent?)* '}' 46 | } 47 | 48 | @tokens { 49 | space { @whitespace+ } 50 | Number { @digit+ } 51 | Quoted { '"' (!["] | '\\"')* '"' } 52 | BraceContent { ![{}]+ } 53 | CommentCommand { '@' $[cC] $[oO] $[mM] $[mM] $[eE] $[nN] $[tT] } 54 | PreambleCommand { '@' $[pP] $[rR] $[eE] $[aA] $[mM] $[bB] $[lL] $[eE] } 55 | StringCommand { '@' $[sS] $[tT] $[rR] $[iI] $[nN] $[gG] } 56 | Command { '@' Identifier } 57 | Comment { 'no idea why this string is needed but whatever' ![@{} ]+ } 58 | Key { Identifier } 59 | Identifier { $[a-zA-Z_] $[a-zA-Z_\-0-9]+ } 60 | @precedence { 61 | CommentCommand, 62 | PreambleCommand, 63 | StringCommand, 64 | Command, 65 | BraceContent, 66 | space 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/ui/defaultBibtex.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_BIBTEX = `Click Tidy to clean up the entries below 2 | @Book{sweig42, 3 | Author = { Stefa{n} Sweig }, 4 | title = { The impossible book }, 5 | publisher = { Dead Poet Society}, 6 | year = 1942, 7 | month = mar 8 | } 9 | @article{steward03, 10 | author = {Martha Steward}, 11 | title = {Cooking behind bars}, publisher = "Culinary Expert Series", 12 | year = {2003} 13 | } 14 | @Book{impossible, 15 | Author = { Stefan Sweig }, 16 | title = { The impossible book }, 17 | publisher = { Dead Poet Society}, 18 | year = 1942, 19 | month = mar 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /src/ui/fonts/Inconsolata/Inconsolata-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/src/ui/fonts/Inconsolata/Inconsolata-Regular.woff2 -------------------------------------------------------------------------------- /src/ui/fonts/Plex/IBMPlexSans-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/src/ui/fonts/Plex/IBMPlexSans-Light.woff2 -------------------------------------------------------------------------------- /src/ui/fonts/Plex/IBMPlexSans-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/src/ui/fonts/Plex/IBMPlexSans-Medium.woff2 -------------------------------------------------------------------------------- /src/ui/index.ts: -------------------------------------------------------------------------------- 1 | import "core-js/modules/es.array.flat-map"; 2 | import "core-js/modules/es.object.from-entries"; 3 | import "core-js/modules/es.string.trim-end"; 4 | import { mount } from "svelte"; 5 | import App from "./App.svelte"; 6 | 7 | mount(App, { target: document.body }); 8 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import type { BlockNode, EntryNode, TextNode } from "./parsers/bibtexParser"; 2 | 3 | /** 4 | * Remove all non-alphanumeric characters 5 | */ 6 | export function alphaNum(str: string): string { 7 | return str.replace(/[^0-9A-Za-z]/g, "").toLocaleLowerCase(); 8 | } 9 | 10 | /** Normalize new lines. Convert CR/CRLF to LF. */ 11 | export function convertCRLF(str: string): string { 12 | return str.replace(/\r\n?/g, "\n"); 13 | } 14 | 15 | export function wrapText(line: string, lineWidth: number): string[] { 16 | const words: string[] = line.split(" "); 17 | const lines: string[] = []; 18 | let currLine = ""; 19 | for (const [i, word] of words.entries()) { 20 | if (currLine.length + word.length + 1 > lineWidth && i > 0) { 21 | lines.push(currLine.trim()); 22 | currLine = ""; 23 | } 24 | currLine += `${word} `; 25 | } 26 | return [...lines, currLine.trim()]; 27 | } 28 | 29 | /** 30 | * Remove line breaks used to wrap text. This removes all line breaks except 31 | * double line break (which is a paragraph). 32 | */ 33 | export function unwrapText(str: string): string { 34 | // Preserve paragraphs (one or more empty lines) by replacing them with markers 35 | return str 36 | .replace(/\s*\n\s*\n\s*/g, "<>") 37 | .replace(/\s*\n\s*/g, " ") 38 | .replace(/<>/g, "\n\n"); 39 | } 40 | 41 | export function isEntryNode( 42 | node: TextNode | BlockNode, 43 | ): node is BlockNode & { block: EntryNode } { 44 | return node.type !== "text" && node.block?.type === "entry"; 45 | } 46 | -------------------------------------------------------------------------------- /test/at-symbol-in-comment.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @blah @article{foo,foo=bar} 6 | foo@blah @article{bar,foo=bar} 7 | `; 8 | 9 | const expected = bibtex` 10 | @blah 11 | @article{foo, 12 | foo = bar 13 | } 14 | foo@blah 15 | @article{bar, 16 | foo = bar 17 | } 18 | `; 19 | 20 | test("@ in comment", async () => { 21 | const output = await bibtexTidy(input); 22 | strictEqual(output.bibtex, expected); 23 | }); 24 | -------------------------------------------------------------------------------- /test/at-symbol-in-title.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @article{ art, 6 | Author = {No, one}, 7 | Title = {{Blah blah blah blah blah blah blah blah blah blah blah blah blah blah 8 | @blah blah blah blah blah.}}, 9 | }`; 10 | 11 | const output = bibtex` 12 | @article{art, 13 | author = {No, one}, 14 | title = {{Blah blah blah blah blah blah blah blah blah blah blah blah blah blah \@blah blah blah blah blah.}} 15 | } 16 | `; 17 | 18 | test("@ in title", async () => { 19 | const tidied = await bibtexTidy(input); // @ in title - #124 (https://github.com/sciunto-org/python-bibtexparser/issues/124) 20 | strictEqual(tidied.bibtex, output); 21 | }); 22 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Andrew Shields 2 | Copyright (c) 2014 FILSH Media GmbH 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/citation_name_starts_w_numer.bib: -------------------------------------------------------------------------------- 1 | @techreport{2013current, 2 | Author = {Lack, Kelly A.}, 3 | Date-Added = {2013-04-09 19:09:56 +0000}, 4 | Date-Modified = {2013-04-09 19:10:58 +0000}, 5 | Institution = {Ithaka S+R}, 6 | Keywords = {0sotl}, 7 | Oa-Url = {http://www.sr.ithaka.org/sites/default/files/reports/ithaka-sr-online-learning-postsecondary-education-may2012.pdf}, 8 | Title = {Current Status of Research on Online Learning in Postsecondary Education}, 9 | Year = {2013}} 10 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/citation_w_publisher.bib: -------------------------------------------------------------------------------- 1 | @incollection{hennemann2009vernetzung, 2 | title={Vernetzung in der Grundlagenforschung}, 3 | author={Hennemann, S.}, 4 | booktitle={Planungsverband Ballungsraum Frankfurt-Rhein-Main (Hrsg.): Wissensatlas FrankfurtRheinMain: die Wissensregion stellt sich vor}, 5 | pages={33--36}, 6 | year={2009}, 7 | publisher={Planungsverband, Frankfurt-Rhein-Main} 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/citations.bib: -------------------------------------------------------------------------------- 1 | @article{sample1,title={sample title}} 2 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/commentTest.bib: -------------------------------------------------------------------------------- 1 | @PREAMBLE{"\newcommand{\noopsort}[1]{}"} 2 | 3 | @COMMENT{"\nslkdjflksdjflkdsjf"} 4 | 5 | % test 6 | 7 | @comment{paglione2001mapping, 8 | title={A Mapping Survey of the 13CO and 12CO Emission in Galaxies}, 9 | author={Paglione, T.A.D. and Wall, WF and Young, J.S. and Heyer, M.H. and Richard, M. and Goldstein, M. and Kaufman, Z. and Nantais, J. and Perry, G.}, 10 | journal={The Astrophysical Journal Supplement Series}, 11 | volume={135}, 12 | pages={183}, %test end comment out 13 | year={2001}, 14 | %comment out ={} 15 | publisher={IOP % comment middel works test Publishing} 16 | } 17 | 18 | @article{sample1,title={sample title}} 19 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/crazy_delimiter.bib: -------------------------------------------------------------------------------- 1 | @article{RID:1118130922631-13,title = {Synthesis and structural characterization of unprecedented bis-asymmetric heteroscorpionate U(III) complexes: [U\{kappa(3)-H2B(pz(tBu),(Me))(pz(Me,tBu))\}(2)I] and [U\{kappa(3) -H2B(pz(tBu,Me))( pz(Me2))\}(2)I]},journal = {Inorganic Chemistry},year = {2003},author = {Maria, L and Domingos, A and Santos, I},volume = {42},number = {10},pages = {3323-3330}} 2 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/cross_ref.bib: -------------------------------------------------------------------------------- 1 | @article{Peters_2004, title={Bibtex from CrossRef}, ISSN={0263-9475}, url={http://dx.doi.org/10.2307/25564177}, DOI={10.2307/25564177}, number={109}, journal={Circa}, publisher={JSTOR}, author={Peters, Robert}, year={2004}, pages={24}} 2 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/inproceedings.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{Lysenko:2010:GMC:1839778.1839781, 2 | author = {Lysenko, Mikola and Nelaturi, Saigopal and Shapiro, Vadim}, 3 | title = {Group morphology with convolution algebras}, 4 | booktitle = {Proceedings of the 14th ACM Symposium on Solid and Physical Modeling}, 5 | series = {SPM '10}, 6 | year = {2010}, 7 | isbn = {978-1-60558-984-8}, 8 | location = {Haifa, Israel}, 9 | pages = {11--22}, 10 | numpages = {12}, 11 | url = {http://doi.acm.org/10.1145/1839778.1839781}, 12 | doi = {10.1145/1839778.1839781}, 13 | acmid = {1839781}, 14 | publisher = {ACM}, 15 | address = {New York, NY, USA} 16 | } 17 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/inspiredHEP: -------------------------------------------------------------------------------- 1 | @article{Chen:2014oha, 2 | author = "Chen, Chien-Yi and Davoudiasl, Hooman and Kim, Doojin", 3 | title = {Warped Graviton "Z + Missing Energy" Signal at Hadron 4 | Colliders}, 5 | journal = "Phys.Rev.", 6 | volume = "D89", 7 | pages = "096007", 8 | doi = "10.1103/PhysRevD.89.096007", 9 | year = "2014", 10 | eprint = "1403.3399", 11 | archivePrefix = "arXiv", 12 | primaryClass = "hep-ph", 13 | SLACcitation = "%%CITATION = ARXIV:1403.3399;%%", 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/latex_test.bib: -------------------------------------------------------------------------------- 1 | @article{sample1,title={\'Isample title\textregistered \~n {\~n}}} 2 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/quote.bib: -------------------------------------------------------------------------------- 1 | @article{sample1, 2 | title={sample "Quote" title}, 3 | title={sample "Quote" title"} 4 | } 5 | -------------------------------------------------------------------------------- /test/bibliographies/autocomplete-bibtex/wikipedia_exmaple.bib: -------------------------------------------------------------------------------- 1 | @Book{abramowitz+stegun, 2 | author = "Milton {Abramowitz} and Irene A. {Stegun}", 3 | title = "Handbook of Mathematical Functions with 4 | Formulas, Graphs, and Mathematical Tables", 5 | publisher = "Dover", 6 | year = 1964, 7 | address = "New York", 8 | edition = "ninth Dover printing, tenth GPO printing" 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Author_splitter_failure.bib: -------------------------------------------------------------------------------- 1 | @Article{Abu-Zeid_1986, 2 | Title = {Determination of the Thickness and Refractive Index of {Cu$_2$O} Thin Film Using Thermal and Optical 3 | Interferometry}, 4 | Author = {Abu-Zeid, M. E. and Rakhshani, A. E. and Al-Jassar, A. A. and Youssef, Y. A.}, 5 | Journal = {Physica Status Solidi (a)}, 6 | Year = {1986}, 7 | Pages = {613--620}, 8 | Volume = {93}, 9 | Doi = {10.1002/pssa.2210930226} 10 | } 11 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.001.bib: -------------------------------------------------------------------------------- 1 | @article{Adams2001, 2 | author = {Adams, Nancy K and DeSilva, Shanaka L and Self, Steven and Salas, Guido and Schubring, Steven and Permenter, Jason L and Arbesman, Kendra}, 3 | title = {{The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru}}, 4 | journal = {Bulletin of Volcanology}, 5 | year = {2001}, 6 | volume = {62}, 7 | pages = {493--518}, 8 | keywords = {Vulcanian eruptions,breadcrust,plinian} 9 | } 10 | 11 | @Book{Rechenberg2006a, 12 | title = {Technisches Schreiben}, 13 | publisher = {Hanser Fachbuchverlag}, 14 | year = {2006}, 15 | author = {Peter Rechenberg}, 16 | edition = {3., erw. und aktualisierte Aufl.}, 17 | isbn = {9783446406957}, 18 | pagetotal = {253}, 19 | ppn_gvk = {511633173}, 20 | subtitle = {(nicht nur) für Informatiker}, 21 | } 22 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.003.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{author:06, 2 | title = {Some publication title}, 3 | author = {Author, First and Author, Second}, 4 | crossref = {conference:06}, 5 | pages = {330—331} 6 | } 7 | @proceedings{conference:06, 8 | editor = {Editor, First and Editor, Second}, 9 | title = {Proceedings of the Xth Conference on XYZ}, 10 | booktitle = {Proceedings of the Xth Conference on XYZ (Book)}, 11 | year = {2006}, 12 | month = {oct} 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.004.bib: -------------------------------------------------------------------------------- 1 | @book{hicks2001, 2 | author = {von Hicks, III, Michael}, 3 | title = {Design of a Carbon Fiber Composite Grid Structure for the GLAST Spacecraft Using a Novel Manufacturing Technique}, 4 | publisher = {Stanford Press}, 5 | year = {2001}, 6 | address = {Palo Alto}, 7 | edition = {1st,}, 8 | isbn = {0-69-697269-4} 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.005.bib: -------------------------------------------------------------------------------- 1 | @article{Oliveira_2009, 2 | title = {USGS monitoring ecological impacts}, 3 | volume = {107}, 4 | number = {29}, 5 | journal = {Oil \& Gas Journal}, 6 | author = {Oliveira, A}, 7 | year = {2009}, 8 | pages = {29} 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.006.bib: -------------------------------------------------------------------------------- 1 | @article{test-ticket1661, 2 | title = {non-braking space: ~; accented characters: {\~n} and \~{n}; tilde in URL: \url{http://example.com/~user}} 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.008.bib: -------------------------------------------------------------------------------- 1 | @misc{american_rights_at_work_public_2012, 2 | title = {Public Service Research Foundation}, 3 | url = {http://www.americanrightsatwork.org/blogcategory-275/}, 4 | urldate = {2012-07-27}, 5 | author = {at Work, American Rights}, 6 | year = {2012}, 7 | howpublished = {http://www.americanrightsatwork.org/blogcategory-275/} 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.009.bib: -------------------------------------------------------------------------------- 1 | @article{Adams2001, 2 | author = {Adams, Nancy K and DeSilva, Shanaka L and Self, Steven and Salas, Guido and Schubring, Steven and Permenter, Jason L and Arbesman, Kendra}, 3 | journal = {Bulletin of Volcanology}, 4 | keywords = {Vulcanian eruptions,breadcrust,plinian}, 5 | pages = {493--518}, 6 | title = {{The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru}}, 7 | volume = {62}, 8 | year = {2001} 9 | } 10 | @misc{emptyreference, 11 | 12 | } 13 | @article{Adams2002, 14 | author = {Adams, Nancy K and DeSilva, Shanaka L and Self, Steven and Salas, Guido and Schubring, Steven and Permenter, Jason L and Arbesman, Kendra}, 15 | journal = {Bulletin of Volcanology}, 16 | keywords = {Vulcanian eruptions,breadcrust,plinian}, 17 | pages = {493--518}, 18 | title = {{The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru}}, 19 | volume = {62}, 20 | year = {2001} 21 | } 22 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.010.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{Hulse2009, 2 | author = {Hulse, Jason Van and Khoshgoftaar, Taghi M. and Napolitano, Amri and Wald, Randall}, 3 | title = {Feature Selection with High-Dimensional Imbalanced Data\#}, 4 | booktitle = {ICDM Workshops}, 5 | editor = {Saygin, Yücel and Yu, Jeffrey Xu and Kargupta, Hillol and Wang, Wei and Ranka, Sanjay and Yu, Philip S. and Wu, Xindong}, 6 | pages = {507-514}, 7 | publisher = {IEEE Computer Society}, 8 | added-at = {2010-01-27T00:00:00.000+0100}, 9 | biburl = {http://www.bibsonomy.org/bibtex/2c97a29e90fbd958a0990360f70252458/dblp}, 10 | crossref = {conf/icdm/2009w}, 11 | date = {2010-01-27}, 12 | description = {dblp}, 13 | ee = {http://doi.ieeecomputersociety.org/10.1109/ICDMW.2009.35}, 14 | groups = {selekcja}, 15 | interhash = {aad604c231737dbf8f6155082e3535ae}, 16 | intrahash = {c97a29e90fbd958a0990360f70252458}, 17 | isbn = {978-0-7695-3902-7}, 18 | keywords = {dblp}, 19 | owner = {sstudent}, 20 | timestamp = {2011.01.03}, 21 | url = {http://dblp.uni-trier.de/db/conf/icdm/icdmw2009.html#HulseKNW09} 22 | } 23 | 24 | @inproceedings{conf/icdm/2009w, 25 | title = {Blah}, 26 | } 27 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.011.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{Klassen2010, 2 | author = {Klassen, Myungsook and Kim, Nyunsu and Liu, Wei Ming}, 3 | title = {Empirical Study of Support Vector Machine Kernels with Applications 4 | to Microarray Data}, 5 | booktitle = {CATA}, 6 | year = {2010}, 7 | pages = {25-30}, 8 | note = {svm liniowe najlepsze}, 9 | bibsource = {DBLP, http://dblp.uni-trier.de}, 10 | groups = {klasyfikacja}, 11 | owner = {sstudent}, 12 | timestamp = {2011.03.22} 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.012.bib: -------------------------------------------------------------------------------- 1 | @incollection{moller2012conceptsrisksafety, 2 | title = {{The Concepts of Risk and Safety}}, 3 | booktitle = {{Handbook of Risk Theory: Epistemology, Decision Theory, Ethics, and Social Implications of Risk}}, 4 | publisher = {{Springer}}, 5 | author = {M\"{o}ller, Niklas}, 6 | year = {2012} 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX.014.bib: -------------------------------------------------------------------------------- 1 | @article{BibTeXEscapeTest1, 2 | title = {\textbackslash\textbackslash\{\}: \\{}} 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Better_BibTeX_Import_2.bib: -------------------------------------------------------------------------------- 1 | @book{abramowitz+stegun, 2 | author = {{Abramowitz}, Milton and {Stegun}, Irene A.}, 3 | title = {Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables}, 4 | publisher = {Dover}, 5 | year = {1964}, 6 | address = {New York}, 7 | edition = {ninth Dover printing, tenth GPO printing} 8 | } 9 | @book{Torre2008, 10 | author = {Torre, Joe and Verducci, Tom}, 11 | publisher = {Doubleday}, 12 | title = {The Yankee Years}, 13 | year = {2008}, 14 | isbn = {0385527403} 15 | } 16 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/BibLaTeX_Patent_author_handling_type_1060.bib: -------------------------------------------------------------------------------- 1 | @patent{laufenberg, 2 | author = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut 3 | and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann, 4 | Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld, 5 | Franz and Thiel, Alexander and Braun, Harald and Ebner, 6 | Norbert}, 7 | title = {Elektrische Einrichtung und Betriebsverfahren}, 8 | number = 1700367, 9 | date = {2006-09-13}, 10 | holder = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische 11 | Motoren Werke AG}}, 12 | type = {patenteu}, 13 | url = {http://v3.espacenet.com/textdoc?IDX=EP1700367}, 14 | } 15 | 16 | @patent{sorace, 17 | author = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven 18 | A.}, 19 | title = {High-Speed Digital-to-{RF} Converter}, 20 | number = 5668842, 21 | date = {1997-09-16}, 22 | holder = {{Hughes Aircraft Company}}, 23 | type = {patentus}, 24 | } 25 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/BibTeX_import;_preamble_with_def_create_problems_732.bib: -------------------------------------------------------------------------------- 1 | 2 | @preamble{ 3 | "\def\ocirc#1{\ifmmode\setbox0=\hbox{$#1$}\dimen0=\ht0 4 | \advance\dimen0 by1pt\rlap{\hbox to\wd0{\hss\raise\dimen0 5 | \hbox{\hskip.2em$\scriptscriptstyle\circ$}\hss}}#1\else 6 | {\accent"17 #1}\fi} " 7 | } 8 | @incollection {MR1870153, 9 | AUTHOR = {Franc{\ocirc{u}}, Jan and Krej{\v{c}}{\'{\i}}, Pavel}, 10 | TITLE = {Homogenization of scalar wave equation with hysteresis 11 | operator}, 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Biblatex_Annotation_Import_Bug_613.bib: -------------------------------------------------------------------------------- 1 | @Book{Demus1984, 2 | Title = {The Mosaics of San Marco in Venice}, 3 | Author = {Demus, Otto}, 4 | Date = {1984}, 5 | Location = {Chicago}, 6 | Publisher = {University of Chicago Press}, 7 | Annotation = {a "monumental" work on the mosaics of San Marco}, 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Endnote_should_parse.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{boo, 3 | author = {Huang, Y. and Mucke, L.}, 4 | title = {Alzheimer mechanisms and therapeutic strategies}, 5 | journal = {Cell}, 6 | volume = {148}, 7 | number = {6}, 8 | pages = {1204-22}, 9 | note = {Huang, Yadong 10 | Mucke, Lennart 11 | AG011385/AG/NIA NIH HHS/ 12 | AG022074/AG/NIA NIH HHS/ 13 | Cell. 2012 Mar 16;148(6):1204-22.}, 14 | abstract = {There are still no effective treatments to prevent, halt, or reverse Alzheimer's disease, but research advances over the past three decades could change this gloomy picture. Genetic studies demonstrate that the disease has multiple causes. Interdisciplinary approaches combining biochemistry, molecular and cell biology, and transgenic modeling have revealed some of its molecular mechanisms. Progress in chemistry, radiology, and systems biology is beginning to provide useful biomarkers, and the emergence of personalized medicine is poised to transform pharmaceutical development and clinical trials. However, investigative and drug development efforts should be diversified to fully address the multifactoriality of the disease.}, 15 | year = {2012} 16 | } 17 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Failure_to_handle_unparsed_author_names_(92).bib: -------------------------------------------------------------------------------- 1 | @InCollection{Madelung_1998_LB_10681727_56, 2 | Title = {Cuprous oxide ({Cu$_2$O}) crystal structure, lattice parameters}, 3 | Author = {Madelung, O. and others}, 4 | Booktitle = {{L}andolt-{B}\"ornstein}, 5 | Publisher = {Springer-Verlag}, 6 | Year = {1998}, 7 | Editor = {Madelung, O. and R\"ossler, U. and Schulz, M.}, 8 | Series = {SpringerMaterials - The Landolt-B\"ornstein Database}, 9 | Volume = {III/41c}, 10 | Doi = {10.1007/10681727_56}, 11 | Owner = {Francesco}, 12 | Timestamp = {2010.02.22} 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_Jabref_fileDirectory_unexpected_reference_type_1058.bib: -------------------------------------------------------------------------------- 1 | % Encoding: UTF-8 2 | @ARTICLE{springerlink:10.1007/s10344-009-0327-7, 3 | author = {Barrio, Isabel and Acevedo, Pelayo and Tortosa, Francisco}, 4 | title = {Assessment of methods for estimating wild rabbit population abundance 5 | in agricultural landscapes}, 6 | journal = {European Journal of Wildlife Research}, 7 | year = {2010}, 8 | volume = {56}, 9 | pages = {335-340}, 10 | note = {10.1007/s10344-009-0327-7}, 11 | affiliation = {University of Cordoba Department of Zoology Campus de Rabanales Ed. 12 | Darwin 14071 Córdoba Spain}, 13 | issn = {1612-4642}, 14 | issue = {3}, 15 | keyword = {Biomedical and Life Sciences}, 16 | owner = {tiago}, 17 | publisher = {Springer Berlin / Heidelberg}, 18 | subdatabase = {distance}, 19 | timestamp = {2011.06.17}, 20 | url = {http://dx.doi.org/10.1007/s10344-009-0327-7} 21 | } 22 | 23 | @Talk{Afonso2011, 24 | author = {Anabela Afonso and Russell Alpizar-Jara}, 25 | title = {Amostragem em duas fases adaptativa para estimar a abundância de populações raras}, 26 | year = {2011}, 27 | file = {:2.pdf:PDF;stuff:1.pdf:PDF}, 28 | location = {Poster apresentado no Congresso da SPE}, 29 | owner = {tiago}, 30 | timestamp = {2011.10.04}, 31 | } 32 | 33 | @Comment{jabref-meta: databaseType:bibtex;} 34 | 35 | @Comment{jabref-meta: fileDirectory:/home/emile/github/better-bibtex/test/fixtures/import/attachments;} 36 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_fails_to_perform_@String_substitutions_154.bib: -------------------------------------------------------------------------------- 1 | @String{pub-FRED = "Freds Publishing"} 2 | @String{pub-FRED:adr = "London, UK"} 3 | 4 | @Book{Bert:2001:SQL, 5 | author = "R. A. Bert", 6 | title = "SQL is great", 7 | publisher = pub-FRED, 8 | address = pub-FRED:adr, 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_location_to_event-place_for_conference_papers.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{Mostafa:2009:TPA:1596655.1596682, 2 | author = {Mostafa, Nagy and Krintz, Chandra}, 3 | title = {Tracking Performance Across Software Revisions}, 4 | booktitle = {Proceedings of the 7th International Conference on Principles and Practice of Programming in Java}, 5 | series = {PPPJ '09}, 6 | year = {2009}, 7 | isbn = {978-1-60558-598-7}, 8 | location = {Calgary, Alberta, Canada}, 9 | pages = {162--171}, 10 | numpages = {10}, 11 | url = {http://doi.acm.org/10.1145/1596655.1596682}, 12 | doi = {10.1145/1596655.1596682}, 13 | acmid = {1596682}, 14 | publisher = {ACM}, 15 | address = {New York, NY, USA}, 16 | keywords = {calling context tree, performance-aware revision control, profiling}, 17 | } 18 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_of_langle_and_rangle_TeX_commands_1468.bib: -------------------------------------------------------------------------------- 1 | @article{Zhang_2015, 2 | author = {Zhang, Zhi and Zheng, Kun and Lu, Zhen-Yu and Chen, Ping-Ping and Lu, Wei and Zou, Jin}, 3 | year = {2015}, 4 | month = feb, 5 | volume = {15}, 6 | pages = {876--882}, 7 | doi = {10.1021/nl503556a}, 8 | journal = {Nano Lett.}, 9 | number = {2}, 10 | title = {Catalyst {{Orientation}}-{{Induced Growth}} of {{Defect}}-{{Free Zinc}}-{{Blende Structured}} $\langle{}00\overline{1}\rangle$ {{InAs Nanowires}}} 11 | } 12 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_support_for_the_online_type_in_BBT_1358.bib: -------------------------------------------------------------------------------- 1 | @online{WEB:intel-ark-atom, 2 | Author = {{Intel}}, 3 | Title = {{Intel Atom E3826 specifications}}, 4 | Url = {https://ark.intel.com/content/www/us/en/ark/products/78477/intel-atom-processor-e3826-1m-cache-1-46-ghz.html}, 5 | Year = {2019}} 6 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Import_support_for_the_online_type_in_BBT_1358.roundtrip.bib: -------------------------------------------------------------------------------- 1 | 2 | @online{WEB:intel-ark-atom, 3 | title = {Intel Atom {{E3826}} Specifications}, 4 | author = {{Intel}}, 5 | date = {2019}, 6 | url = {https://ark.intel.com/content/www/us/en/ark/products/78477/intel-atom-processor-e3826-1m-cache-1-46-ghz.html} 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Importing_changes_Journal_to_The_Journal_1601.bib: -------------------------------------------------------------------------------- 1 | @Article{id1, 2 | author = {Family Name, First Name}, 3 | title = {Title}, 4 | journal = {Journal}, 5 | year = {2020}, 6 | volume = {1}, 7 | number = {2}, 8 | pages = {3}, 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Issues_with_round_instead_of_curly_braces_do_not_import_correctly_871.bib: -------------------------------------------------------------------------------- 1 | @String{MCDERMOTT = "McDermott, Drew V."} 2 | @techreport(McDermott:72, 3 | author = MCDERMOTT # { and Gerald J. Sussman}, 4 | year = {1972}, 5 | month = May, 6 | institution = {MIT Artificial Intelligence Laboratory}, 7 | title = {The {\sc CONNIVER} Reference Manual} 8 | ) 9 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Jabref_groups_import_does_not_work_717.2.10.bib: -------------------------------------------------------------------------------- 1 | % This file was created with JabRef 2.10. 2 | % Encoding: ISO8859_1 3 | 4 | 5 | @Article{Doe-2017, 6 | Title = {The paper in my-subgroup-2}, 7 | Author = {John Doe}, 8 | Year = {2017}, 9 | 10 | Owner = {klein}, 11 | Timestamp = {2017.09.11} 12 | } 13 | 14 | @Article{Other-, 15 | Title = {The article in my-other-subgroup-2}, 16 | Author = {I. Other}, 17 | 18 | Owner = {klein}, 19 | Timestamp = {2017.09.11} 20 | } 21 | 22 | @Article{Unkonw-, 23 | Title = {JR2: paper not in a group}, 24 | Author = {I Unkonw}, 25 | 26 | Owner = {klein}, 27 | Timestamp = {2017.09.11} 28 | } 29 | 30 | @comment{jabref-meta: groupsversion:3;} 31 | 32 | @comment{jabref-meta: groupstree: 33 | 0 AllEntriesGroup:; 34 | 1 ExplicitGroup:my-main-group-2\;2\;; 35 | 2 ExplicitGroup:my-subgroup-2\;0\;Doe-2017\;; 36 | 2 ExplicitGroup:my-other-subgroup-2\;0\;Other-\;; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Jabref_groups_import_does_not_work_717.3.8.bib: -------------------------------------------------------------------------------- 1 | % Encoding: ISO-8859-1 2 | 3 | @Article{Doe-2017, 4 | author = {John Doe}, 5 | title = {The paper in my-subgroup-3}, 6 | year = {2017}, 7 | groups = {my-subgroup-3}, 8 | owner = {klein}, 9 | timestamp = {2017.09.11}, 10 | } 11 | 12 | @Article{Other-, 13 | author = {I. Other}, 14 | title = {The article in my-other-subgroup-3}, 15 | groups = {my-other-subgroup-3}, 16 | owner = {klein}, 17 | timestamp = {2017.09.11}, 18 | } 19 | 20 | @Article{Unkonw-, 21 | author = {I Unkonw}, 22 | title = {the paper in my-subgroup-3 and my-other-subgroup-3}, 23 | groups = {my-subgroup-3, my-other-subgroup-3}, 24 | owner = {klein}, 25 | timestamp = {2017.09.11}, 26 | } 27 | 28 | @Article{Unkonw, 29 | author = {I Unkonw}, 30 | title = {JR3: paper not in a group}, 31 | groups = {my-main-group-3}, 32 | owner = {klein}, 33 | timestamp = {2017.09.11}, 34 | } 35 | 36 | @Comment{jabref-meta: databaseType:bibtex;} 37 | 38 | @Comment{jabref-meta: groupstree: 39 | 0 AllEntriesGroup:; 40 | 1 ExplicitGroup:my-main-group-3\;2\;; 41 | 2 ExplicitGroup:my-subgroup-3\;0\;; 42 | 3 ExplicitGroup:sub-sub-group-3\;0\;; 43 | 2 ExplicitGroup:my-other-subgroup-3\;0\;; 44 | } 45 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Emiliano Heyns 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/LaTeX_commands_in_Zotero_should_be_exported_untouched_1380.bib: -------------------------------------------------------------------------------- 1 | @book{MittelbachLaTeXCompanion2006, 2 | langid = {french}, 3 | location = {{Paris}}, 4 | title = {\LaTeX{} Companion}, 5 | edition = {2}, 6 | isbn = {978-2-7440-7182-9}, 7 | pagetotal = {1008}, 8 | publisher = {{Pearson Education France}}, 9 | date = {2006-02}, 10 | author = {Mittelbach, Frank and Goossens, Michel}, 11 | translator = {Andr\'e, Jacques and Bellet, Benoît and Charpentier, Jean-Côme and Hufflen, Jean-Michel and Soulet, Yves} 12 | } 13 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/LaTeX_commands_in_Zotero_should_be_exported_untouched_1380.roundtrip.bib: -------------------------------------------------------------------------------- 1 | @book{MittelbachLaTeXCompanion2006, 2 | title = {\LaTeX{} Companion}, 3 | author = {Mittelbach, Frank and Goossens, Michel}, 4 | date = {2006-02}, 5 | edition = {2}, 6 | publisher = {Pearson Education France}, 7 | location = {Paris}, 8 | isbn = {978-2-7440-7182-9}, 9 | langid = {french}, 10 | pagetotal = {1008}, 11 | translator = {Andr\'e, Jacques and Bellet, Benoît and Charpentier, Jean-Côme and Hufflen, Jean-Michel and Soulet, Yves} 12 | } 13 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Math_formatting_lost_on_import_627.bib: -------------------------------------------------------------------------------- 1 | @Article{Bonca:2012in, 2 | author = {Bon{\v c}a, J and Mierzejewski, M and Vidmar, L}, 3 | title = {{Nonequilibrium Propagation and Decay of a Bound Pair in Driven $t$-$J$ Models}}, 4 | journal = {Phys. Rev. Lett.}, 5 | year = {2012}, 6 | volume = {109}, 7 | number = {15}, 8 | pages = {156404}, 9 | month = oct, 10 | doi = {10.1103/physrevlett.109.156404}, 11 | } 12 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Math_markup_to_unicode_not_always_imported_correctly_472.bib: -------------------------------------------------------------------------------- 1 | @InProceedings{test_citation1, 2 | Title = {{T}est {T}itle {W}ith 100~$\mu${J}, 200\,{\mbox{$\mu$}}{J} {E}nergy, and $\pm$0.1\% {A}ccuracy, 0.2\,mm$^2$ {S}ize, and $-$50\,d{B} {A}ttenuation}, 3 | Author = {Doe, J. and Smith, R.}, 4 | Booktitle = IEEE_J_PROC, 5 | Year = {2016}, 6 | Month = {Feb}, 7 | Pages = {300--301}, 8 | Abstract = {Abstract here}, 9 | DOI = {10.1109/JPROC.2016.2526118}, 10 | ISSN = {0193-6530}, 11 | Keywords = {Keyword 1; Keyword 2} 12 | } 13 | 14 | @InProceedings{test_citation2, 15 | Title = {{T}est {T}itle with space\quad quad, space\;semi-colon, space\:colon, space\,comma, space~nbsp}, 16 | Author = {Doe, J. and Smith, R.}, 17 | Booktitle = IEEE_J_PROC, 18 | Year = {2016}, 19 | Month = {Feb}, 20 | Pages = {300--301}, 21 | Abstract = {Abstract here}, 22 | DOI = {10.1109/JPROC.2016.2526118}, 23 | ISSN = {0193-6530}, 24 | Keywords = {Keyword 1; Keyword 2} 25 | } 26 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Math_markup_to_unicode_not_always_imported_correctly_472.roundtrip.bib: -------------------------------------------------------------------------------- 1 | 2 | @inproceedings{test_citation1, 3 | title = {Test {{Title With}} 100 {$\mu$}{{J}}, 200\,{$\mu$}{{J Energy}}, and {$\pm$}0.1\% {{Accuracy}}, 0.2\,Mm{$^2$} {{Size}}, and -50\,{{dB Attenuation}}}, 4 | booktitle = IEEE_J_PROC, 5 | author = {Doe, J. and Smith, R.}, 6 | year = {2016}, 7 | month = feb, 8 | pages = {300--301}, 9 | issn = {0193-6530}, 10 | doi = {10.1109/JPROC.2016.2526118}, 11 | abstract = {Abstract here}, 12 | keywords = {Keyword 1,Keyword 2} 13 | } 14 | 15 | @inproceedings{test_citation2, 16 | title = {Test {{Title}} with Space\hspace{1em}Quad, Space\;Semi-Colon, Space\:Colon, Space\,Comma, Space Nbsp}, 17 | booktitle = IEEE_J_PROC, 18 | author = {Doe, J. and Smith, R.}, 19 | year = {2016}, 20 | month = feb, 21 | pages = {300--301}, 22 | issn = {0193-6530}, 23 | doi = {10.1109/JPROC.2016.2526118}, 24 | abstract = {Abstract here}, 25 | keywords = {Keyword 1,Keyword 2} 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Problem_when_importing_BibTeX_entries_with_square_brackets_94.bib: -------------------------------------------------------------------------------- 1 | @Article{Adachi_1989, 2 | Title = {Cluster model investigation of the electronic state and chemical bond in cuprous and cupric oxide}, 3 | Author = {Adachi, H. and Takano, M.}, 4 | Journal = {Physica C}, 5 | Year = {1989}, 6 | 7 | Month = jan, 8 | Number = {1}, 9 | Pages = {169--179}, 10 | Volume = {157}, 11 | 12 | Abstract = {Cluster model calculations have been carried out to study the electronic state and the chemical bonding in 13 | Cu2O and CuO as well as YBa2Cu3O7 and YBa2Cu3O6. The clusters used are Cu4O14-9, Cu4O16-12, Cu3O17-12 and Cu3O15-10, 14 | respectively, each being embedded in an appropriate electrostatic potential reflecting the crystal structure. The 15 | covalent interaction between Cu and O is most significant in the cluster for the high-temperature superconductor 16 | YBa2CuO7. It is remarkable that O 2p[pi] holes are created near the Fermi level and stabilized in the O----Cu+---O- 17 | linear bond formed in the basal Cu2O plane of the cluster for YBa2Cu3O7. A charge disproportionation takes place both in 18 | the model clusters for YBa2Cu3O7 and YBa2Cu3O6, while a spin polarization is seen only in the latter. The similarity and 19 | dissimilarity of Cu atoms in those oxides are discussed.}, 20 | Doi = {10.1016/0921-4534(89)90484-X}, 21 | ISSN = {0921-4534}, 22 | Keywords = {CuO}, 23 | Owner = {Francesco}, 24 | Timestamp = {2010.07.01} 25 | } 26 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Spaces_lost_when_expanding_string_variables_during_import_1081.bib: -------------------------------------------------------------------------------- 1 | @string{j = {a space between this }} 2 | @article{key, 3 | author = "Author", 4 | title = "Title", 5 | year = 1990, 6 | journal = j # "and this" 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/Wrong_ring-above_import_1115.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{rehurek_lrec, 2 | title = {{Software Framework for Topic Modelling with Large Corpora}}, 3 | author = {Radim {\v R}eh{\r u}{\v r}ek and Petr Sojka}, 4 | booktitle = {{Proceedings of the LREC 2010 Workshop on New 5 | Challenges for NLP Frameworks}}, 6 | pages = {45--50}, 7 | year = 2010, 8 | month = May, 9 | day = 22, 10 | publisher = {ELRA}, 11 | address = {Valletta, Malta}, 12 | url={http://is.muni.cz/publication/884893/en}, 13 | language={English} 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/eprinttype_field_dropped_on_import_959.bib: -------------------------------------------------------------------------------- 1 | @Article{Zach2004a, 2 | author = {Richard Zach}, 3 | title = {Decidability of Quantified Propositional 4 | Intuitionistic Logic and S4 on Trees of Height and 5 | Arity $\le\omega$}, 6 | journal = {Journal of Philosophical Logic}, 7 | year = 2004, 8 | volume = 33, 9 | pages = {155--164}, 10 | doi = {10.1023/B:LOGI.0000021744.10237.d0}, 11 | scholar = {15184825758825835157,15198214561219081821}, 12 | eprinttype = {philpapers}, eprint = {ZACDOQ}, 13 | keywords = {article} 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/import_software_related_biblatex_entries_1544.bib: -------------------------------------------------------------------------------- 1 | @SOFTWAREVERSION{delebecque:hal-02090402v1, 2 | ABSTRACT = {Software for Numerical Computation freely distributed.}, 3 | AUTHOR = {Delebecque, Fran{ç}ois and Gomez, Claude and Goursat, Maurice and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe}, 4 | INSTITUTION = {Inria}, 5 | LICENSE = {Scilab license}, 6 | URL = {https://www.scilab.org/}, 7 | DATE = {1994-01}, 8 | FILE = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz}, 9 | HAL_ID = {hal-02090402}, 10 | HAL_VERSION = {v1}, 11 | NOTE = {First Scilab version. It was distributed by anonymous ftp.}, 12 | REPOSITORY = {https://github.com/scilab/scilab}, 13 | SWHID = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a; origin=https://hal.archives-ouvertes.fr/hal-02090402}, 14 | TITLE = {Scilab}, 15 | VERSION = {1.1}, 16 | } 17 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/importing_a_title-cased_bib_1246.bib: -------------------------------------------------------------------------------- 1 | @article{Frit2, 2 | author = {Fritz, U. and Corti, C. and P\"{a}ckert, M.}, 3 | doi = {10.1007/s13127-011-0069-8}, 4 | journal = {Actes du $4^{\textrm{ème}}$ Congrès Français d'Acoustique}, 5 | pages = {71-80}, 6 | timestamp = {2015-02-24 12:14:36 +0100}, 7 | title = {Test of markupconversion: Italics, bold, superscript, subscript, and small caps: Mitochondrial DNA$_{\textrm{2}}$ sequences suggest unexpected phylogenetic position of Corso-Sardinian grass snakes (\textit{Natrix cetti}) and \textbf{do not} support their \textsc{species status}, with notes on phylogeography and subspecies delineation of grass snakes.}, 8 | volume = {12}, 9 | year = {2012} 10 | } 11 | 12 | @article{AdcroftETAL:1997, 13 | author = "Adcroft, Alistair and Chris Hill 14 | and John Marshall", 15 | year = "1997", 16 | title = "Representation of Topography by Shaved Cells in a 17 | Height Coordinate Ocean Model", 18 | journal = "Monthly Weather Review", 19 | volume = "125", 20 | pages = "2293-2315"} 21 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/importing_a_title-cased_bib_1246.roundtrip.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{AdcroftETAL:1997, 3 | title = {Representation of Topography by Shaved Cells in a Height Coordinate Ocean Model}, 4 | author = {Adcroft, Alistair and Hill, Chris and Marshall, John}, 5 | year = {1997}, 6 | volume = {125}, 7 | pages = {2293--2315}, 8 | journal = {Monthly Weather Review} 9 | } 10 | 11 | @article{Frit2, 12 | title = {Test of Markupconversion: {{Italics}}, Bold, Superscript, Subscript, and Small Caps: {{Mitochondrial DNA}}{$_2$} Sequences Suggest Unexpected Phylogenetic Position of {{Corso}}-{{Sardinian}} Grass Snakes ({{{\emph{Natrix cetti}}}}) and {{{\textbf{do not}}}} Support Their {{{\textsc{species status}}}}, with Notes on Phylogeography and Subspecies Delineation of Grass Snakes.}, 13 | author = {Fritz, U. and Corti, C. and P{\"a}ckert, M.}, 14 | year = {2012}, 15 | volume = {12}, 16 | pages = {71--80}, 17 | doi = {10.1007/s13127-011-0069-8}, 18 | journal = {Actes du 4\textsuperscript{\`eme} Congr\`es Fran\c{c}ais d'Acoustique}, 19 | timestamp = {2015-02-24 12:14:36 +0100} 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/space_after_citekey_creates_confusion_716.bib: -------------------------------------------------------------------------------- 1 | @Article{HoSp-87 , 2 | author = {Hoffmann}, 3 | title = {Phase transitions}, 4 | } 5 | 6 | @Book{HoSp-90, 7 | editor = {Sprekels}, 8 | title = {Free Boundary Problems}, 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/support_Local-Zo-Url-x_field_from_BibDesk2Zotero_attachments_667.bib: -------------------------------------------------------------------------------- 1 | @techreport{Abbott-2007-aa, 2 | Address = {Brussels, Belgium}, 3 | Author = {Abbott, Roderick}, 4 | Class = {States & Markets 2009, Diss Tax & Democracy 2010ff}, 5 | Date-Modified = {2014-06-14 15:13:01 +0000}, 6 | Institution = {European Center for International Political Economy}, 7 | Keywords = {Political Economy,Finance, Markets}, 8 | Title = {Are Developing Countries Deterred from Using the WTO Dispute Settlement System? - Participation of Developing Countries in the DSM in the years 1995-2005}, 9 | Year = {2007}, 10 | Local-Zo-Url-1 = {./attachments/1.pdf} 11 | } 12 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/tex.origdate_ignored_in_citekey_generation_1696.bib: -------------------------------------------------------------------------------- 1 | 2 | @online{bardos2019, 3 | ids = {Titi_Gwiazda_conservation_entropy}, 4 | title = {Onsager's Conjecture in Bounded Domains for the Conservation of Entropy and Other Companion Laws}, 5 | author = {Bardos, Claude and Gwiazda, Piotr and Świerczewska-Gwiazda, Agnieszka and Titi, Edriss S. and Wiedemann, Emil}, 6 | date = {2019-02}, 7 | origdate = {1901-02-03}, 8 | url = {http://arxiv.org/abs/1902.07120}, 9 | urldate = {2020-09-13}, 10 | abstract = {We show that weak solutions of general conservation laws in bounded domains conserve their generalized entropy, and other respective companion laws, if they possess a certain fractional differentiability of order 1/3 in the interior of the domain, and if the normal component of the corresponding fluxes tend to zero as one approaches the boundary. This extends various recent results of the authors.}, 11 | archivePrefix = {arXiv}, 12 | eprint = {arXiv:1902.07120}, 13 | eprinttype = {arxiv}, 14 | keywords = {Mathematics - Analysis of PDEs}, 15 | primaryClass = {math} 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/bibliographies/better-bibtex/unknown_command_handler_1733.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{2004A&A...424..927C, 2 | author = {{Caputo}, F. and {Castellani}, V. and {Degl'Innocenti}, S. and {Fiorentino}, G. and {Marconi}, M.}, 3 | title = "{Bright metal-poor variables: Why ``Anomalous'' Cepheids?}", 4 | journal = {\aap}, 5 | keywords = {stars: variables: Cepheids, stars: evolution, Astrophysics}, 6 | year = 2004, 7 | month = sep, 8 | volume = {424}, 9 | pages = {927-934}, 10 | doi = {10.1051/0004-6361:20040307}, 11 | archivePrefix = {arXiv}, 12 | eprint = {astro-ph/0405395}, 13 | primaryClass = {astro-ph}, 14 | adsurl = {https://ui.adsabs.harvard.edu/abs/2004A&A...424..927C}, 15 | adsnote = {Provided by the SAO/NASA Astrophysics Data System} 16 | } 17 | -------------------------------------------------------------------------------- /test/bibliographies/biber/annotations.bib: -------------------------------------------------------------------------------- 1 | @MISC{ann1, 2 | AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3}, 3 | AUTHOR-an = {1:family=student;2=corresponding}, 4 | TITLE = {The Title}, 5 | TITLE-an = {=one, two}, 6 | LANGUAGE = {english and french}, 7 | LANGUAGE-an = {1=ann1; 2=ann2, ann3; =ann4} 8 | } 9 | 10 | @MISC{ann2, 11 | AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3}, 12 | AUTHOR-an = {1:family="student";2=corresponding}, 13 | TITLE = {The Title}, 14 | TITLE-an:default = {="one"}, 15 | TITLE-an:french = {="un"}, 16 | LANGUAGE = {english and french}, 17 | LANGUAGE-an = {1=ann1; 2="ann2"; =ann4}, 18 | LANGUAGE-an:alt = {1=annx; 2="anny"; =annz} 19 | } 20 | -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding1.bib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/test/bibliographies/biber/encoding1.bib -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding2.bib: -------------------------------------------------------------------------------- 1 | % This is a UTF-8 encoded file 2 | @BOOK{testŠ, 3 | YEAR = {1999}, 4 | AUTHOR = {Edward Encalcer}, 5 | TITLE = {Šome title}, 6 | PUBLISHER = {A press} 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding3.bib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/test/bibliographies/biber/encoding3.bib -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding4.bib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/test/bibliographies/biber/encoding4.bib -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding5.bib: -------------------------------------------------------------------------------- 1 | % This is a UTF-8 encoded file 2 | @BOOK{test, 3 | AUTHOR = {Edward Encalcer}, 4 | YEAR = {1999}, 5 | TITLE = {à titlé}, 6 | PUBLISHER = {A press} 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/biber/encoding6.bib: -------------------------------------------------------------------------------- 1 | % This is a UTF-8 encoded file 2 | @BOOK{test, 3 | AUTHOR = {Edward Encalcer}, 4 | YEAR = {1999}, 5 | TITLE = {↑à titlé}, 6 | PUBLISHER = {A press} 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/biber/extratitle.bib: -------------------------------------------------------------------------------- 1 | @BOOK{L1, 2 | AUTHOR = {John Doe}, 3 | TITLE = {Title 1}, 4 | YEAR = {1995}, 5 | } 6 | 7 | @BOOK{L2, 8 | AUTHOR = {John Doe}, 9 | TITLE = {Title 1}, 10 | YEAR = {1996}, 11 | } 12 | 13 | @BOOK{L3, 14 | TITLE = {Title 2}, 15 | YEAR = {1995}, 16 | } 17 | 18 | @BOOK{L4, 19 | TITLE = {Title 2}, 20 | YEAR = {1995}, 21 | } 22 | 23 | @BOOK{L5, 24 | TITLE = {Title 1}, 25 | YEAR = {1995}, 26 | } 27 | 28 | @BOOK{L6, 29 | SHORTTITLE = {Title A}, 30 | TITLE = {Title 3}, 31 | YEAR = {1995}, 32 | } 33 | 34 | @BOOK{L7, 35 | TITLE = {Title A}, 36 | YEAR = {1995}, 37 | } 38 | 39 | @BOOK{L8, 40 | AUTHOR = {Billy Brown}, 41 | TITLE = {Title A}, 42 | YEAR = {1934} 43 | } 44 | 45 | @BOOK{L9, 46 | AUTHOR = {Billy Brown}, 47 | TITLE = {Title B}, 48 | YEAR = {1932} 49 | } 50 | 51 | @BOOK{L10, 52 | AUTHOR = {Clive Cautious}, 53 | TITLE = {Title A}, 54 | YEAR = {1946} 55 | } 56 | 57 | @BOOK{L11, 58 | TITLE = {Titular Titilation}, 59 | YEAR = {1946} 60 | } 61 | 62 | @BOOK{L12, 63 | YEAR = {1943} 64 | } 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /test/bibliographies/biber/extratitleyear.bib: -------------------------------------------------------------------------------- 1 | @BOOK{L1, 2 | TITLE = {Title 1}, 3 | YEAR = {1995}, 4 | PUBLISHER = {puba} 5 | } 6 | 7 | @BOOK{L2, 8 | TITLE = {Title 1}, 9 | YEAR = {1995}, 10 | PUBLISHER = {pubb} 11 | } 12 | 13 | @BOOK{L3, 14 | AUTHOR = {Jim Smith}, 15 | YEAR = {1995}, 16 | } 17 | 18 | @BOOK{L4, 19 | TITLE = {Title 1}, 20 | YEAR = {1996}, 21 | } 22 | 23 | @BOOK{L5, 24 | SHORTTITLE = {Title A}, 25 | TITLE = {Title 1}, 26 | YEAR = {1995}, 27 | } 28 | 29 | @BOOK{LY1, 30 | AUTHOR = {Arthur Example}, 31 | DATE = {2006/2009}, 32 | TITLE = {Some title} 33 | } 34 | 35 | @BOOK{LY2, 36 | AUTHOR = {Arthur Example}, 37 | DATE = {2006}, 38 | TITLE = {Some title} 39 | } 40 | 41 | @BOOK{LY3, 42 | AUTHOR = {Arthur Example}, 43 | DATE = {2006/}, 44 | TITLE = {Some title} 45 | } 46 | -------------------------------------------------------------------------------- /test/bibliographies/biber/full-bbl.bib: -------------------------------------------------------------------------------- 1 | @BOOK{F1, 2 | IDS = {F1a}, 3 | SHORTHAND = {\emph{A}}, 4 | SORTSHORTHAND = {A}, 5 | AUTHOR = {John Doe}, 6 | TITLE = {The Fullness of Times}, 7 | YEAR = {1995} 8 | } 9 | 10 | 11 | @MISC{c1, 12 | AUTHOR = {Benny Balgreen}, 13 | TITLE = {Names We Invent}, 14 | YEAR = {1900} 15 | } -------------------------------------------------------------------------------- /test/bibliographies/biber/labelalphaname.bib: -------------------------------------------------------------------------------- 1 | @BOOK{lant1, 2 | AUTHOR = {Arthur Smith} 3 | } 4 | 5 | % per-entry 6 | @BOOK{lant2, 7 | OPTIONS = {labelalphanametemplatename=test2}, 8 | AUTHOR = {Arthur Smith} 9 | } 10 | 11 | % per-namelist 12 | @BOOK{lant3, 13 | AUTHOR = {labelalphanametemplatename=test3 and given=Arthur, family=Smith} 14 | } 15 | 16 | % per-name 17 | @BOOK{lant4, 18 | AUTHOR = {labelalphanametemplatename=test4, given=Arthur, family=Smith} 19 | } 20 | 21 | @BOOK{lant5, 22 | AUTHOR = {Galatius, Smith and Randal Williams, Oscar} 23 | } 24 | 25 | @BOOK{lant6, 26 | AUTHOR = {Galatius, Smith and Randal-Williams, Oscar} 27 | } 28 | -------------------------------------------------------------------------------- /test/bibliographies/biber/maps.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{maps1, 2 | AUTHOR = {John Doe}, 3 | YEAR = {1995} 4 | } 5 | 6 | @ARTICLE{maps2, 7 | AUTHOR = {Bill Bran}, 8 | YEAR = {1996} 9 | } 10 | 11 | @COLLECTION{maps3, 12 | AUTHOR = {Marvin Map}, 13 | YEAR = {1945} 14 | } 15 | 16 | @BOOK{maps4, 17 | AUTHOR = {Alan Allele}, 18 | YEAR = {1995} 19 | } 20 | -------------------------------------------------------------------------------- /test/bibliographies/biber/options.bib: -------------------------------------------------------------------------------- 1 | @BOOK{L1, 2 | AUTHOR = {John Doe}, 3 | TITLE = {Title 1}, 4 | PUBLISHER = {Oxford}, 5 | ORIGDATE = {1985-10-30}, 6 | DATE = {1998-04-05}, 7 | KEYWORDS = {one|two|three} 8 | } 9 | 10 | % testing custom xsvsep 11 | @BOOK{L2, 12 | OPTIONS = {maxnames=3|maxitems=2|maxalphanames=10}, 13 | AUTHOR = {Ellison Edwards}, 14 | TITLE = {Title 2}, 15 | PUBLISHER = {Oxford}, 16 | DATE = {1998-04-05}, 17 | } 18 | 19 | @BOOK{L3, 20 | OPTIONS = {blah=10}, 21 | AUTHOR = {Bunty Bluntford}, 22 | TITLE = {Title 3}, 23 | PUBLISHER = {Oxford}, 24 | DATE = {1999-04-05}, 25 | } 26 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sections1.bib: -------------------------------------------------------------------------------- 1 | @PREAMBLE{"Štring for Preamble 1"} 2 | 3 | @STRING{STRING1 = {value1}} 4 | 5 | @ARTICLE{sect1, 6 | SHORTHAND = {AA}, 7 | AUTHOR = {Aaron Adamson}, 8 | TITLE = {Artificial Advice}, 9 | PUBLISHER = {Aardvark Press}, 10 | LOCATION = {Arlington}, 11 | VOLUME = {4}, 12 | YEAR = {1995}, 13 | NOTE = STRING1 14 | } 15 | 16 | @ARTICLE{sect2, 17 | SHORTHAND = {BB}, 18 | AUTHOR = {Brian Britherthwaite}, 19 | TITLE = {Best Barnacled Boat Bottoms}, 20 | PUBLISHER = {British Bulldog Press}, 21 | LOCATION = {Bridlington}, 22 | YEAR = {2004}, 23 | } 24 | 25 | @ARTICLE{sectall1, 26 | AUTHOR = {Alan All}, 27 | TITLE = {Alternative Alternations}, 28 | PUBLISHER = {Average Aunt Press}, 29 | LOCATION = {Allertron}, 30 | YEAR = {2004}, 31 | } 32 | 33 | 34 | @PREAMBLE{"String for Preamble 2"} -------------------------------------------------------------------------------- /test/bibliographies/biber/sections2.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{sect3, 2 | AUTHOR = {Clive Clumberton}, 3 | TITLE = {Clumsy Cultural Caveats}, 4 | SUBTITLE = {Counter-cultural Concepts}, 5 | PUBLISHER = {Clapp and Clopp Press}, 6 | LOCATION = {Cambridge}, 7 | YEAR = {1914}, 8 | } 9 | 10 | @ARTICLE{sect8, 11 | SHORTHAND = {JJ}, 12 | AUTHOR = {Jimmy Johnson}, 13 | TITLE = {Jovial Jamborees}, 14 | PUBLISHER = {Jasper and Jiff}, 15 | LOCATION = {Johannesburg}, 16 | YEAR = {1938}, 17 | } 18 | 19 | @PREAMBLE{"String for Preamble 3"} -------------------------------------------------------------------------------- /test/bibliographies/biber/sections3.bib: -------------------------------------------------------------------------------- 1 | @STRING{STRING1 = {value2}} 2 | 3 | @BOOK{sect4, 4 | SHORTHAND = {DDDD}, 5 | AUTHOR = {Derek Ditherington and David Dumpton}, 6 | TITLE = {Dangerous Dames}, 7 | SUBTITLE = {Don't Dally Dude!}, 8 | PUBLISHER = {Dright and Drought Press}, 9 | LOCATION = {Dunbar}, 10 | YEAR = {2003}, 11 | NOTE = STRING1 12 | } 13 | 14 | @BOOK{sect5, 15 | SHORTHAND = {EE}, 16 | SORTKEY = {aaaaaaa}, 17 | AUTHOR = {Edward E. Ethoxon}, 18 | TITLE = {Eating Evil Enemies}, 19 | PUBLISHER = {Ethical Encouragement Press}, 20 | LOCATION = {Edinburgh}, 21 | YEAR = {2007}, 22 | } 23 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sections4.bib: -------------------------------------------------------------------------------- 1 | @BOOK{sect6, 2 | SHORTHAND = {MMMM}, 3 | AUTHOR = {Michael Mumford and Millie Mutherington}, 4 | TITLE = {Malodourous Muffins}, 5 | PUBLISHER = {Ming and Mink Press}, 6 | LOCATION = {Manchester}, 7 | YEAR = {2003}, 8 | } 9 | 10 | @PREAMBLE{"String for Preamble 4"} 11 | 12 | @BOOK{sect7, 13 | SHORTHAND = {PP}, 14 | AUTHOR = {Percy Pilkington}, 15 | TITLE = {Perhaps Penguins Prance}, 16 | PUBLISHER = {Possible Prattle Press}, 17 | LOCATION = {Pimlico}, 18 | YEAR = {2007}, 19 | } 20 | -------------------------------------------------------------------------------- /test/bibliographies/biber/skipsg.bib: -------------------------------------------------------------------------------- 1 | @BOOK{S1, 2 | OPTIONS = {dataonly=false}, 3 | AUTHOR = {John Doe and Albert Abrahams}, 4 | TITLE = {Title 1}, 5 | PUBLISHER = {Oxford}, 6 | YEAR = {1995}, 7 | } 8 | 9 | @BOOK{S2, 10 | OPTIONS = {skiplab=false, skipbib=false}, 11 | AUTHOR = {John Doe and Albert Abrahams}, 12 | TITLE = {Title 2}, 13 | PUBLISHER = {Oxford}, 14 | YEAR = {1995}, 15 | } 16 | 17 | @BOOK{S3, 18 | AUTHOR = {John Doe and Albert Abrahams}, 19 | TITLE = {Title 3}, 20 | PUBLISHER = {Oxford}, 21 | YEAR = {1995}, 22 | } 23 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sort-case.bib: -------------------------------------------------------------------------------- 1 | % Test of U::C case sensitivity and case ordering 2 | @BOOK{CS1, 3 | AUTHOR = {Albert, Edwin}, 4 | TITLE = {TITLE} 5 | } 6 | 7 | @BOOK{CS2, 8 | AUTHOR = {albert, Edwin}, 9 | TITLE = {title} 10 | } 11 | 12 | @BOOK{CS3, 13 | AUTHOR = {Albert, edwin}, 14 | TITLE = {The title} 15 | } 16 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sort-names.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{N1, 2 | AUTHOR = {Smith, Z.}, 3 | } 4 | 5 | @ARTICLE{N2, 6 | AUTHOR = {Smith de Jones, Z.}, 7 | } 8 | 9 | @ARTICLE{N3, 10 | AUTHOR = {Smith-Jones, Z.}, 11 | } 12 | 13 | @ARTICLE{N4, 14 | AUTHOR = {de Smith, Z.}, 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sort-uc.bib: -------------------------------------------------------------------------------- 1 | % Test of U::C tailoring - Swedish - in UCA, å and ä are sorted before z but should be after 2 | @BOOK{LS1, 3 | AUTHOR = {Slippery, Zänny}, 4 | TITLE = {Silent Slippers}, 5 | PUBLISHER = {Footwear Folios}, 6 | LOCATION = {London}, 7 | YEAR = {1932}, 8 | SHORTHAND = {SZä} 9 | } 10 | 11 | @BOOK{LS2, 12 | AUTHOR = {Slippery, Zznny}, 13 | TITLE = {People Prefer Packages to Post}, 14 | PUBLISHER = {Terrible Typists}, 15 | LOCATION = {Grimsby}, 16 | YEAR = {1945}, 17 | SHORTHAND = {SZå} 18 | } 19 | 20 | @BOOK{LS3, 21 | AUTHOR = {Slippery, Zönny}, 22 | TITLE = {Last Lingering Lemons}, 23 | PUBLISHER = {Fruit Folios}, 24 | LOCATION = {Catterick}, 25 | YEAR = {1966}, 26 | SHORTHAND = {SZo} 27 | } 28 | 29 | % Upper before lower false 30 | @BOOK{LS4, 31 | AUTHOR = {Slippery, Zönny}, 32 | TITLE = {last lingering lemons}, 33 | PUBLISHER = {Fruit Folios}, 34 | LOCATION = {Catterick}, 35 | YEAR = {1966}, 36 | SHORTHAND = {SZo} 37 | } 38 | 39 | @BOOK{LS5, 40 | AUTHOR = {Slippery, Zanny}, 41 | YEAR = {1989}, 42 | } 43 | 44 | % Surname is substring so should be first 45 | @BOOK{LS6, 46 | AUTHOR = {Slippery, Zan}, 47 | YEAR = {1988}, 48 | } 49 | -------------------------------------------------------------------------------- /test/bibliographies/biber/sort.bib: -------------------------------------------------------------------------------- 1 | @BOOK{L1, 2 | SHORTHAND = {\emph{A}}, 3 | SORTSHORTHAND = {A}, 4 | AUTHOR = {John Doe}, 5 | TITLE = {Algorithms For Sorting}, 6 | PUBLISHER = {A press}, 7 | LOCATION = {Cambridge}, 8 | YEAR = {1995}, 9 | } 10 | 11 | @BOOK{L2, 12 | SHORTHAND = {B}, 13 | AUTHOR = {John Doe}, 14 | TITLE = {Sorting Algorithms}, 15 | PUBLISHER = {A press}, 16 | LOCATION = {Cambridge}, 17 | YEAR = {1995}, 18 | } 19 | 20 | @BOOK{L3, 21 | SHORTHAND = {C}, 22 | AUTHOR = {John Doe}, 23 | TITLE = {More and More Algorithms}, 24 | PUBLISHER = {A press}, 25 | LOCATION = {Cambridge}, 26 | YEAR = {1995}, 27 | } 28 | 29 | @BOOK{L4, 30 | SHORTHAND = {D}, 31 | AUTHOR = {John Doe and others}, 32 | TITLE = {Some title about sorting}, 33 | PUBLISHER = {Another press}, 34 | LOCATION = {Cambridge}, 35 | YEAR = {1995}, 36 | } 37 | 38 | @BOOK{L5, 39 | SHORTHAND = {E}, 40 | AUTHOR = {John Doe and others}, 41 | TITLE = {Some other title about sorting}, 42 | PUBLISHER = {Another press}, 43 | LOCATION = {Cambridge}, 44 | YEAR = {1995}, 45 | } 46 | -------------------------------------------------------------------------------- /test/bibliographies/biber/translit.bib: -------------------------------------------------------------------------------- 1 | @MISC{kumāra, 2 | LANGID = {sanskrit}, 3 | TITLE = {kumāra} 4 | } 5 | 6 | @MISC{kṣetra, 7 | LANGID = {sanskrit}, 8 | TITLE = {kṣetra} 9 | } 10 | 11 | @MISC{kha, 12 | LANGID = {sanskrit}, 13 | TITLE = {kha} 14 | } 15 | 16 | @MISC{jīvita, 17 | LANGID = {sanskrit}, 18 | TITLE = {jīvita} 19 | } 20 | 21 | @MISC{jñāna, 22 | LANGID = {sanskrit}, 23 | TITLE = {jñāna} 24 | } 25 | 26 | @MISC{jvara, 27 | LANGID = {sanskrit}, 28 | TITLE = {jvara} 29 | } 30 | 31 | @MISC{tyāga, 32 | LANGID = {sanskrit}, 33 | TITLE = {tyāga} 34 | } 35 | 36 | @MISC{tridaśa, 37 | LANGID = {sanskrit}, 38 | TITLE = {tridaśa} 39 | } 40 | 41 | @MISC{tvid, 42 | LANGID = {sanskrit}, 43 | TITLE = {tvid} 44 | } 45 | 46 | @MISC{aachen, 47 | TITLE = {Aachen} 48 | } 49 | 50 | @MISC{augsburg, 51 | TITLE = {Augsburg} 52 | } 53 | 54 | @MISC{arnhem, 55 | TITLE = {Arnhem} 56 | } 57 | 58 | @MISC{avignon, 59 | TITLE = {Avignon} 60 | } 61 | 62 | @MISC{aix-en-provence, 63 | TITLE = {Aix-en-Provence} 64 | } 65 | 66 | @MISC{berlin, 67 | TITLE = {Berlin} 68 | } 69 | 70 | @MISC{utrecht, 71 | TITLE = {Utrecht} 72 | } 73 | 74 | @MISC{zeven, 75 | TITLE = {Zeven} 76 | } 77 | -------------------------------------------------------------------------------- /test/bibliographies/biber/truncation.bib: -------------------------------------------------------------------------------- 1 | @BOOK{us1, 2 | AUTHOR = {Anne Elk}, 3 | TITLE = {A Theory on Brontosauruses}, 4 | DATE = {1972}, 5 | } 6 | 7 | @BOOK{us2, 8 | AUTHOR = {Anne Elk and others}, 9 | TITLE = {A Theory on Einiosauruses}, 10 | DATE = {1972}, 11 | } 12 | 13 | @BOOK{us3, 14 | AUTHOR = {Anne Uthor}, 15 | TITLE = {Title B}, 16 | DATE = {2000}, 17 | } 18 | 19 | @BOOK{us4, 20 | AUTHOR = {Anne Uthor and Editha Ditor and William Writer 21 | and Jane Doe}, 22 | TITLE = {Title A}, 23 | DATE = {2000}, 24 | } 25 | 26 | @BOOK{us5, 27 | AUTHOR = {Anne Uthor and Editha Ditor and William Writer 28 | and Jane Doe}, 29 | TITLE = {Title C}, 30 | DATE = {2000}, 31 | } 32 | 33 | 34 | 35 | @BOOK{us6, 36 | AUTHOR = {Roger Red}, 37 | TITLE = {Ragged Rubles}, 38 | DATE = {1971} 39 | } 40 | 41 | @MISC{us7, 42 | AUTHOR = {Roger Red and others}, 43 | TITLE = {Ragged Rupees}, 44 | DATE = {1971} 45 | } 46 | 47 | @BOOK{us8, 48 | AUTHOR = {Simon Sly}, 49 | TITLE = {Title B}, 50 | DATE = {2000}, 51 | } 52 | 53 | @BOOK{us9, 54 | OPTIONS = {nohashothers=false}, 55 | AUTHOR = {nosortothers=false and Simon Sly and Terrence Tremble and Mark Miserable 56 | and Jake Jolly}, 57 | TITLE = {Title A}, 58 | DATE = {2000} 59 | } 60 | 61 | @BOOK{us10, 62 | AUTHOR = {Simon Sly and Terrence Tremble and Mark Miserable 63 | and Jake Jolly}, 64 | TITLE = {Title C}, 65 | DATE = {2000} 66 | } -------------------------------------------------------------------------------- /test/bibliographies/biber/uniqueness3.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{ey1, 2 | AUTHOR = {A. AAA and B. BBB and A. CCC and E. EEE}, 3 | TITLE = {Title1}, 4 | YEAR = {1968} 5 | } 6 | 7 | @ARTICLE{ey1a, 8 | AUTHOR = {A. AAA and B. BBB and A. CCC and E. EEE}, 9 | TITLE = {Title1}, 10 | YEAR = {1969} 11 | } 12 | 13 | @ARTICLE{ey2, 14 | AUTHOR = {A. AAA and B. BBB and A. CCC and D. DDD}, 15 | TITLE = {Title2}, 16 | YEAR = {1968} 17 | } 18 | 19 | @ARTICLE{ey3, 20 | AUTHOR = {A. MMM and B. NNN}, 21 | TITLE = {Title3}, 22 | YEAR = {1968} 23 | } 24 | 25 | @ARTICLE{ey4, 26 | AUTHOR = {A. MMM and B. NNN}, 27 | TITLE = {Title4}, 28 | YEAR = {1968} 29 | } 30 | 31 | @ARTICLE{ey5, 32 | AUTHOR = {Aaa ZZZ and Bbb VVV}, 33 | TITLE = {Title3}, 34 | YEAR = {1968} 35 | } 36 | 37 | @ARTICLE{ey6, 38 | AUTHOR = {Abb ZZZ and Bbb VVV}, 39 | TITLE = {Title6}, 40 | YEAR = {1968} 41 | } 42 | 43 | @ARTICLE{ey7, 44 | TITLE = {Titlea}, 45 | YEAR = {1968} 46 | } 47 | 48 | @ARTICLE{ey8, 49 | TITLE = {Titlea}, 50 | YEAR = {1968} 51 | } 52 | 53 | @ARTICLE{ey9, 54 | TITLE = {Titleb}, 55 | YEAR = {1968} 56 | } 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /test/bibliographies/biber/uniqueness6.bib: -------------------------------------------------------------------------------- 1 | @article {entry1a, 2 | author = {Smith and Johnson and Doe}, 3 | year = 2005 4 | } 5 | 6 | @article {entry1b, 7 | author = {Smith and Johnson and Doe}, 8 | year = 2005 9 | } 10 | 11 | @article {entry2a, 12 | author = {Smith and Koe and Edwards}, 13 | year = 2005 14 | } 15 | 16 | @article {entry2b, 17 | author = {Smith and Koe and Edwards}, 18 | year = 2005 19 | } 20 | 21 | @article{A, 22 | author={A and B and C and D and E and F and G}, 23 | year={2007}, 24 | } 25 | 26 | @article{B, 27 | author={A and X and Y}, 28 | year={2008}, 29 | } 30 | 31 | @article{C, 32 | author={A and B and C and D and E and F and G}, 33 | year={2009}, 34 | } 35 | -------------------------------------------------------------------------------- /test/bibliographies/biblatex/95-customlists.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{test1, 2 | AUTHOR = {Arthur Smith and James Jones and Bill Smiley and Jake Wrath}, 3 | JOURNALTITLE = {A Journal}, 4 | YEAR = {2010} 5 | } 6 | 7 | @ARTICLE{test2, 8 | AUTHOR = {Philippa Smyth and Arthur Smith and Bill Likely}, 9 | JOURNALTITLE = {Another Journal}, 10 | YEAR = {2011} 11 | } 12 | 13 | @ARTICLE{test3, 14 | AUTHOR = {Arthur Smith}, 15 | JOURNALTITLE = {The Best Journal}, 16 | YEAR = {2013} 17 | } 18 | 19 | @ARTICLE{test4, 20 | AUTHOR = {Philippa Smyth and Arthur Smith and James Jones}, 21 | JOURNALTITLE = {Again Another Journal}, 22 | YEAR = {2014} 23 | } 24 | -------------------------------------------------------------------------------- /test/bibliographies/biblatex/97-annotations.bib: -------------------------------------------------------------------------------- 1 | %% LaTeX2e file `97-annotations.bib' 2 | %% generated by the `filecontents' environment 3 | %% from source `97-annotations' on 2018/10/04. 4 | %% 5 | @MISC{ann1, 6 | AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3}, 7 | AUTHOR+an = {1:family=student;2=corresponding}, 8 | TITLE = {The Title}, 9 | TITLE+an:default = {=titleannotation}, 10 | TITLE+an:french = {="Le titre"}, 11 | TITLE+an:german = {="Der Titel"} 12 | } 13 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/01.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{key01, 2 | year = 1950, 3 | author = {Donald Duck and Someone Else}, 4 | editor = {E. D. Itor and A. N. Other}, 5 | title = {Title text}, 6 | month = jan # "~1" 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/06.bib: -------------------------------------------------------------------------------- 1 | this is text, which is ignored by bibtex. 2 | 3 | @PREAMBLE{ 4 | {This is only used for BibTeX files used in LaTeX documents} 5 | } 6 | 7 | @Comment{ 8 | Comments are ignored too. 9 | } 10 | 11 | @ARTICLE{key1, 12 | author = {Gerhard Gossen and Ludwig van Beethoven}, 13 | title = "Paper title", 14 | year = 2008, 15 | month = aug, 16 | } 17 | 18 | @STRING{ gerhard = "Gerhard" } 19 | 20 | @STRING{ gossen = "Gossen" } 21 | 22 | @BOOK{ key2, 23 | author = gerhard # " " # gossen, 24 | title = "Book title", 25 | year = "2008", 26 | month = aug, 27 | } 28 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/09-complex.bib: -------------------------------------------------------------------------------- 1 | @Article{Ahrenberg88, 2 | author = "L. Ahrenberg and A. Jonsson", 3 | title = "An interactive system for tagging dialogues", 4 | journal = "Literary \& Linguistic Computing", 5 | volume = "3", 6 | number = "2", 7 | pages = "66--70", 8 | year = "1988", 9 | keywords = "conver", 10 | } 11 | 12 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/10-funnyname.bib: -------------------------------------------------------------------------------- 1 | @article{testkey, 2 | year = {2008}, 3 | title = "foo", 4 | author = {A. Bar and L.M. M\"uller}, 5 | journal = {journal}, 6 | volume = {1}, 7 | number = {1}, 8 | pages = {1}, 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/14-extratext.bib: -------------------------------------------------------------------------------- 1 | First published in 1947 2 | @BOOK{Partridge, 3 | AUTHOR="Eric Partridge", 4 | TITLE="Use and Abuse: a Guide to Good {E}nglish", 5 | PUBLISHER="Hamish Hamilton", 6 | EDITION="4", YEAR="1970"} 7 | 8 | 9 | @BOOK{Cooper, 10 | AUTHOR="Bruce M. Cooper", 11 | TITLE="Writing Technical Reports", 12 | PUBLISHER="Penguin", YEAR="1964"} 13 | 14 | 15 | 16 | First published in 1926 17 | @BOOK{Fowler-ModernEnglish, 18 | AUTHOR="H. W. Fowler", 19 | TITLE="[A Dictionary of] Modern {E}nglish Usage", 20 | PUBLISHER="Oxford University Press", 21 | EDITION="2", YEAR="1965"} 22 | 23 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/braces.bib: -------------------------------------------------------------------------------- 1 | @Article{scholkopf98kpca, 2 | author = {Bernhard {Sch\"olkopf} and Alex Smola and K.R. Muller}, 3 | title = {Nonlinear component analysis as a kernel eigenvalue 4 | problem}, 5 | journal = {Neural Computation}, 6 | year = {1998}, 7 | volume = {10}, 8 | pages = {1299--1319} 9 | } 10 | 11 | @article{brownetal93, 12 | author = {Peter F. Brown and Stephen A. {Della Pietra} and 13 | Vincent J. {Della Pietra} and Robert~L. Mercer}, 14 | title = {The Mathematics of Statistical Machine Translation: 15 | Parameter Estimation}, 16 | journal = {Computational Linguistics}, 17 | year = 1993, 18 | volume = 19, 19 | number = 2, 20 | pages = {263-311} 21 | } 22 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/endnote.txt: -------------------------------------------------------------------------------- 1 | @article{ 2 | volume = {59}, 3 | number = {6}, 4 | year = {1999} 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/engineering_village.txt: -------------------------------------------------------------------------------- 1 | @inproceedings{1997493856789 , 2 | language = {English}, 3 | year = {1997}, 4 | } 5 | 6 | 7 | @inproceedings{1998043944915 , 8 | language = {English}, 9 | year = {1997}, 10 | } 11 | 12 | 13 | @article{2003137419501 , 14 | language = {English}, 15 | year = {2002}, 16 | } 17 | 18 | 19 | @inproceedings{2002367072517 , 20 | language = {English}, 21 | year = {2002}, 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /test/bibliographies/bibtex-perl-libs/mathscinet.txt: -------------------------------------------------------------------------------- 1 | MathSciNet 2 | 3 | * 4 | Clipboard 5 | * Home 6 | * Preferences 7 | * Help 8 | * Support Mail 9 | * Terms of Use 10 | * University of Southampton 11 | 12 | @article {MR2254280, 13 | VOLUME = {23}, 14 | YEAR = {2006}, 15 | } 16 | 17 | 18 | @article {MR2254274, 19 | VOLUME = {23}, 20 | YEAR = {2006}, 21 | } 22 | 23 | 24 | @article {MR2248052, 25 | VOLUME = {23}, 26 | YEAR = {2006}, 27 | } 28 | 29 | 30 | *Matches:* 3 31 | Mirror Sites 32 | 33 | 34 | © Copyright 2011, American Mathematical Society 35 | 36 | Privacy Statement 37 | American Mathematical Society 38 | American Mathematical Society 39 | 201 Charles Street 40 | Providence, RI 02904-2294 41 | -------------------------------------------------------------------------------- /test/bibliographies/others/1.bib: -------------------------------------------------------------------------------- 1 | @Article{key03, 2 | title = "A {bunch {of} braces {in}} title" 3 | } -------------------------------------------------------------------------------- /test/bibliographies/others/2.bib: -------------------------------------------------------------------------------- 1 | @Article{key01, 2 | author = "Simon {"}the {saint"} Templar", 3 | } -------------------------------------------------------------------------------- /test/bibliographies/others/3.bib: -------------------------------------------------------------------------------- 1 | @Article{key01, 2 | title = "The history of @ sign" 3 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-embeddedtex.bib: -------------------------------------------------------------------------------- 1 | @article{journalhw, 2 | title = {\textbf{Hello} World}, 3 | author = "Doe, John and Doe, Jane" 4 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-field-error.bib: -------------------------------------------------------------------------------- 1 | @misc{web:abc, 2 | x = {{1234}}, 3 | year = 1234, 4 | } 5 | @misc{web:def, 6 | x = "abcd", 7 | y = {abcd}, 8 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-quoted.bib: -------------------------------------------------------------------------------- 1 | @article{name, 2 | year = 2016, 3 | title = {{"}Session{"} based blah} 4 | } 5 | 6 | @inproceedings{ng2014, 7 | title = "Blah", 8 | author = "Me", 9 | booktitle = "ABCD 2014" 10 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-simple.bib: -------------------------------------------------------------------------------- 1 | @article{name, 2 | year = 2016, 3 | title = {SessionBasedBlah} 4 | } 5 | 6 | @inproceedings{ng2014, 7 | title = "Blah", 8 | author = "Me", 9 | booktitle = "ABCD2014" 10 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-space.bib: -------------------------------------------------------------------------------- 1 | @article{name, 2 | year = 2016, 3 | title = {Session BasedBlah} 4 | } 5 | 6 | @inproceedings{ng2014, 7 | title = "Blah", 8 | author = "Me", 9 | booktitle = "ABCD2014" 10 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-symbols.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{1, 2 | titLe = "Title goes here", 3 | author = "Ng, Nich\'{o}las", 4 | misc = "\\url\{http://www.doc.ic.ac.uk/~cn06\}" 5 | } -------------------------------------------------------------------------------- /test/bibliographies/others/bibtex-var.bib: -------------------------------------------------------------------------------- 1 | @string{x={blah}} 2 | @article{v, 3 | title = x, 4 | x = "X", 5 | } -------------------------------------------------------------------------------- /test/bibliographies/others/empty.bib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlamingTempura/bibtex-tidy/f4bccd4300b59db9ae663ee9ba72803832e85a82/test/bibliographies/others/empty.bib -------------------------------------------------------------------------------- /test/bibliographies/others/example1.bib: -------------------------------------------------------------------------------- 1 | @comment{jabref-meta: groupsversion:3;} % zotero export 2 | 3 | %references 4 | @inproceedings{Smith2009, 5 | author="Caroline JA Smith", 6 | year=2009, 7 | month=dec, 8 | title={{Quantum somethings}}, 9 | journal={Journal of {B}lah} 10 | } 11 | 12 | comment 13 | @book{IP:1990, 14 | author = "Prince, Ian", 15 | year = {1990}, 16 | title = {Methods for Research} 17 | } 18 | 19 | @Comment{A comment} 20 | @Article{py03, 21 | author = {Xavier D\'ecoret}, 22 | title = "PyBiTex", 23 | year = 2003 24 | } 25 | 26 | @Comment{ 27 | @Book{steward03, 28 | author = {Martha Steward}, 29 | title = {Cooking behind bars}, 30 | publisher = {Culinary Expert Series}, 31 | year = 2003 32 | } 33 | @Article{py03a, 34 | author = {Xavier D\'ecoret}, 35 | title = "PyBiTex", 36 | year = 2003 37 | } 38 | @boo{fd{},fds} 39 | } 40 | 41 | 42 | @String(mar = "march") 43 | 44 | @Book{sweig42, 45 | month = "1~mar" 46 | } 47 | 48 | @String(mar = "march") 49 | 50 | @Book(sweig42a, 51 | month = "1~" # mar 52 | ) 53 | 54 | @String {firstname = "Xavier"} 55 | @String {lastname = "Decoret"} 56 | @String {email = firstname # "." # lastname # "@imag.fr"} -------------------------------------------------------------------------------- /test/bibliographies/others/example2.bib: -------------------------------------------------------------------------------- 1 | @String {maintainer = "Xavier D\'ecoret"} 2 | 3 | @preamble { "Maintained by " # maintainer } 4 | 5 | @String(mar = "march") 6 | 7 | @Book{sweig42, 8 | Author = { Stefan Sweig }, 9 | title = { The impossible book }, 10 | publisher = { Dead Poet Society}, 11 | year = 1942, 12 | month = mar 13 | } 14 | 15 | ...and finally an entry commented by the use of the special @Comment entry type. 16 | 17 | @Comment{steward03, 18 | author = {Martha Steward}, 19 | title = {Cooking behind bars}, 20 | publisher = {Culinary Expert Series}, 21 | year = 2003 22 | } 23 | 24 | % boo! 25 | @article{thing_a, 26 | title={blah}, 27 | weird-key="{cheese} {"}in brie{"}" 28 | } 29 | % another comment 30 | @inproceedings{Smith2009, 31 | author="Caroline JA Smith", 32 | year=2009, 33 | month=dec, 34 | title={{Quantum somethings}},journal={Journal of {B}lah} 35 | }@conference_at{4, 36 | a__="{Caroline JA Smith}", 37 | _bo={Q{Uantum} {s}omethings}, 38 | } 39 | % last thing 40 | % another last thing 41 | 42 | Some {{comments} with unbalanced braces 43 | ....and a "commented" entry... 44 | 45 | Book{landru21, 46 | author = {Landru, Henri D\\'esir\\'e}, 47 | title = {A hundred recipes for you wife}, 48 | publisher = {Culinary Expert Series}, 49 | year = 1921 50 | } 51 | 52 | ..some other comments..before a valid entry... 53 | 54 | @Book{steward03, 55 | author = { Martha Steward }, 56 | title = {Cooking behind bars}, 57 | publisher = {Culinary Expert Series}, 58 | year = 2003 59 | } -------------------------------------------------------------------------------- /test/bibliographies/others/jabref.bib: -------------------------------------------------------------------------------- 1 | @Comment{jabref-meta: databaseType:bibtex;} 2 | 3 | @Comment{jabref-meta: saveActions:enabled; 4 | date[normalize_date] 5 | editor[unicode_to_latex] 6 | pages[normalize_page_numbers] 7 | journal[unicode_to_latex] 8 | month[normalize_month] 9 | author[unicode_to_latex] 10 | all-text-fields[ordinals_to_superscript] 11 | title[html_to_latex,unicode_to_latex] 12 | booktitle[unicode_to_latex] 13 | ;} 14 | 15 | @Comment{jabref-meta: saveOrderConfig:specified;bibtexkey;false;author;false;abstract;false;} -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-book_citation.bib: -------------------------------------------------------------------------------- 1 | @book{book, 2 | author={Peter Babington}, 3 | title ={The title of the work}, 4 | publisher = {The name of the publisher}, 5 | year={1993}, 6 | volume=4, 7 | series=10, 8 | address ={The address}, 9 | edition =3, 10 | month =7, 11 | note={An optional note}, 12 | isbn={3257227892} 13 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-chinese_citation.bib: -------------------------------------------------------------------------------- 1 | @article{羊憶蓉1999人的素質提昇之重要性, 2 | title={人的素質提昇之重要性--建立在法治精神之上的多元主義}, 3 | author={羊憶蓉}, 4 | journal={人的素質--[人文關懷與社會實踐] 國際學術研討會論文集}, 5 | pages={174--180}, 6 | year={1999}, 7 | publisher={法鼓人文社會學院} 8 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-citation.bib.bib: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-citation_name_starts_w_number.bib: -------------------------------------------------------------------------------- 1 | @techreport{2013current, 2 | Author = {Lack, Kelly A.}, 3 | Date-Added = {2013-04-09 19:09:56 +0000}, 4 | Date-Modified = {2013-04-09 19:10:58 +0000}, 5 | Institution = {Ithaka S+R}, 6 | Keywords = {0sotl}, 7 | Oa-Url = {http://www.sr.ithaka.org/sites/default/files/reports/ithaka-sr-online-learning-postsecondary-education-may2012.pdf}, 8 | Title = {Current Status of Research on Online Learning in Postsecondary Education}, 9 | Year = {2013}} 10 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-citation_w_publisher.bib: -------------------------------------------------------------------------------- 1 | 2 | @incollection{hennemann2009vernetzung, 3 | title={Vernetzung in der Grundlagenforschung}, 4 | author={Hennemann, S.}, 5 | booktitle={Planungsverband Ballungsraum Frankfurt-Rhein-Main (Hrsg.): Wissensatlas FrankfurtRheinMain: die Wissensregion stellt sich vor}, 6 | pages={33--36}, 7 | year={2009}, 8 | publisher={Planungsverband, Frankfurt-Rhein-Main} 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-citations.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{sample1,title={sample title}} 3 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-comment.bib: -------------------------------------------------------------------------------- 1 | 2 | @PREAMBLE{"\newcommand{\noopsort}[1]{}"} 3 | 4 | @COMMENT{"\nslkdjflksdjflkdsjf"} 5 | 6 | % test 7 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-crazy_delimiter.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{RID:1118130922631-13,title = {Synthesis and structural characterization of unprecedented bis-asymmetric heteroscorpionate U(III) complexes: [U\{kappa(3)-H2B(pz(tBu),(Me))(pz(Me,tBu))\}(2)I] and [U\{kappa(3) -H2B(pz(tBu,Me))( pz(Me2))\}(2)I]},journal = {Inorganic Chemistry},year = {2003},author = {Maria, L and Domingos, A and Santos, I},volume = {42},number = {10},pages = {3323-3330}} 3 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-cross_ref.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{Peters_2004, title={Bibtex from CrossRef}, ISSN={0263-9475}, url={http://dx.doi.org/10.2307/25564177}, DOI={10.2307/25564177}, number={109}, journal={Circa}, publisher={JSTOR}, author={Peters, Robert}, year={2004}, pages={24}} 3 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-inproceedings.bib: -------------------------------------------------------------------------------- 1 | 2 | @inproceedings{Lysenko:2010:GMC:1839778.1839781, 3 | author = {Lysenko, Mikola and Nelaturi, Saigopal and Shapiro, Vadim}, 4 | title = {Group morphology with convolution algebras}, 5 | booktitle = {Proceedings of the 14th ACM Symposium on Solid and Physical Modeling}, 6 | series = {SPM '10}, 7 | year = {2010}, 8 | isbn = {978-1-60558-984-8}, 9 | location = {Haifa, Israel}, 10 | pages = {11--22}, 11 | numpages = {12}, 12 | url = {http://doi.acm.org/10.1145/1839778.1839781}, 13 | doi = {10.1145/1839778.1839781}, 14 | acmid = {1839781}, 15 | publisher = {ACM}, 16 | address = {New York, NY, USA} 17 | } 18 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-inspiredHEP.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{Chen:2014oha, 3 | author = "Chen, Chien-Yi and Davoudiasl, Hooman and Kim, Doojin", 4 | title = {Warped Graviton "Z + Missing Energy" Signal at Hadron 5 | Colliders}, 6 | journal = "Phys.Rev.", 7 | volume = "D89", 8 | pages = "096007", 9 | doi = "10.1103/PhysRevD.89.096007", 10 | year = "2014", 11 | eprint = "1403.3399", 12 | archivePrefix = "arXiv", 13 | primaryClass = "hep-ph", 14 | SLACcitation = "%%CITATION = ARXIV:1403.3399;%%", 15 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-latex_test.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{sample1,title={\'Isample title\textregistered \~n {\~n}}} 3 | -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-orcid-arXiv.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{2009PhLA..373.2301C, 2 | author = {{Chru{\'s}ci{\'n}ski}, D. and {Kossakowski}, A.}, 3 | title = "{Geometry of quantum states: New construction of positive maps}", 4 | journal = {Physics Letters A}, 5 | archivePrefix = "arXiv", 6 | eprint = {0902.0885}, 7 | primaryClass = "quant-ph", 8 | year = 2009, 9 | month = jun, 10 | volume = 373, 11 | pages = {2301-2305}, 12 | doi = {10.1016/j.physleta.2009.04.068}, 13 | adsurl = {http://adsabs.harvard.edu/abs/2009PhLA..373.2301C}, 14 | adsnote = {Provided by the SAO/NASA Astrophysics Data System} 15 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-persian-citation.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{داودی2015بررسی, 3 | title={بررسی مکانیزمهای سایش و عمر ابزار در تراشکاری سوپرآلیاژ پایه آهن-نیکل N-155 }, 4 | author={داودی, بهنام and بهنام and اسکندری and بهزاد}, 5 | journal={مهندسی مکانیک مدرس}, 6 | volume={14}, 7 | pages={51--58}, 8 | year={2015} 9 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-quote.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{sample1, 3 | title={sample \"Quote\" title}, 4 | name={sample "Quote" title"} 5 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-sample.bib: -------------------------------------------------------------------------------- 1 | @article{sample1,title={sample title}} -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-whitespace.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{SomeKey, 3 | author = {John Doe}, 4 | title = {Foo Bar}, 5 | journal= {Transactions on Foobar}, 6 | volume = {42}, 7 | year ={2017} 8 | } -------------------------------------------------------------------------------- /test/bibliographies/others/orcid-wikipedia_example.bib: -------------------------------------------------------------------------------- 1 | 2 | @Book{abramowitz+stegun, 3 | author = "Milton {Abramowitz} and Irene A. {Stegun}", 4 | title = "Handbook of Mathematical Functions with 5 | Formulas, Graphs, and Mathematical Tables", 6 | publisher = "Dover", 7 | year = {1964}, 8 | address = "New York", 9 | edition = "ninth Dover printing, tenth GPO printing" 10 | } -------------------------------------------------------------------------------- /test/bibliographies/others/papers-for-mac.bib: -------------------------------------------------------------------------------- 1 | @article{vanWoesik:2006ti, 2 | author = {van Woesik, R and Lacharmoise, F and Koksal, S}, 3 | title = {{Annual cycles of solar insulation predict spawning times of Caribbean corals}}, 4 | journal = {Ecology Letters}, 5 | year = {2006}, 6 | volume = {9}, 7 | pages = {390--398}, 8 | month = jan 9 | } -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Renan de Lima Barbosa 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/abbreviation.bib: -------------------------------------------------------------------------------- 1 | @string { 2 | me = "Renan" 3 | } 4 | @string { 5 | emptyAbbr = "" 6 | } 7 | @string { 8 | nullAbbr="" 9 | } 10 | @string { 11 | meImportant = "Sir " # me 12 | } 13 | 14 | @string { 15 | meAccordingToMyMother = "Glamorous " # meImportant 16 | } 17 | 18 | @string { 19 | message = "Hello " # meAccordingToMyMother # "!" 20 | } 21 | @string { 22 | skip = "me" 23 | } 24 | @string { 25 | mustEmpty = emptyAbbr 26 | } 27 | @string { 28 | mustNull = nullAbbr 29 | } 30 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/authors-simple.bib: -------------------------------------------------------------------------------- 1 | @authorssimple{a, 2 | author="John Doe" 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/basic.bib: -------------------------------------------------------------------------------- 1 | @basic {a, 2 | foo = bar 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/citation-key.bib: -------------------------------------------------------------------------------- 1 | @citationKey{Someone2016, 2 | foo = bar 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/comment-entry.bib: -------------------------------------------------------------------------------- 1 | this is a comment @comment{foo = bar} this is another comment 2 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/comment-jabref.bib: -------------------------------------------------------------------------------- 1 | @Comment{jabref-meta: databaseType:bibtex;} 2 | @Comment{jabref-entrytype: Poster: req[author;title;year;organization] opt[abstract]} 3 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/comment-only.bib: -------------------------------------------------------------------------------- 1 | this is a valid file 2 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/keywords-simple.bib: -------------------------------------------------------------------------------- 1 | @keywordsSimple{a, 2 | keywords = "foo, bar" 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/multiples-entries.bib: -------------------------------------------------------------------------------- 1 | % comment #1 must be ignore 2 | @entryFooWithSpaces {a, foo = oof } % comment #2 must be ignore 3 | % comment #3 must be ignore 4 | @entryBarWithoutSpaces{b,bar=rab}% comment #4 must be ignore 5 | % comment #5 must be ignore 6 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/string-var-with-special-char.bib: -------------------------------------------------------------------------------- 1 | @String{Andrasfai = {Andr{\'{a}}sfai, B{\'{e}}la}} 2 | @String{Bollobas = {Bollob{\'{a}}s, B{\'{e}}la}} 3 | @String{Chvatal = {Chv{\'{a}}tal, Va{\v{s}}ek}} 4 | @String{Erdos = {Erd{\H{o}}s, Paul}} 5 | @String{Gyarfas = {Gy{\'{a}}rf{\'{a}}s, Andr{\'{a}}s}} 6 | @String{Lovasz = {Lov{\'{a}}sz, L{\'{a}}szl{\'{o}}}} 7 | @String{Balbuena = {Balbuena, Camino}} 8 | @String{Cera = {Cera, Mart{\'{\i}}n}} 9 | @String{Dianez = {Di{\'{a}}nez, Ana}} 10 | @String{Garcia-Vazquez = {Garc{\'{\i}}a-V{\'{a}}zquez, Pedro}} 11 | 12 | @Article{BCDGV07TopologicalFree, 13 | author = Balbuena #{ and } # Cera #{ and } # Dianez #{ and } # Garcia-Vazquez, 14 | title = {New exact values of the maximum size of graphs free of topological complete subgraphs}, 15 | journal = {Discrete Mathematics}, 16 | year = {2007}, 17 | volume = {307}, 18 | number = {9-10}, 19 | pages = {1038--1046}, 20 | issn = {0012-365X}, 21 | doi = {10.1016/j.disc.2006.07.031}, 22 | keywords = {Extremal graphs}, 23 | publisher = {Elsevier {BV}}, 24 | } 25 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-basic.bib: -------------------------------------------------------------------------------- 1 | @valuesBasic {a, 2 | kNull = 0, 3 | kStillNull = 0, 4 | kRaw = raw, 5 | kBraced = { braced value }, 6 | kBracedEmpty = {}, 7 | kQuoted = " quoted value ", 8 | kQuotedEmpty = "" 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-escaped.bib: -------------------------------------------------------------------------------- 1 | @valuesEscaped {a, 2 | braced = {the " \\ \% braced}, 3 | quoted = "the \{\vphantom{\}} {"} \ % quoted" 4 | } 5 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-latex.bib: -------------------------------------------------------------------------------- 1 | @tagContentLatex{a, 2 | consensus = "caf\\'{e}s" 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-multiple.bib: -------------------------------------------------------------------------------- 1 | @multipleTagContents {a, 2 | raw = rawA # rawB, 3 | quoted = "quoted a" # "quoted b", 4 | braced = {braced a} # {braced b}, 5 | misc = "quoted" # {braced} # raw, 6 | noSpace=raw#"quoted"#{braced} 7 | } 8 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-nested-braces.bib: -------------------------------------------------------------------------------- 1 | @valuesBraces {a, 2 | link = {\url{https://github.com}}, 3 | twoLevels = {a{b{c}d}e}, 4 | escapedBrace = {before{}after} 5 | } 6 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-contents-slashes.bib: -------------------------------------------------------------------------------- 1 | @valuesSlashes {a, 2 | braced = {\\\\"\\\%\\}, 3 | quoted = "\\\{\vphantom{\}}\\{"}\\\%\\" 4 | } 5 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-name-uppercased.bib: -------------------------------------------------------------------------------- 1 | @tagNameUppercased {a, 2 | FoO = bAr 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/tag-name-with-underscore.bib: -------------------------------------------------------------------------------- 1 | @tagNameWithUnderscore {a, 2 | foo_bar = fubar 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/trailing-comma.bib: -------------------------------------------------------------------------------- 1 | @trailingComma {a, 2 | foo = bar, 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/php-bibtex-parser/type-overriding.bib: -------------------------------------------------------------------------------- 1 | @typeOverriding{a, 2 | foo = bar, 3 | type = {new type value} 4 | } 5 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean César}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | month = "jan", 6 | volume = {12}, 7 | pages = {12-23}, 8 | journal = {Nice Journal}, 9 | abstract = {This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word}, 11 | comments = {A comment}, 12 | keyword = {keyword1, keyword2}, 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_comma_first.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013 2 | , author = {Jean Cesar} 3 | , title = {An amazing title} 4 | , year = {2013} 5 | , volume = {12} 6 | , journal = {Nice Journal} 7 | , comments = {A comment} 8 | , keyword = {keyword1, keyword2} 9 | } 10 | 11 | @ARTICLE{ Baltazar2013 12 | , author = {Jean Baltazar} 13 | , title = {An amazing title} 14 | , year = {2013} 15 | , volume = {12} 16 | , journal = {Nice Journal} 17 | , comments = {A comment} 18 | , keyword = {keyword1, keyword2}} 19 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_comma_first_and_trailing_comma_output.bib: -------------------------------------------------------------------------------- 1 | @article{Cesar2013 2 | , abstract = {This is an abstract. This line should be long enough to test 3 | multilines... and with a french érudit word} 4 | , author = {Jean César} 5 | , comments = {A comment} 6 | , journal = {Nice Journal} 7 | , keyword = {keyword1, keyword2} 8 | , month = {jan} 9 | , pages = {12-23} 10 | , title = {An amazing title} 11 | , volume = {12} 12 | , year = {2013} 13 | , 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_field_name_with_underscore.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean César}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | volume = {12}, 6 | pages = {12-23}, 7 | journal = {Nice Journal}, 8 | comments = {A comment}, 9 | keyword = {keyword1, keyword2}, 10 | strange-field-name2 = {val2}, 11 | strange_field_name = {val}, 12 | } 13 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_homogenize.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | authors = {Jean César}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | month = "jan", 6 | volume = {12}, 7 | pages = {12-23}, 8 | journal = {Nice Journal}, 9 | abstract = {This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word}, 11 | comments = {A comment}, 12 | editors = {Edith Or}, 13 | keywords = {keyword1, keyword2}, 14 | links = {http://my.link/to-content}, 15 | subjects = "Some topic of interest", 16 | } 17 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_missing_coma.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean Cesar}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | volume = {12}, 6 | journal = {Nice Journal}, 7 | comments = {A comment}, 8 | keyword = {keyword1, keyword2} 9 | } 10 | 11 | @ARTICLE{Baltazar2013, 12 | author = {Jean Baltazar}, 13 | title = {An amazing title}, 14 | year = {2013}, 15 | volume = {12}, 16 | journal = {Nice Journal}, 17 | comments = {A comment}, 18 | keyword = {keyword1, keyword2}} 19 | 20 | @ARTICLE{Aimar2013, 21 | author = {Jean Aimar}, 22 | title = {An amazing title}, 23 | year = {2013}, 24 | volume = {12}, 25 | journal = {Nice Journal}, 26 | comments = {A comment}, 27 | keyword = {keyword1, keyword2}, 28 | month = "january" 29 | } 30 | 31 | @ARTICLE{Doute2013, 32 | author = {Jean Doute}, 33 | title = {An amazing title}, 34 | volume = {12}, 35 | journal = {Nice Journal}, 36 | comments = {A comment}, 37 | keyword = {keyword1, keyword2}, 38 | year = "2013" 39 | } 40 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_no_braces.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = "Jean C{\'e}sar{\"u}", 3 | title = "An amazing title", 4 | year = "2013", 5 | month = "jan", 6 | volume = "12", 7 | pages = "12-23", 8 | journal = "Nice Journal", 9 | abstract = "This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word", 11 | comments = "A comment", 12 | keyword = "keyword1, keyword2", 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_oneline.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, author = {Jean Cesar}, title = {An amazing title}, year = {2013}, volume = {12}, journal = {Nice Journal}, comments = {A comment}, keyword = {keyword1, keyword2}} 2 | 3 | @ARTICLE{ Baltazar2013,author = {Jean Baltazar},title = {An amazing title},year = {2013},volume = {12},journal = {Nice Journal},comments = {A comment},keyword = {keyword1, keyword2}} 4 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_output.bib: -------------------------------------------------------------------------------- 1 | @article{Cesar2013, 2 | abstract = {This is an abstract. This line should be long enough to test 3 | multilines... and with a french érudit word}, 4 | author = {Jean César}, 5 | comments = {A comment}, 6 | journal = {Nice Journal}, 7 | keyword = {keyword1, keyword2}, 8 | month = {jan}, 9 | pages = {12-23}, 10 | title = {An amazing title}, 11 | volume = {12}, 12 | year = {2013} 13 | } 14 | 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_start_with_bom.bib: -------------------------------------------------------------------------------- 1 |  2 | @ARTICLE{Cesar2013, 3 | author = {Jean César}, 4 | title = {An amazing title}, 5 | year = {2013}, 6 | month = "jan", 7 | volume = {12}, 8 | pages = {12-23}, 9 | journal = {Nice Journal}, 10 | abstract = {This is an abstract. This line should be long enough to test 11 | multilines... and with a french érudit word}, 12 | comments = {A comment}, 13 | keyword = {keyword1, keyword2}, 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_start_with_whitespace.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean Cesar}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | volume = {12}, 6 | journal = {Nice Journal} 7 | } 8 | 9 | @ARTICLE{Cesar2014, 10 | author = {Jean Cesar}, 11 | title = {An amazing title}, 12 | year = {2014}, 13 | volume = {12}, 14 | journal = {Nice Journal} 15 | } -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_trailing_comma_output.bib: -------------------------------------------------------------------------------- 1 | @article{Cesar2013, 2 | abstract = {This is an abstract. This line should be long enough to test 3 | multilines... and with a french érudit word}, 4 | author = {Jean César}, 5 | comments = {A comment}, 6 | journal = {Nice Journal}, 7 | keyword = {keyword1, keyword2}, 8 | month = {jan}, 9 | pages = {12-23}, 10 | title = {An amazing title}, 11 | volume = {12}, 12 | year = {2013}, 13 | } 14 | 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_annotation.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean César}, 3 | author+an = {1=highlight}, 4 | title = {An amazing title}, 5 | year = {2013}, 6 | month = "jan", 7 | volume = {12}, 8 | pages = {12-23}, 9 | journal = {Nice Journal}, 10 | abstract = {This is an abstract. This line should be long enough to test 11 | multilines... and with a french érudit word}, 12 | comments = {A comment}, 13 | keyword = {keyword1, keyword2}, 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_annotation_output.bib: -------------------------------------------------------------------------------- 1 | @article{Cesar2013, 2 | abstract = {This is an abstract. This line should be long enough to test 3 | multilines... and with a french érudit word}, 4 | author = {Jean César}, 5 | author+an = {1=highlight}, 6 | comments = {A comment}, 7 | journal = {Nice Journal}, 8 | keyword = {keyword1, keyword2}, 9 | month = {jan}, 10 | pages = {12-23}, 11 | title = {An amazing title}, 12 | volume = {12}, 13 | year = {2013} 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_protection_braces.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean César}, 3 | title = {{An amazing title}}, 4 | year = {2013}, 5 | month = "jan", 6 | volume = {12}, 7 | pages = {12-23}, 8 | journal = {{Nice Journal}}, 9 | abstract = {This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word}, 11 | comments = {A comment}, 12 | keyword = {keyword1, keyword2}, 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_special_characters.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean C{\'e}sar{\"u}}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | month = "jan", 6 | volume = {12}, 7 | pages = {12-23}, 8 | journal = {Nice Journal}, 9 | abstract = {This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word}, 11 | comments = {A comment}, 12 | keyword = {keyword1, keyword2}, 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_strings.bib: -------------------------------------------------------------------------------- 1 | @STRING{ nice_journal = "Nice Journal" } 2 | @STRING ( jean={Jean} ) 3 | @STRING{cesar = {César}} 4 | 5 | @ARTICLE{Cesar2013, 6 | author = jean # " " # cesar, 7 | title = {An amazing title}, 8 | year = {2013}, 9 | month = jan, 10 | volume = {12}, 11 | pages = {12-23}, 12 | journal = nice_journal, 13 | comments = {A comment}, 14 | keyword = {keyword1, keyword2}, 15 | } 16 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/article_with_strings_output.bib: -------------------------------------------------------------------------------- 1 | @string{nice_journal = {Nice Journal}} 2 | 3 | @string{jean = {Jean}} 4 | 5 | @string{cesar = {César}} 6 | 7 | @article{Cesar2013, 8 | author = jean # { } # cesar, 9 | comments = {A comment}, 10 | journal = nice_journal, 11 | keyword = {keyword1, keyword2}, 12 | month = jan, 13 | pages = {12-23}, 14 | title = {An amazing title}, 15 | volume = {12}, 16 | year = {2013} 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/book.bib: -------------------------------------------------------------------------------- 1 | @BOOK{Bird1987, 2 | title = {Dynamics of Polymeric Liquid}, 3 | publisher = {Wiley Edition}, 4 | year = {1987}, 5 | author = {Bird, R.B. and Armstrong, R.C. and Hassager, O.}, 6 | volume = {1}, 7 | edition = {2}, 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/book_bom.bib: -------------------------------------------------------------------------------- 1 | @BOOK{Bird1987, 2 | title = {Dynamics of Polymeric Liquid}, 3 | publisher = {Wiley Edition}, 4 | year = {1987}, 5 | author = {Bird, R.B. and Armstrong, R.C. and Hassager, O.}, 6 | volume = {1}, 7 | edition = {2}, 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/book_comma_first.bib: -------------------------------------------------------------------------------- 1 | @book{Bird1987 2 | , author = {Bird, R.B. and Armstrong, R.C. and Hassager, O.} 3 | , edition = {2} 4 | , publisher = {Wiley Edition} 5 | , title = {Dynamics of Polymeric Liquid} 6 | , volume = {1} 7 | , year = {1987} 8 | } 9 | 10 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/book_output.bib: -------------------------------------------------------------------------------- 1 | @book{Bird1987, 2 | author = {Bird, R.B. and Armstrong, R.C. and Hassager, O.}, 3 | edition = {2}, 4 | publisher = {Wiley Edition}, 5 | title = {Dynamics of Polymeric Liquid}, 6 | volume = {1}, 7 | year = {1987} 8 | } 9 | 10 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/comments_only.bib: -------------------------------------------------------------------------------- 1 | @comment{ignore this line!} 2 | @Comment{ignore this line too!} 3 | @COMMENT{and ignore this line too!} 4 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/comments_only_output.bib: -------------------------------------------------------------------------------- 1 | @comment{ignore this line!} 2 | 3 | @comment{ignore this line too!} 4 | 5 | @comment{and ignore this line too!} 6 | 7 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/comments_percentage.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean Cesar}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | volume = {12}, 6 | journal = {Nice Journal}, 7 | comments = {A comment}, 8 | keyword = {keyword1, keyword2}, 9 | } 10 | % comment. 11 | @ARTICLE{Baltazar2013, 12 | author = {Jean Baltazar}, 13 | title = {An amazing title}, 14 | year = {2013}, 15 | volume = {12}, 16 | journal = {Nice Journal}, 17 | comments = {A comment}, 18 | keyword = {keyword1, keyword2}, 19 | } 20 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/comments_percentage_nolastcoma.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar2013, 2 | author = {Jean Cesar}, 3 | title = {An amazing title}, 4 | year = {2013}, 5 | volume = {12}, 6 | journal = {Nice Journal}, 7 | comments = {A comment}, 8 | keyword = {keyword1, keyword2} 9 | } 10 | % comment. 11 | @ARTICLE{Baltazar2013, 12 | author = {Jean Baltazar}, 13 | title = {An amazing title}, 14 | year = {2013}, 15 | volume = {12}, 16 | journal = {Nice Journal}, 17 | comments = {A comment}, 18 | keyword = {keyword1, keyword2} 19 | } 20 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/comments_spaces_and_declarations.bib: -------------------------------------------------------------------------------- 1 | % a comment 2 | @preamble{ "Blah blah" } 3 | 4 | Another comment 5 | @string{title = {A great title} } 6 | 7 | and one more comment 8 | 9 | @ARTICLE{Cesar2013, 10 | author = {Jean César}, 11 | title = title, 12 | year = {2013}, 13 | month = "jan", 14 | volume = {12}, 15 | pages = {12-23}, 16 | journal = {Nice Journal}, 17 | abstract = {This is an abstract. This line should be long enough to test 18 | multilines... and with a french érudit word}, 19 | comments = {A comment}, 20 | keyword = {keyword1, keyword2}, 21 | } 22 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/common_strings.bib: -------------------------------------------------------------------------------- 1 | @string{jan = {January}} 2 | 3 | @string{feb = {February}} 4 | 5 | @string{mar = {March}} 6 | 7 | @string{apr = {April}} 8 | 9 | @string{may = {May}} 10 | 11 | @string{jun = {June}} 12 | 13 | @string{jul = {July}} 14 | 15 | @string{aug = {August}} 16 | 17 | @string{sep = {September}} 18 | 19 | @string{oct = {October}} 20 | 21 | @string{nov = {November}} 22 | 23 | @string{dec = {December}} 24 | 25 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/crossref_cascading.bib: -------------------------------------------------------------------------------- 1 | % From biber test data : t/tdata/crossrefs.bib 2 | % Kept initial comment but not for our purpose 3 | 4 | % Test of dependency calculations for non-cited entries 5 | 6 | @BOOK{r1, 7 | DATE = {1911}, 8 | CROSSREF = {r2} 9 | } 10 | 11 | @BOOK{r2, 12 | DATE = {1911}, 13 | CROSSREF = {r3} 14 | } 15 | 16 | @BOOK{r3, 17 | DATE = {1911}, 18 | CROSSREF = {r4} 19 | } 20 | 21 | @BOOK{r4, 22 | DATE = {1911}, 23 | } 24 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/crossref_cascading_cycle.bib: -------------------------------------------------------------------------------- 1 | % From biber test data : t/tdata/crossrefs.bib 2 | % Kept initial comment but not for our purpose 3 | 4 | % Testing circular refs detection 5 | 6 | @BOOK{circ1, 7 | DATE = {1911}, 8 | CROSSREF = {circ2} 9 | } 10 | 11 | @BOOK{circ2, 12 | DATE = {1911}, 13 | CROSSREF = {circ1} 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/encoding.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Cesar_2013, 2 | author = {Jean César}, 3 | title = {An amazing title: à}, 4 | year = {2013}, 5 | month = "jan", 6 | volume = {12}, 7 | pages = {12-23}, 8 | journal = {Elémentaire}, 9 | abstract = {This is an abstract. This line should be long enough to test 10 | multilines... and with a french érudit word}, 11 | comments = {A comment}, 12 | keywords = {keyword1, keyword2}, 13 | } 14 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/features.bib: -------------------------------------------------------------------------------- 1 | @comment{ignore this line!} 2 | @Comment{ignore this line too!} 3 | @COMMENT{and ignore this line too!} 4 | 5 | @preamble{ "\makeatletter" } 6 | @preamble{ "\@ifundefined{url}{\def\url#1{\texttt{#1}}}{}" } 7 | @preamble{ "\makeatother" } 8 | 9 | @string{mystring = "Hello"} 10 | @string{myconf = "My International Conference"} 11 | @string{myname = "Doe"} 12 | 13 | @inproceedings{mykey, 14 | author = "John", 15 | title = {Cool Stuff}, 16 | booktitle = myconf, 17 | year = 2014, 18 | } 19 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/features2.bib: -------------------------------------------------------------------------------- 1 | @string{CoOl = "Cool"} 2 | @string{stuff = "Stuff"} 3 | @string{myTitle = cool # " " # stuff} 4 | 5 | @string{int = "International"} 6 | @string{myconf = "My "#int#" Conference"} 7 | 8 | @string{myname = "Doe"} 9 | 10 | @String {firstname = "John"} 11 | @String {lastname = myname} 12 | @String {domain = "example"} 13 | @String {tld = "com"} 14 | 15 | @String {foo = "1--10"} 16 | @String {BaR = FOO} 17 | @String {pages = baR} 18 | 19 | @inproceedings{mykey, 20 | author = "John " # mynamE, 21 | title = mytitle, 22 | booktitle = myconf, 23 | pages = pages, 24 | year = 2014, 25 | note = "Email: " # firstname # "." # lastname # 26 | "@" # domain # "." # tld, 27 | } 28 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/features_output.bib: -------------------------------------------------------------------------------- 1 | @comment{ignore this line!} 2 | 3 | @comment{ignore this line too!} 4 | 5 | @comment{and ignore this line too!} 6 | 7 | @preamble{ "\makeatletter" } 8 | 9 | @preamble{ "\@ifundefined{url}{\def\url#1{\texttt{#1}}}{}" } 10 | 11 | @preamble{ "\makeatother" } 12 | 13 | @string{mystring = "Hello"} 14 | 15 | @string{myconf = "My International Conference"} 16 | 17 | @string{myname = "Doe"} 18 | 19 | @inproceedings{mykey, 20 | author = {John}, 21 | booktitle = {My International Conference}, 22 | title = {Cool Stuff}, 23 | year = {2014} 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/fieldname.bib: -------------------------------------------------------------------------------- 1 | @BOOK{Bird1987, 2 | Dc.Date = {2004-01}, 3 | } 4 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/multiline_comments.bib: -------------------------------------------------------------------------------- 1 | @comment{Lorem ipsum dolor sit amet, 2 | consectetur adipisicing elit} 3 | 4 | @comment{ 5 | Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 6 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 7 | 8 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 9 | Excepteur sint occaecat cupidatat non proident. 10 | , 11 | } 12 | 13 | @comment{ 14 | 15 | 16 | Sunt in culpa qui officia deserunt mollit anim id est laborum. 17 | 18 | 19 | } 20 | 21 | @comment{} 22 | 23 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/multiple_entries.bib: -------------------------------------------------------------------------------- 1 | @Book{Yablon2005, 2 | Title = {Optical fiber fusion slicing}, 3 | Author = {Yablon, A.D.}, 4 | Publisher = {Springer}, 5 | Year = {2005}, 6 | } 7 | 8 | @Article{Wigner1938, 9 | Title = {The transition state method}, 10 | Author = {Wigner, E.}, 11 | Journal = {Trans. Faraday Soc.}, 12 | Year = {1938}, 13 | Pages = {29--41}, 14 | Volume = {34}, 15 | Doi = {10.1039/TF9383400029}, 16 | ISSN = {0014-7672}, 17 | Owner = {fr}, 18 | Publisher = {The Royal Society of Chemistry}, 19 | } 20 | 21 | @Book{Toto3000, 22 | Title = {A title}, 23 | Author = {Toto, A and Titi, B}, 24 | } 25 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/multiple_entries_and_comments.bib: -------------------------------------------------------------------------------- 1 | @Book{Yablon2005, 2 | Title = {Optical fiber fusion slicing}, 3 | Author = {Yablon, A.D.}, 4 | Publisher = {Springer}, 5 | Year = {2005}, 6 | } 7 | 8 | @Article{Wigner1938, 9 | Title = {The transition state method}, 10 | Author = {Wigner, E.}, 11 | Journal = {Trans. Faraday Soc.}, 12 | Year = {1938}, 13 | Pages = {29--41}, 14 | Volume = {34}, 15 | Doi = {10.1039/TF9383400029}, 16 | ISSN = {0014-7672}, 17 | Owner = {fr}, 18 | Publisher = {The Royal Society of Chemistry}, 19 | } 20 | 21 | @Book{Toto3000, 22 | Title = {A title}, 23 | Author = {Toto, A and Titi, B}, 24 | } 25 | 26 | @Comment{} 27 | 28 | @Comment{A comment} 29 | 30 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/multiple_entries_and_comments_output.bib: -------------------------------------------------------------------------------- 1 | @comment{} 2 | 3 | @comment{A comment} 4 | 5 | @book{Toto3000, 6 | author = {Toto, A and Titi, B}, 7 | title = {A title} 8 | } 9 | 10 | @article{Wigner1938, 11 | author = {Wigner, E.}, 12 | doi = {10.1039/TF9383400029}, 13 | issn = {0014-7672}, 14 | journal = {Trans. Faraday Soc.}, 15 | owner = {fr}, 16 | pages = {29--41}, 17 | publisher = {The Royal Society of Chemistry}, 18 | title = {The transition state method}, 19 | volume = {34}, 20 | year = {1938} 21 | } 22 | 23 | @book{Yablon2005, 24 | author = {Yablon, A.D.}, 25 | publisher = {Springer}, 26 | title = {Optical fiber fusion slicing}, 27 | year = {2005} 28 | } 29 | 30 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/multiple_entries_output.bib: -------------------------------------------------------------------------------- 1 | @book{Toto3000, 2 | author = {Toto, A and Titi, B}, 3 | title = {A title} 4 | } 5 | 6 | @article{Wigner1938, 7 | author = {Wigner, E.}, 8 | doi = {10.1039/TF9383400029}, 9 | issn = {0014-7672}, 10 | journal = {Trans. Faraday Soc.}, 11 | owner = {fr}, 12 | pages = {29--41}, 13 | publisher = {The Royal Society of Chemistry}, 14 | title = {The transition state method}, 15 | volume = {34}, 16 | year = {1938} 17 | } 18 | 19 | @book{Yablon2005, 20 | author = {Yablon, A.D.}, 21 | publisher = {Springer}, 22 | title = {Optical fiber fusion slicing}, 23 | year = {2005} 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/string.bib: -------------------------------------------------------------------------------- 1 | @STRING{oakland = {Proceedings of the {IEEE} Symposium on Security and Privacy}} 2 | @INPROCEEDINGS{cha:oakland15, 3 | author = {Sang Kil Cha and Maverick Woo and David Brumley}, 4 | title = {{Program-Adaptive Mutational Fuzzing}}, 5 | booktitle = oakland, 6 | year = {2015}, 7 | pages = {725--741} 8 | } 9 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/traps.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Laide2013, 2 | author = {Jean Laid{\'e}, 3 | Ben Loaeb}, 4 | title = {{An} amazing {title}}, 5 | year = {2013}, 6 | month = "jan", 7 | volume = {n.s.~2}, 8 | pages = {12-23}, 9 | journal = {Nice Journal}, 10 | abstract = {This is an abstract. This line should be long enough to test 11 | multilines... and with a french érudit word}, 12 | comments = {A comment}, 13 | keywords = {keyword1, keyword2}, 14 | } 15 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/website.bib: -------------------------------------------------------------------------------- 1 | @misc{feder2006, 2 | title = {BibTeX}, 3 | author = {Alexander Feder}, 4 | link = {http://bibtex.org}, 5 | year = {2006} 6 | } 7 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/wrong.bib: -------------------------------------------------------------------------------- 1 | 2 | 3 | @wrong{foo, 4 | author = {wrong} 5 | } 6 | 7 | @article{bar, 8 | author = {correct} 9 | } 10 | -------------------------------------------------------------------------------- /test/bibliographies/python-bibtexparser/xref_missing_entries.bib: -------------------------------------------------------------------------------- 1 | % From biber test data : t/tdata/crossrefs.bib 2 | % Kept initial comment but not for our purpose 3 | 4 | % Testing missing xref 5 | @INBOOK{mxr, 6 | AUTHOR = {Megan Mistrel}, 7 | TITLE = {Lumbering Lunatics}, 8 | ORIGDATE = {1933}, 9 | XREF = {missing1} 10 | } 11 | -------------------------------------------------------------------------------- /test/big-numbers.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @article{blah, 6 | title={Blah}, 7 | isbn=993320203004020203040583893423432329499585399559303, 8 | year=2009 9 | }`; 10 | 11 | const output = bibtex` 12 | @article{blah, 13 | title = {Blah}, 14 | isbn = 993320203004020203040583893423432329499585399559303, 15 | year = 2009 16 | } 17 | `; 18 | 19 | test("should not mess up long numbers", async () => { 20 | const tidied = await bibtexTidy(input); 21 | strictEqual(tidied.bibtex, output); 22 | }); 23 | -------------------------------------------------------------------------------- /test/blank-lines.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @preamble{Foo} 6 | Comment 7 | @article{foo, 8 | title={Foo} 9 | } 10 | @article{bar, 11 | title={Bar} 12 | }`; 13 | 14 | const expected = bibtex` 15 | @preamble{Foo} 16 | 17 | Comment 18 | @article{foo, 19 | title = {Foo} 20 | } 21 | 22 | @article{bar, 23 | title = {Bar} 24 | } 25 | `; 26 | 27 | test("insert blank lines between blocks", async () => { 28 | const output = await bibtexTidy(input, { blankLines: true }); 29 | strictEqual(output.bibtex, expected); 30 | }); 31 | -------------------------------------------------------------------------------- /test/cli-backup.spec.ts: -------------------------------------------------------------------------------- 1 | import { match, strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { readFile } from "node:fs/promises"; 4 | import { BIN_PATH } from "./targets/cli"; 5 | import { bibtex, test, tmpfile } from "./utils"; 6 | 7 | const input = bibtex`@article{a,number={1},title={A}}`; 8 | 9 | test("CLI should allowing creating backup in modify mode", async () => { 10 | const path = await tmpfile(input); 11 | spawnSync(BIN_PATH, [path, "--modify", "--backup"], { encoding: "utf8" }); 12 | strictEqual(await readFile(`${path}.original`, "utf8"), input); 13 | }); 14 | 15 | test("CLI should error if creating backup in non-modify mode", async () => { 16 | const path = await tmpfile(input); 17 | const proc = spawnSync(BIN_PATH, [path, "--output", "foo.bib", "--backup"], { 18 | encoding: "utf8", 19 | }); 20 | strictEqual(await readFile(path, "utf8"), input); 21 | match( 22 | proc.stderr, 23 | /--backup is only permitted when --modify\/-m is provided/, 24 | ); 25 | strictEqual(proc.stdout, ""); 26 | strictEqual(proc.status, 1); 27 | }); 28 | 29 | test("CLI should create backup by default in legacy modify mode", async () => { 30 | const path = await tmpfile(input); 31 | spawnSync(BIN_PATH, [path], { encoding: "utf8" }); 32 | strictEqual(await readFile(`${path}.original`, "utf8"), input); 33 | }); 34 | -------------------------------------------------------------------------------- /test/cli-help.spec.ts: -------------------------------------------------------------------------------- 1 | import { match, strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { test } from "./utils"; 5 | 6 | test("CLI help", async () => { 7 | const proc1 = spawnSync(BIN_PATH, [], { 8 | encoding: "utf8", 9 | stdio: ["inherit", "pipe", "pipe"], 10 | }); 11 | const proc2 = spawnSync(BIN_PATH, ["--help"], { encoding: "utf8" }); 12 | 13 | strictEqual(proc1.stdout, proc2.stdout); 14 | match(proc1.stdout, /cleaner and formatter/i); 15 | match(proc1.stdout, /Examples/i); 16 | match(proc1.stdout, /--space/i); 17 | }); 18 | -------------------------------------------------------------------------------- /test/cli-infile.spec.ts: -------------------------------------------------------------------------------- 1 | import { match, strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { bibtex, test, tmpfile } from "./utils"; 5 | 6 | const input = bibtex` 7 | @article{a, 8 | number={1}, 9 | title={A} 10 | }`; 11 | 12 | const output = bibtex` 13 | @article{a, 14 | number = {1}, 15 | title = {A} 16 | } 17 | `; 18 | 19 | test("CLI should accept input from a file (v2 flag)", async () => { 20 | const path = await tmpfile(input); 21 | const proc1 = spawnSync(BIN_PATH, [path, "--v2"], { encoding: "utf8" }); 22 | strictEqual(proc1.stdout, output); 23 | }); 24 | 25 | test("CLI should not allow multiple input files without --modify (v2 flag)", async () => { 26 | const path1 = await tmpfile(input); 27 | const path2 = await tmpfile(input); 28 | const proc1 = spawnSync(BIN_PATH, [path1, path2, "--v2"], { 29 | encoding: "utf8", 30 | }); 31 | strictEqual(proc1.status, 1); 32 | match( 33 | proc1.stderr, 34 | /Only one input file permitted unless using --modify\/-m/, 35 | ); 36 | }); 37 | -------------------------------------------------------------------------------- /test/cli-input-path-with-spaces.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const file1 = bibtex` 5 | @article{a, 6 | number={1} 7 | }`; 8 | 9 | const output1 = bibtex` 10 | @article{a, 11 | number = {1} 12 | } 13 | `; 14 | 15 | test("input paths with spaces", async () => { 16 | const tidied = await bibtexTidy([file1], undefined, ["cli"], { 17 | inputPaths: ["foo bar.bib"], 18 | }); 19 | strictEqual(tidied.cli?.bibtexs[0], output1); 20 | }); 21 | -------------------------------------------------------------------------------- /test/cli-outfile.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { readFile } from "node:fs/promises"; 4 | import { BIN_PATH } from "./targets/cli"; 5 | import { bibtex, test, tmpfile } from "./utils"; 6 | 7 | const input = bibtex` 8 | @article{a, 9 | number={1}, 10 | title={A} 11 | }`; 12 | 13 | const output = bibtex` 14 | @article{a, 15 | number = {1}, 16 | title = {A} 17 | } 18 | `; 19 | 20 | test("CLI should output to specified file", async () => { 21 | const infile = await tmpfile(input); 22 | const outfile = await tmpfile(""); 23 | spawnSync(BIN_PATH, [infile, "--output", outfile], { encoding: "utf8" }); 24 | strictEqual(await readFile(infile, "utf8"), input); 25 | strictEqual(await readFile(outfile, "utf8"), output); 26 | }); 27 | 28 | test("CLI should output to specified file (from stdin)", async () => { 29 | const outfile = await tmpfile(""); 30 | spawnSync(BIN_PATH, ["--output", outfile], { 31 | input, 32 | encoding: "utf8", 33 | }); 34 | strictEqual(await readFile(outfile, "utf8"), output); 35 | }); 36 | -------------------------------------------------------------------------------- /test/cli-stdin.spec.ts: -------------------------------------------------------------------------------- 1 | import { match, strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { bibtex, test } from "./utils"; 5 | 6 | const input = bibtex` 7 | @article{a, 8 | number={1}, 9 | title={A} 10 | }`; 11 | 12 | const output = bibtex` 13 | @article{a, 14 | number = {1}, 15 | title = {A} 16 | } 17 | `; 18 | 19 | test("CLI should accept stdin", async () => { 20 | const proc = spawnSync(BIN_PATH, [], { input, encoding: "utf8" }); 21 | strictEqual(proc.stdout, output); 22 | }); 23 | 24 | test("CLI should throw if specifying --backup with stdin", async () => { 25 | const proc = spawnSync(BIN_PATH, ["--backup"], { input, encoding: "utf8" }); 26 | match(proc.stderr, /--backup is only valid when specifying input files/); 27 | strictEqual(proc.stdout, ""); 28 | strictEqual(proc.status, 1); 29 | }); 30 | 31 | test("CLI should throw if specifying --modify with stdin", async () => { 32 | const proc = spawnSync(BIN_PATH, ["--modify"], { input, encoding: "utf8" }); 33 | match(proc.stderr, /--modify\/-m is only valid when specifying input files/); 34 | strictEqual(proc.stdout, ""); 35 | strictEqual(proc.status, 1); 36 | }); 37 | -------------------------------------------------------------------------------- /test/cli-stdout.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { bibtex, test } from "./utils"; 5 | 6 | const input = bibtex` 7 | @article{a, 8 | number={1}, 9 | title={A} 10 | }`; 11 | 12 | const output = bibtex` 13 | @article{a, 14 | number = {1}, 15 | title = {A} 16 | } 17 | `; 18 | 19 | test("CLI should output to stdout if no out file specified", async () => { 20 | const proc = spawnSync(BIN_PATH, [], { input, encoding: "utf8" }); 21 | strictEqual(proc.stdout, output); 22 | }); 23 | -------------------------------------------------------------------------------- /test/cli-unknown-argument.spec.ts: -------------------------------------------------------------------------------- 1 | import { match, strictEqual } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { test } from "./utils"; 5 | 6 | test("CLI should warn if an unknown argument is provided", async () => { 7 | const proc = spawnSync(BIN_PATH, ["--foobar"], { encoding: "utf8" }); 8 | strictEqual(proc.status, 1); 9 | match(proc.stderr, /Unknown option: --foobar/); 10 | }); 11 | -------------------------------------------------------------------------------- /test/cli-version.spec.ts: -------------------------------------------------------------------------------- 1 | import { match } from "node:assert"; 2 | import { spawnSync } from "node:child_process"; 3 | import { BIN_PATH } from "./targets/cli"; 4 | import { test } from "./utils"; 5 | 6 | test("CLI version", async () => { 7 | const proc = spawnSync(BIN_PATH, ["--version"], { encoding: "utf8" }); 8 | match(proc.stdout, /^v\d+\.\d+.\d+\n$/); 9 | }); 10 | -------------------------------------------------------------------------------- /test/concatenation.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {test, 6 | author = aubert#" and "#Varacca, 7 | journal = abc # { 123 }, 8 | title = "A"#"B" 9 | }`; 10 | 11 | const output = bibtex` 12 | @article{test, 13 | author = aubert # " and " # Varacca, 14 | journal = abc # { 123 }, 15 | title = "A" # "B" 16 | } 17 | `; 18 | 19 | test("remove empty fields", async () => { 20 | const tidiedWithEmpty = await bibtexTidy(input); 21 | strictEqual(tidiedWithEmpty.bibtex, output); 22 | }); 23 | -------------------------------------------------------------------------------- /test/defaults.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | number={1}, 7 | title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | author="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const output = bibtex` 17 | @article{feinberg1983technique, 18 | number = {1}, 19 | title = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 20 | author = "Feinberg, Andrew P and Vogelstein, Bert", 21 | journal = {Analytical biochemistry}, 22 | volume = 132, 23 | pages = {6--13}, 24 | year = {1983}, 25 | month = {aug}, 26 | publisher = {Elsevier} 27 | } 28 | `; 29 | 30 | test("defaults", async () => { 31 | const tidied = await bibtexTidy(input); 32 | strictEqual(tidied.bibtex, output); 33 | }); 34 | -------------------------------------------------------------------------------- /test/drop-all-caps.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | 6 | @inproceedings{Smith2009, 7 | author="Caroline JA Smith", 8 | year=2009, 9 | month=dec, 10 | title={{Quantum somethings}},journal={Journal of {B}lah}, 11 | booktitle={JOURNAL OF SOMETHINGS}, 12 | url={http://example.com/something_with/unusual?characters=faoo#bar}, 13 | volume = {VOLUME VII} 14 | }`; 15 | 16 | const output = bibtex` 17 | @inproceedings{Smith2009, 18 | author = "Caroline JA Smith", 19 | year = 2009, 20 | month = dec, 21 | title = {{Quantum somethings}}, 22 | journal = {Journal of {B}lah}, 23 | booktitle = {Journal Of Somethings}, 24 | url = {http://example.com/something_with/unusual?characters=faoo#bar}, 25 | volume = {Volume VII} 26 | } 27 | `; 28 | 29 | test("drop all caps", async () => { 30 | const tidied = await bibtexTidy(input, { dropAllCaps: true }); 31 | strictEqual(tidied.bibtex, output); 32 | }); 33 | -------------------------------------------------------------------------------- /test/duplicate-merge-combine.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{sweig42, 6 | title = {The impossible book}, 7 | author = {Stefa{n} Sweig}, 8 | year = 1942, 9 | month = mar, 10 | publisher = {Dead Poet Society} 11 | } 12 | @book{sweigdd42, 13 | title = {The impossible BOOK}, 14 | author = {Stefa{n} Sweig}, 15 | year = 1942, 16 | month = mar, 17 | publisher = {Dead Poet Society}, 18 | n=1 19 | }`; 20 | 21 | const output = bibtex` 22 | @book{sweig42, 23 | title = {The impossible book}, 24 | author = {Stefa{n} Sweig}, 25 | year = 1942, 26 | month = mar, 27 | publisher = {Dead Poet Society}, 28 | n = 1 29 | } 30 | `; 31 | 32 | test("merge duplicates (combine)", async () => { 33 | const tidied = await bibtexTidy(input, { merge: "combine" }); 34 | const warnings = tidied.api?.warnings.filter( 35 | (w) => w.code === "DUPLICATE_ENTRY", 36 | ); 37 | strictEqual(tidied.bibtex, output); 38 | strictEqual(warnings?.length, 1); 39 | }); 40 | -------------------------------------------------------------------------------- /test/duplicate-merge-first.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{sweig42, 6 | title = {The impossible book}, 7 | author = {Stefa{n} Sweig}, 8 | year = 1942, 9 | month = mar, 10 | publisher = {Dead Poet Society} 11 | } 12 | @book{sweigdd42, 13 | title = {The impossible BOOK}, 14 | author = {Stefa{n} Sweig}, 15 | year = 1942, 16 | month = mar, 17 | publisher = {Dead Poet Society}, 18 | n=1 19 | }`; 20 | 21 | const output = bibtex` 22 | @book{sweig42, 23 | title = {The impossible book}, 24 | author = {Stefa{n} Sweig}, 25 | year = 1942, 26 | month = mar, 27 | publisher = {Dead Poet Society} 28 | } 29 | `; 30 | 31 | test("merge duplicates (keep first)", async () => { 32 | const tidied = await bibtexTidy(input, { merge: "first" }); 33 | const warnings = tidied.api?.warnings.filter( 34 | (w) => w.code === "DUPLICATE_ENTRY", 35 | ); 36 | strictEqual(tidied.bibtex, output); 37 | strictEqual(warnings?.length, 1); 38 | }); 39 | -------------------------------------------------------------------------------- /test/duplicate-merge-keys.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{sweig42, 6 | title = {The impossible book}, 7 | author = {Stefa{n} Sweig}, 8 | year = 1942, 9 | month = mar, 10 | publisher = {Dead Poet Society} 11 | } 12 | @book{sweig42, 13 | title = {Foo}, 14 | author = {Bar}, 15 | n = 1 16 | }`; 17 | 18 | const output = bibtex` 19 | @book{sweig42, 20 | title = {The impossible book}, 21 | author = {Stefa{n} Sweig}, 22 | year = 1942, 23 | month = mar, 24 | publisher = {Dead Poet Society}, 25 | n = 1 26 | } 27 | `; 28 | 29 | test("merge duplicates (combine)", async () => { 30 | const tidied = await bibtexTidy(input, { 31 | duplicates: ["key"], 32 | merge: "combine", 33 | }); 34 | const warnings = tidied.api?.warnings.filter( 35 | (w) => w.code === "DUPLICATE_ENTRY", 36 | ); 37 | strictEqual(tidied.bibtex, output); 38 | strictEqual(warnings?.length, 1); 39 | }); 40 | -------------------------------------------------------------------------------- /test/duplicate-merge-last.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{sweig42, 6 | title = {The impossible book}, 7 | author = {Stefa{n} Sweig}, 8 | year = 1942, 9 | month = mar, 10 | publisher = {Dead Poet Society} 11 | } 12 | @book{sweigdd42, 13 | title = {The impossible BOOK}, 14 | author = {Stefa{n} Sweig}, 15 | year = 1942, 16 | month = mar, 17 | publisher = {Dead Poet Society}, 18 | n=1 19 | }`; 20 | 21 | const output = bibtex` 22 | @book{sweigdd42, 23 | title = {The impossible BOOK}, 24 | author = {Stefa{n} Sweig}, 25 | year = 1942, 26 | month = mar, 27 | publisher = {Dead Poet Society}, 28 | n = 1 29 | } 30 | `; 31 | 32 | test("merge duplicates (keep last)", async () => { 33 | const tidied = await bibtexTidy(input, { merge: "last" }); 34 | const warnings = tidied.api?.warnings.filter( 35 | (w) => w.code === "DUPLICATE_ENTRY", 36 | ); 37 | strictEqual(tidied.bibtex, output); 38 | strictEqual(warnings?.length, 1); 39 | }); 40 | -------------------------------------------------------------------------------- /test/duplicate-merge-overwrite.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{sweig42, 6 | title = {The impossible book}, 7 | author = {Stefa{n} Sweig}, 8 | year = 1942, 9 | month = mar, 10 | publisher = {Dead Poet Society} 11 | } 12 | @book{sweigdd42, 13 | title = {The impossible BOOK}, 14 | author = {Stefa{n} Sweig}, 15 | year = 1942, 16 | month = mar, 17 | publisher = {Dead Poet Society}, 18 | n=1 19 | }`; 20 | 21 | const output = bibtex` 22 | @book{sweig42, 23 | title = {The impossible BOOK}, 24 | author = {Stefa{n} Sweig}, 25 | year = 1942, 26 | month = mar, 27 | publisher = {Dead Poet Society}, 28 | n = 1 29 | } 30 | `; 31 | 32 | test("merge duplicates (overwrite)", async () => { 33 | const tidied = await bibtexTidy(input, { merge: "overwrite" }); 34 | const warnings = tidied.api?.warnings.filter( 35 | (w) => w.code === "DUPLICATE_ENTRY", 36 | ); 37 | strictEqual(tidied.bibtex, output); 38 | strictEqual(warnings?.length, 1); 39 | }); 40 | -------------------------------------------------------------------------------- /test/empty-entry.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @misc{emptyref, 6 | 7 | } 8 | @misc{emptyref2 9 | 10 | }`; 11 | 12 | const output = bibtex` 13 | @misc{emptyref, 14 | } 15 | @misc{emptyref2, 16 | } 17 | `; 18 | 19 | test("empty entry", async () => { 20 | const tidied = await bibtexTidy(input); 21 | strictEqual(output, tidied.bibtex); 22 | }); 23 | -------------------------------------------------------------------------------- /test/empty-key.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @article{ 6 | title = "A year of trees", 7 | volume = {5}, 8 | number = 6 9 | }`; 10 | 11 | const output = bibtex` 12 | @article{ 13 | title = "A year of trees", 14 | volume = {5}, 15 | number = 6 16 | } 17 | `; 18 | 19 | test("empty key", async () => { 20 | const tidied = await bibtexTidy(input); 21 | strictEqual(output, tidied.bibtex); 22 | }); 23 | -------------------------------------------------------------------------------- /test/enclosing-braces-around-command.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @incollection{BlattelMink2021, 6 | title = {{Das Innovationsverst{\"a}ndnis von Joseph A. Schumpeter}}, 7 | author = {Bl{\"a}ttel-Mink, Birgit}, 8 | }`; 9 | 10 | const output = bibtex` 11 | @incollection{BlattelMink2021, 12 | title = {{Das Innovationsverst{\"a}ndnis von Joseph A. Schumpeter}}, 13 | author = {Bl{\"a}ttel-Mink, Birgit} 14 | } 15 | `; 16 | 17 | // https://github.com/FlamingTempura/bibtex-tidy/issues/423 18 | test("enclosing braces should keep braces directly around commands", async () => { 19 | const tidied1 = await bibtexTidy(input, { enclosingBraces: true }); 20 | strictEqual(output, tidied1.bibtex); 21 | }); 22 | -------------------------------------------------------------------------------- /test/enclosing-braces-with-escape.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @article{foo, 6 | title = {{bar \& baz}}, 7 | author={Garc{\'\i}a-Patr{\'o}n, Ra{\'u}l and Renema, Jelmer J and Shchesnovich, Valery} 8 | }`; 9 | 10 | const expected = bibtex` 11 | @article{foo, 12 | title = {{bar \& baz}}, 13 | author = {Garc{\'\i}a-Patr{\'o}n, Ra{\'u}l and Renema, Jelmer J and Shchesnovich, Valery} 14 | } 15 | `; 16 | 17 | // https://github.com/FlamingTempura/bibtex-tidy/issues/406 18 | test("enclosing braces should work with escapes", async () => { 19 | const output = await bibtexTidy(input, { enclosingBraces: true }); 20 | strictEqual(output.bibtex, expected); 21 | }); 22 | -------------------------------------------------------------------------------- /test/encode-urls.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @inproceedings{Smith2009, 6 | url={http://example.com/something_with/unusual?characters=faoo#bar} 7 | }`; 8 | 9 | const expectedUnencoded = bibtex` 10 | @inproceedings{Smith2009, 11 | url = {http://example.com/something_with/unusual?characters=faoo#bar} 12 | } 13 | `; 14 | 15 | const expectedEncoded = bibtex` 16 | @inproceedings{Smith2009, 17 | url = {http://example.com/something\%5Fwith/unusual?characters=faoo#bar} 18 | } 19 | `; 20 | 21 | test("encode urls", async () => { 22 | const output1 = await bibtexTidy(input, { encodeUrls: false }); 23 | strictEqual(output1.bibtex, expectedUnencoded); 24 | 25 | const output2 = await bibtexTidy(input, { encodeUrls: true }); 26 | strictEqual(output2.bibtex, expectedEncoded); 27 | }); 28 | -------------------------------------------------------------------------------- /test/escape.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @misc{q, 6 | author = {Chars \", _, $, @, &, é, ɛ, ū, {"}}, 7 | title = {Math expression $\\alpha$ stay unescaped} 8 | }`; 9 | 10 | const outputEscaped = bibtex` 11 | @misc{q, 12 | author = {Chars \", \_, \$, \@, \&, \'{e}, \varepsilon{}, \={u}, {"}}, 13 | title = {Math expression $\\alpha$ stay unescaped} 14 | } 15 | `; 16 | 17 | const outputUnescaped = bibtex` 18 | @misc{q, 19 | author = {Chars \", _, $, @, &, é, ɛ, ū, {"}}, 20 | title = {Math expression $\\alpha$ stay unescaped} 21 | } 22 | `; 23 | 24 | test("do not escape latex characters", async () => { 25 | const tidied1 = await bibtexTidy(input, { escape: true }); 26 | strictEqual(tidied1.bibtex, outputEscaped); 27 | 28 | const tidied2 = await bibtexTidy(input, { escape: false }); 29 | strictEqual(tidied2.bibtex, outputUnescaped); 30 | }); 31 | -------------------------------------------------------------------------------- /test/extended-name-format.spec.ts: -------------------------------------------------------------------------------- 1 | import { bibtex, bibtexTidy, test } from "./utils"; 2 | 3 | const input = bibtex` 4 | @CUSTOMD{LDN3, 5 | OPTIONS = {labelalphanametemplatename=customd}, 6 | AUTHOR = {Vela, Luis and given={Ura Ru}, family={Juan}, suffix={Sr}, prefix={von}}, 7 | } 8 | `; 9 | 10 | test("extended name format (BibLaTeX)", async () => { 11 | // just check it parses 12 | await bibtexTidy(input); 13 | }); 14 | -------------------------------------------------------------------------------- /test/indent-tab.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | number={1}, 7 | title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | author="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const output = bibtex` 17 | @article{feinberg1983technique, 18 | number = {1}, 19 | title = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 20 | author = "Feinberg, Andrew P and Vogelstein, Bert", 21 | journal = {Analytical biochemistry}, 22 | volume = 132, 23 | pages = {6--13}, 24 | year = {1983}, 25 | month = {aug}, 26 | publisher = {Elsevier} 27 | } 28 | `; 29 | 30 | test("indent with tabs", async () => { 31 | const tidied = await bibtexTidy(input, { tab: true }); 32 | strictEqual(tidied.bibtex, output); 33 | }); 34 | -------------------------------------------------------------------------------- /test/leading-commas.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE{Cesar2013 6 | , author = {Jean César} 7 | , title = {An amazing title} 8 | , year = {2013} 9 | , month = jan 10 | , volume = {12} 11 | , pages = {12--23} 12 | , journal = {Nice Journal} 13 | , abstract = {This is an abstract. This line should be long enough to test} 14 | , comments = {A comment} 15 | , keywords = {keyword1, keyword2} 16 | }`; 17 | 18 | const output = bibtex` 19 | @article{Cesar2013, 20 | author = {Jean C\'{e}sar}, 21 | title = {An amazing title}, 22 | year = {2013}, 23 | month = jan, 24 | volume = {12}, 25 | pages = {12--23}, 26 | journal = {Nice Journal}, 27 | abstract = {This is an abstract. This line should be long enough to test}, 28 | comments = {A comment}, 29 | keywords = {keyword1, keyword2} 30 | } 31 | `; 32 | 33 | test("leading commas", async () => { 34 | const tidied = await bibtexTidy(input); // leading commas - #48 35 | strictEqual(tidied.bibtex, output); 36 | }); 37 | -------------------------------------------------------------------------------- /test/max-authors.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {test, 6 | author={Saija Meryem and Kamal Tel and Erika Graziano and Steve Naliaka and Vilmar Kaveri and Yaƙubu Paisley and Daniel Ayaz and Lenore Siemowit and Damian Nurbek and Moreno Kristine and Kortney Tatiana and Zosimos Concepta and Gebahard Jean-Charles and Lamija Nagendra and Liidia Nunziatina and Mattias Erika and Zorione Dona and Gyeong-Suk Netanyahu and Shaniqua Oier and Kiley Mehrnaz and Şan Christina and Stefanie Puleng and Regīna Kristofor and Pancratius Grigori and Viktor Ami and Walter Enya and Coeus Ariah and Rosalía Cyrilla and Iomhar Lyyti and Birgit Costantino} 7 | } 8 | @ARTICLE {test2, 9 | author={Saija Meryem and Kamal Tel} 10 | }`; 11 | 12 | const output = bibtex` 13 | @article{test, 14 | author = {Saija Meryem and Kamal Tel and Erika Graziano and Steve Naliaka and others} 15 | } 16 | @article{test2, 17 | author = {Saija Meryem and Kamal Tel} 18 | } 19 | `; 20 | 21 | test("maximum number of authors", async () => { 22 | const tidied = await bibtexTidy(input, { maxAuthors: 4 }); 23 | strictEqual(tidied.bibtex, output); 24 | }); 25 | -------------------------------------------------------------------------------- /test/multiline-field.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = `% Entries 5 | @ARTICLE{Cesar2013, 6 | author = {{A}, 7 | B. \r\nand {C},\rD.}, 8 | title = {An amazing title}, 9 | volume="n.s.~2", 10 | }`; 11 | 12 | const output = bibtex` 13 | % Entries 14 | @article{Cesar2013, 15 | author = {{A}, B. and {C}, D.}, 16 | title = {An amazing title}, 17 | volume = "n.s.~2" 18 | } 19 | `; 20 | 21 | test("multiline fields", async () => { 22 | const tidied = await bibtexTidy(input); // #86, #177 (multiline fields), #198 (ACM bibtex) 23 | strictEqual(tidied.bibtex, output); 24 | }); 25 | -------------------------------------------------------------------------------- /test/multiple-files.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const file1 = bibtex` 5 | @article{a, 6 | number={1}, 7 | title={A} 8 | }`; 9 | 10 | const file2 = bibtex` 11 | @article{b, 12 | number={1}, 13 | title={B} 14 | }`; 15 | 16 | const output1 = bibtex` 17 | @article{a, 18 | number = {1}, 19 | title = {A} 20 | } 21 | `; 22 | 23 | const output2 = bibtex` 24 | @article{b, 25 | number = {1}, 26 | title = {B} 27 | } 28 | `; 29 | 30 | test("multiple files", async () => { 31 | const tidied = await bibtexTidy([file1, file2], undefined, ["cli"]); 32 | strictEqual(tidied.cli?.bibtexs[0], output1); 33 | strictEqual(tidied.cli.bibtexs[1], output2); 34 | }); 35 | -------------------------------------------------------------------------------- /test/no-lowercase.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | Number={1}, 7 | TITLE={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | authOr="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const output = bibtex` 17 | @ARTICLE{feinberg1983technique, 18 | Number = {1}, 19 | TITLE = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 20 | authOr = "Feinberg, Andrew P and Vogelstein, Bert", 21 | journal = {Analytical biochemistry}, 22 | volume = 132, 23 | pages = {6--13}, 24 | year = {1983}, 25 | month = {aug}, 26 | publisher = {Elsevier} 27 | } 28 | `; 29 | 30 | test("keep original casing", async () => { 31 | const tidied = await bibtexTidy(input, { lowercase: false }); 32 | strictEqual(tidied.bibtex, output); 33 | }); 34 | -------------------------------------------------------------------------------- /test/numeric.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | number={1}, 7 | title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | author="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const expected = bibtex` 17 | @article{feinberg1983technique, 18 | number = 1, 19 | title = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 20 | author = "Feinberg, Andrew P and Vogelstein, Bert", 21 | journal = {Analytical biochemistry}, 22 | volume = 132, 23 | pages = {6--13}, 24 | year = 1983, 25 | month = {aug}, 26 | publisher = {Elsevier} 27 | } 28 | `; 29 | 30 | test("numeric (enforce numeric values)", async () => { 31 | const output = await bibtexTidy(input, { numeric: true }); 32 | strictEqual(output.bibtex, expected); 33 | }); 34 | -------------------------------------------------------------------------------- /test/omit-properties.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | number={1}, 7 | title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | author="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const output = bibtex` 17 | @article{feinberg1983technique, 18 | number = {1}, 19 | author = "Feinberg, Andrew P and Vogelstein, Bert", 20 | journal = {Analytical biochemistry}, 21 | volume = 132, 22 | year = {1983}, 23 | month = {aug}, 24 | publisher = {Elsevier} 25 | } 26 | `; 27 | 28 | test("omit properties", async () => { 29 | const tidied = await bibtexTidy(input, { omit: ["title", "pages"] }); 30 | strictEqual(tidied.bibtex, output); 31 | }); 32 | -------------------------------------------------------------------------------- /test/paragraph.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = `@ARTICLE {foobar, 5 | title={Foo Bar}, 6 | abstract={ 7 | Paragraph 1 8 | ...continued 9 | 10 | Paragraph 2\r\n\r\nParagraph 3\r\rParagraph 4 11 | }, 12 | }`; 13 | 14 | const output = bibtex` 15 | @article{foobar, 16 | title = {Foo Bar}, 17 | abstract = { 18 | Paragraph 1 ...continued 19 | 20 | Paragraph 2 21 | 22 | Paragraph 3 23 | 24 | Paragraph 4 25 | } 26 | } 27 | `; 28 | 29 | test("paragraphs in values", async () => { 30 | const tidied = await bibtexTidy(input, { align: 20 }); 31 | strictEqual(tidied.bibtex, output); 32 | }); 33 | -------------------------------------------------------------------------------- /test/remove-braces.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {quant, 6 | title = {Quantifying {Madness} in {Green {Leaf}} Ants}, 7 | shorttitle = {Quantifying \\textbf{Madness} in {Green {Leaf}} Ants} 8 | }`; 9 | 10 | const output1 = bibtex` 11 | @article{quant, 12 | title = {Quantifying Madness in Green Leaf Ants}, 13 | shorttitle = {Quantifying \\textbf{Madness} in Green Leaf Ants} 14 | } 15 | `; 16 | 17 | const output2 = bibtex` 18 | @article{quant, 19 | title = {Quantifying Madness in Green Leaf Ants}, 20 | shorttitle = {Quantifying \\textbf{Madness} in {Green {Leaf}} Ants} 21 | } 22 | `; 23 | 24 | test("enclosing braces", async () => { 25 | const tidied1 = await bibtexTidy(input, { 26 | removeBraces: ["title", "shorttitle"], 27 | }); 28 | strictEqual(output1, tidied1.bibtex); 29 | 30 | const tidied2 = await bibtexTidy(input, { removeBraces: true }); 31 | strictEqual(output2, tidied2.bibtex); 32 | }); 33 | -------------------------------------------------------------------------------- /test/remove-duplicate-fields.spec.ts: -------------------------------------------------------------------------------- 1 | import { deepStrictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @book{test, 6 | author = "Alan, Jo", 7 | author = "Alan, Les", 8 | year = {1990}, 9 | title = {Methods} 10 | }`; 11 | 12 | const output1 = bibtex` 13 | @book{test, 14 | author = "Alan, Jo", 15 | year = {1990}, 16 | title = {Methods} 17 | } 18 | `; 19 | 20 | const output2 = bibtex` 21 | @book{test, 22 | author = "Alan, Jo", 23 | author = "Alan, Les", 24 | year = {1990}, 25 | title = {Methods} 26 | } 27 | `; 28 | 29 | test("remove duplicate fields", async () => { 30 | const tidied1 = await bibtexTidy(input, {}); 31 | const tidied2 = await bibtexTidy(input, { removeDuplicateFields: false }); 32 | 33 | deepStrictEqual(tidied1.bibtex, output1); 34 | deepStrictEqual(tidied2.bibtex, output2); 35 | }); 36 | -------------------------------------------------------------------------------- /test/sort-special.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | %references 6 | @article{foo, 7 | title="Foo" 8 | } 9 | @preamble{{abc}} 10 | @xdata{data,a={1}} 11 | % last thing 12 | @article{bar, 13 | title="Bar" 14 | } 15 | @string{fooobaar} 16 | @article{foobar, 17 | title="Bar" 18 | } 19 | % another last thing 20 | @string{fooo} 21 | @xdata{moo,boo={hoo}} 22 | `; 23 | 24 | const output = bibtex` 25 | @preamble{{abc}} 26 | @xdata{data, 27 | a = {1} 28 | } 29 | @string{fooobaar} 30 | % another last thing 31 | @string{fooo} 32 | @xdata{moo, 33 | boo = {hoo} 34 | } 35 | %references 36 | @article{foo, 37 | title = "Foo" 38 | } 39 | % last thing 40 | @article{bar, 41 | title = "Bar" 42 | } 43 | @article{foobar, 44 | title = "Bar" 45 | } 46 | `; 47 | 48 | test("sort entries by special entries first", async () => { 49 | const tidied = await bibtexTidy(input, { sort: ["special"] }); 50 | strictEqual(tidied.bibtex, output); 51 | }); 52 | -------------------------------------------------------------------------------- /test/spacing-before-first-entry.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | 6 | @article{a, 7 | title = {Something}, 8 | } 9 | 10 | @article{b, 11 | title = {Something}, 12 | } 13 | 14 | @article{c, 15 | title = {Something}, 16 | } 17 | `; 18 | 19 | const expected = bibtex` 20 | @article{a, 21 | title = {Something} 22 | } 23 | @article{b, 24 | title = {Something} 25 | } 26 | @article{c, 27 | title = {Something} 28 | } 29 | `; 30 | 31 | test("spacing before first entry", async () => { 32 | const output = await bibtexTidy(input, { tidyComments: false }); 33 | strictEqual(output.bibtex, expected); 34 | }); 35 | -------------------------------------------------------------------------------- /test/strip-double-brace.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | 6 | @inproceedings{Smith2009, 7 | author="Caroline JA Smith", 8 | year=2009, 9 | month=dec, 10 | title={{Quantum somethings}},journal={Journal of {B}lah}, 11 | booktitle={JOURNAL OF SOMETHINGS} 12 | }`; 13 | 14 | const output = bibtex` 15 | @inproceedings{Smith2009, 16 | author = "Caroline JA Smith", 17 | year = 2009, 18 | month = dec, 19 | title = {Quantum somethings}, 20 | journal = {Journal of {B}lah}, 21 | booktitle = {JOURNAL OF SOMETHINGS} 22 | } 23 | `; 24 | 25 | test("strip double braces", async () => { 26 | const tidied = await bibtexTidy(input, { stripEnclosingBraces: true }); 27 | strictEqual(tidied.bibtex, output); 28 | }); 29 | -------------------------------------------------------------------------------- /test/syntax-unbalanced-braces.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtexTidy, test } from "./utils"; 3 | 4 | test("syntax-error on unbalanced braces", async () => { 5 | const err1 = await getError("@misc{foo,title={moo {foo}} bar}}"); 6 | strictEqual(err1?.constructor.name, "BibTeXSyntaxError"); 7 | strictEqual("char" in err1 && err1.char, "b"); 8 | 9 | // Braces must also be balanced in quotes 10 | // https://web.archive.org/web/20210422110817/https://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html 11 | const err2 = await getError('@misc{foo,title="moo {foo}} bar"}'); 12 | strictEqual(err2?.constructor.name, "BibTeXSyntaxError"); 13 | strictEqual("char" in err2 && err2.char, "}"); 14 | }); 15 | 16 | async function getError(input: string): Promise { 17 | try { 18 | await bibtexTidy(input, undefined, ["api"]); 19 | } catch (e) { 20 | return e instanceof Error ? e : new Error("Expected an error"); 21 | } 22 | return; 23 | } 24 | -------------------------------------------------------------------------------- /test/targets/api.ts: -------------------------------------------------------------------------------- 1 | import { type BibTeXTidyResult, tidy as tidyImport } from "../../src/index"; 2 | import type { Options } from "../../src/optionUtils"; 3 | 4 | // require the actual build. Using import would cause it to bundled into the 5 | // test and we won't be testing the actual build. 6 | const tidy = 7 | process.env.NODE_ENV === "coverage" 8 | ? tidyImport 9 | : require("../../bibtex-tidy.js").tidy; 10 | 11 | export type APIResult = BibTeXTidyResult; 12 | 13 | export function testAPI(bibtex: string, options?: Options): APIResult { 14 | return tidy(bibtex, options); 15 | } 16 | -------------------------------------------------------------------------------- /test/trailing-commas.spec.ts: -------------------------------------------------------------------------------- 1 | import { strictEqual } from "node:assert"; 2 | import { bibtex, bibtexTidy, test } from "./utils"; 3 | 4 | const input = bibtex` 5 | @ARTICLE {feinberg1983technique, 6 | number={1}, 7 | title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 8 | author="Feinberg, Andrew P and Vogelstein, Bert", 9 | journal = {Analytical biochemistry}, 10 | volume = 132, 11 | pages={6-13}, 12 | year={1983}, 13 | month={aug}, 14 | publisher={Elsevier},}`; 15 | 16 | const output = bibtex` 17 | @article{feinberg1983technique, 18 | number = {1}, 19 | title = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, 20 | author = "Feinberg, Andrew P and Vogelstein, Bert", 21 | journal = {Analytical biochemistry}, 22 | volume = 132, 23 | pages = {6--13}, 24 | year = {1983}, 25 | month = {aug}, 26 | publisher = {Elsevier}, 27 | } 28 | `; 29 | 30 | test("trailing commas", async () => { 31 | const tidied = await bibtexTidy(input, { trailingCommas: true }); 32 | strictEqual(tidied.bibtex, output); 33 | }); 34 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/svelte/tsconfig.json", 3 | "compilerOptions": { 4 | "esModuleInterop": true, 5 | "noFallthroughCasesInSwitch": true, 6 | "noImplicitReturns": true, 7 | "strict": true, 8 | "resolveJsonModule": true, 9 | "noUncheckedIndexedAccess": true, 10 | "downlevelIteration": true, 11 | "lib": ["ESNext", "DOM", "DOM.Iterable"], 12 | "target": "ES2018" 13 | }, 14 | "include": ["src/**/*", "test/**/*", "build.ts"] 15 | } 16 | --------------------------------------------------------------------------------