# BibtexLoader

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/document_loaders/bibtex/BibtexLoader)

Load a `bibtex` file.

Each document represents one entry from the bibtex file.

If a PDF file is present in the `file` bibtex field, the original PDF
is loaded into the document text. If no such file entry is present,
the `abstract` field is used instead.

## Signature

```python
BibtexLoader(
    self,
    file_path: str,
    *,
    parser: Optional[BibtexparserWrapper] = None,
    max_docs: Optional[int] = None,
    max_content_chars: Optional[int] = 4000,
    load_extra_metadata: bool = False,
    file_pattern: str = '[^:]+\\.pdf',
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `file_path` | `str` | Yes | Path to the bibtex file. |
| `parser` | `Optional[BibtexparserWrapper]` | No | The parser to use. If None, a default parser is used. (default: `None`) |
| `max_docs` | `Optional[int]` | No | Max number of associated documents to load. Use -1 means            no limit. (default: `None`) |
| `max_content_chars` | `Optional[int]` | No | Maximum number of characters to load from the PDF. (default: `4000`) |
| `load_extra_metadata` | `bool` | No | Whether to load extra metadata from the PDF. (default: `False`) |
| `file_pattern` | `str` | No | Regex pattern to match the file name in the bibtex. (default: `'[^:]+\\.pdf'`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    file_path: str,
    *,
    parser: Optional[BibtexparserWrapper] = None,
    max_docs: Optional[int] = None,
    max_content_chars: Optional[int] = 4000,
    load_extra_metadata: bool = False,
    file_pattern: str = '[^:]+\\.pdf',
)
```

| Name | Type |
|------|------|
| `file_path` | `str` |
| `parser` | `Optional[BibtexparserWrapper]` |
| `max_docs` | `Optional[int]` |
| `max_content_chars` | `Optional[int]` |
| `load_extra_metadata` | `bool` |
| `file_pattern` | `str` |


## Properties

- `file_path`
- `parser`
- `max_docs`
- `max_content_chars`
- `load_extra_metadata`
- `file_regex`

## Methods

- [`lazy_load()`](https://reference.langchain.com/python/langchain-community/document_loaders/bibtex/BibtexLoader/lazy_load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/document_loaders/bibtex.py#L14)