% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read-bibtex.R
\name{read_bibtex}
\alias{read_bibtex}
\title{Read a BibTeX file}
\usage{
read_bibtex(file, encoding = "UTF-8")
}
\arguments{
\item{file}{Path to a \code{.bib} file.}

\item{encoding}{Character. File encoding. Default \code{"UTF-8"}.}
}
\value{
A data frame in the standard bibnets format: \code{id}, \code{title},
\code{year}, \code{journal}, \code{doi}, \code{cited_by_count}, \code{abstract}, \code{type},
plus list-columns \code{authors}, \code{references} (typically empty for
BibTeX), and \code{keywords}.
}
\description{
Parses a \code{.bib} file into a standardized bibliometric data frame.
Note: standard BibTeX does not contain cited references, so the
\code{references} column will be empty unless the file includes a
non-standard \code{cited-references} or \code{note} field with reference data.
}
\examples{
# Write a minimal BibTeX entry to a temp file, then read it
bib <- '@article{smith2020,
  title  = {Bibliometric networks},
  author = {Smith, J. and Jones, K.},
  journal = {Test Journal},
  year   = {2020},
  doi    = {10.1000/test}
}'
f <- tempfile(fileext = ".bib")
writeLines(bib, f)
data <- read_bibtex(f)
data[, c("id", "title", "year", "journal", "doi")]
unlink(f)
}
