> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced Reference Search

> Find a reference by its author, title, journal or year, and insert it into a citation.

The reference search looks through all the `.bib` files in your project, so you can find a reference without remembering its citation key. Nothing needs to be set up.

Your project needs at least one `.bib` file. You can upload one, or import your library from [Zotero](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/users/zotero-integration.md) or [Mendeley](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/users/mendeley-integration.md).

## Insert a citation

**1. Start a citation**

In a `.tex` file, type `\cite{`. The editor adds the closing brace. Below the cursor you see the citation keys and a blue box, **Open advanced reference search**.

![The editor with \cite\{}, the list of citation keys, and the blue box with a Search button](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-hint.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=1438156d0ee9a9c866987e23c0aa8a15)

The blue box under a citation

The **Insert citation** button in the toolbar and **Insert**, then **Citation**, also start a `\cite{}` for you. The box appears for other citation commands too, such as `\citep`, `\autocite`, `\parencite` and `\textcite`.

**2. Open the search**

Click **Search** in the blue box, or press Ctrl+Space between the braces. The dialog lists every entry, with its title, citation key, author, journal and year.

![The Search the .bib files in this project dialog listing five entries](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-dialog.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=e6ee13f3a5f3b1f95c2dbeb9d2cc1e29)

All the entries of the project

**3. Find the entry**

Type in the search box. It looks in the citation key, author, title, journal and year, and highlights what it found. Every word must match, so `turing 1936` finds Turing's paper from 1936. Other fields, such as the publisher, are not searched.

![The search box with turing 1936 and one entry with the matches in red](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-filter.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=7690a4c194fdf292980d229b60ef6f1e)

Searching by author and year

**4. Choose one or more entries**

Click an entry. It turns green and its key appears above the list. To add another, click it, or search again: what you chose stays. To remove one, click it again or click the **×** next to its key.

![The keys knuth1984 and einstein1905 above the list, and their entries in green](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-selected.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=a660175f9908e03c671ed61062f4ef8f)

Two chosen entries

**5. Click Insert**

The keys appear between the braces, separated by commas. If your document has no bibliography yet, add these lines before `\end{document}`, using the names of your `.bib` files without the extension:

```latex theme={null}
\bibliographystyle{plain}
\bibliography{refs,more}
```

Click **Recompile**. The references appear in the PDF.

![The editor with \cite\{knuth1984, einstein1905} and the PDF with both references](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-compiled.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=b0928f1bbd09e6cb56ecc1b2ed239ccd)

The compiled citation

The search works the same way in the **Visual** editor.

## Change a citation

**Add a reference:** put the cursor between the braces of an existing citation and open the search. **Insert** adds the new keys after the ones already there.

**Replace references:** select the keys in the editor, then press Ctrl+Space. The keys appear above the list and the button now says **Replace**. Remove the ones you do not want, add others, then click **Replace**. A key that is not in any `.bib` file stays until you remove it.

![The dialog with knuth1984, missing2000 and turing1936 above the list and the Replace button](https://mintcdn.com/ayakaleaf-pro/PeD9iteXIf8j4GXw/images/on-premises/reference-search-replace.png?fit=max\&auto=format\&n=PeD9iteXIf8j4GXw\&q=85\&s=74a8cac10eb8fff69c5961039e678004)

Replacing selected keys

## Use the keyboard

| Key | What it does |
| - | - |
| **Down arrow** | Moves from the search box into the list, then down the list |
| **Up arrow** | Moves up the list |
| **Space** | Chooses the entry, or removes it from what you chose |
| **Enter** | Inserts what you chose, when you are in the list |
| **Tab** | Moves between the search box, the list and the buttons |
| **Esc** | Closes the dialog and changes nothing |

## Where the entries come from

The search covers every `.bib` file in the project, including files imported from Zotero or Mendeley. When you edit a `.bib` file, the next search finds the new entries.

## If something goes wrong

| What you see | Why | What to do |
| - | - | - |
| The list in the dialog is empty | The project has no `.bib` file | Upload one or create one |
| No blue box, and Ctrl+Space lists LaTeX commands | The cursor is not between the braces of a citation | Click between the braces |
| Ctrl+Space does nothing | Your computer uses this shortcut for something else | Click **Search** in the blue box |
| An entry is not found | The search only covers the key, author, title, journal and year | Search by one of those |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.