Hot answers tagged

16 votes
Accepted

How to make emacs align and indent a bibtex entry?

When the cursor is somewhere in the entry, run the command bibtex-fill-entry (bound to C-c C-q), which will align the fields. You may also want to set variable bibtex-align-at-equal-sign to a non nil ...
Dan's user avatar
  • 32.7k
8 votes
Accepted

Org-Ref: Managing multiple projects, each with own notes.org files and bibtex-pdfs folders

I think you need to put the local variables in two places, which is the org file and the bib file. The issue is that the notes functions are called while the bibtex buffer is active, so the local ...
John Kitchin's user avatar
  • 11.6k
7 votes
Accepted

How to modify existing major-mode?

Never modify the source code in its original location like that. You'll lose (or be forced to merge) your changes whenever you upgrade. defcustom defines a "user option" variable. Variables are ...
phils's user avatar
  • 49.7k
6 votes
Accepted

Split a complicated string?

Behold: (defun fancy-split (input) (let (tokens) (with-temp-buffer (insert input) (goto-char (point-min)) (while (not (eobp)) (cond ((looking-at "{") ...
wasamasa's user avatar
  • 22k
6 votes
Accepted

How to turn every ALL CAP word in a buffer into Title case?

How about using keyboard macros: <f3> -- start recording C-M-s \b[A-Z]\{2,\}\b RET -- find the next word of only upper-case letters and at least 2 letters. M--M-c -- Call capitalize-word on the ...
phils's user avatar
  • 49.7k
6 votes

How to convert a BibTeX entry into formatted string?

The org-ref package contains this functionality. Contrary to the name, org-ref has a lot of functionality outside of org mode. Take a look at the function org-ref-format-bibtex-entry. It also ...
Alex's user avatar
  • 1,028
6 votes
Accepted

How to create a small bibtex file from a bigger one?

reftex has the command reftex-create-bibtex-file that you can call via the menu Ref -> Global Actions -> Create BibTeX File. I cite the help of reftex-create-bibtex-file here: Create a new ...
Tobias's user avatar
  • 32.8k
5 votes
Accepted

AUCTeX doesn't run bibtex even though .emacs file is set up appropriately

For some reason, the file wasn't actually parsed, so AUCTeX didn't know about the bibliography file. This shouldn't usually happen if you set TeX-parse-self and TeX-auto-save to t, but you can easily ...
giordano's user avatar
  • 3,245
5 votes
Accepted

Changing the order of the entries of the bibtex-autokey generator-*

The order of the components of the key are hard-coded, so you can't change them with a user option. However, you can re-write the function to set the order you want. You need to load your modified ...
Tyler's user avatar
  • 21.9k
4 votes

org-mode and bibtex latex export problem

I'm doing latex bibliography exports in Org9 with a regular bibtex file (literature.bib). At the location where I want the references to appear in the result, I put #+BIBLIOGRAPHY: /HOME/uidg1626/...
Dieter.Wilhelm's user avatar
4 votes
Accepted

initialization of bibtex package

It's a bug in bibtex.el which only initializes some of its global vars after opening a file. Please M-x report-emacs-bug. While waiting for an actual fix, you can use the following workaround: add a ...
Stefan's user avatar
  • 26.3k
4 votes

How to configure org-roam-bibtex properly?

I could succesfully config org-roam-bibtex after a lot of tries. This is my config if someone finds useful. I copied all the config from https://rgoswami.me/posts/org-note-workflow/ The part that gave ...
Maikol Solís's user avatar
4 votes

What does =slug= means in the context of =org-roam=?

The slug is used to construct the filename. By default org-roam uses the title of the note, using the org-roam--title-to-slug function. A note titled =This is my note title!!= will be turned into the ...
amitp's user avatar
  • 2,461
3 votes

How to make emacs align and indent a bibtex entry?

As mentioned by @JonatanLindén, fill-prefix is set to a string containing 18 spaces. This is because bibtex-clean-entry is using fill-prefix to align continuing text after equal sign. Setting fill-...
Saddle Point's user avatar
3 votes

How to make emacs align and indent a bibtex entry?

I had a similar issue, when using the smartparens package in bibtex-mode, where shameful amounts of spaces where inserted. For some reason unknown, bibtex-mode sets the fill-prefix variable to a ...
Jonatan Lindén's user avatar
3 votes
Accepted

AUCTeX: Turn on syntax highlighting for natbib commmands under BibLaTeX

This looks like a bug to me. You added the link to the master file to your file-local variables via C-c _, as you should. And as you note in the comments, this automatically inserted the mode: plain-...
Tyler's user avatar
  • 21.9k
3 votes
Accepted

Generate .bib local bbliography with all the bibtex entries cited in an org document

If you are using org-ref see org-ref-extract-bibtex-entries or org-ref-extract-bibtex-to-file.
John Kitchin's user avatar
  • 11.6k
2 votes

Org-mode latex pdf export command doesn't find citations

So a rather unsatisfying answer that works out, is to run the commands in from the command line to generate all the required auto files with latexmk. From then on the export commands from emacs work ...
Japhir's user avatar
  • 215
2 votes

Highlighting missing references

In a similar approach to @giordano, I would suggest you have a look at the excellent Org-Ref, which is a collection of org-mode modules for citations, cross-references, bibliographies in org-mode and ...
nyameko's user avatar
  • 545
2 votes

Split a complicated string?

Here's something you could do using PEG parser. PEG parsers are a formalism allowing for generation of parsers without a tedious process like the one associated with YACC-style parsers. PEG-style ...
wvxvw's user avatar
  • 11.3k
2 votes

Split a complicated string?

Here's a recursive function that returns the name as a list of its components. (defun name-to-list (name &optional acc) "Takes a BibTeX-style name and returns a list of the name components." (...
Dan's user avatar
  • 32.7k
2 votes
Accepted

How to add 'timestamp' and 'owner' to 'bibtex-clean-entry'?

This is something I've wanted too. I've implemented it for the timestamp as follows: First, we need a function to add the timestamp if it doesn't exist already. In my system I call the time stamp ...
Tyler's user avatar
  • 21.9k
2 votes
Accepted

Copy formatted citation from helm-bibtex menu

You can add something like this to your init file to do that. (helm-add-action-to-source "Copy formatted citation(s)" (lambda (_) (kill-new (mapconcat 'identity ...
John Kitchin's user avatar
  • 11.6k
2 votes

Extract title from bibtex

Here's a basic function to look up the entry and title based on the citation at point (bibtex-completion is a dependency of org-ref): (defun my/print-reference-title () "Print the title to the ...
ebpa's user avatar
  • 7,389
2 votes
Accepted

How to set field separators in bibtex-mode's autokey generator?

Would the simple, if slightly barbaric, solution of setting bibtex-autokey-additional-names to "-etal", (with a hyphen built-in), work for you? It has the advantage that you don't have to source-dive ...
aplaice's user avatar
  • 2,146
2 votes
Accepted

How to insert and populate field in multiple bibtex entries automatically

To check if a field exists, one approach is: (defun bibtex-field-exists-p (field) (save-excursion (bibtex-beginning-of-entry) (let ((entry (bibtex-parse-entry))) (assoc field entry))))...
John Kitchin's user avatar
  • 11.6k
2 votes
Accepted

Org-ref associate entry with local file

Take a look at the documentation of org-ref-get-pdf-filename-function. You can set it to either org-ref-get-mendeley-filename or org-ref-get-pdf-filename-helm-bibtex. Both the variants support ...
yantar92's user avatar
  • 166
2 votes
Accepted

Org-ref with biblatex - is it feasible or should bibtex be preferred?

Org-ref supports standard bibtex and biblatex as far as I know. So far neither of those has been a limitation.
John Kitchin's user avatar
  • 11.6k
2 votes
Accepted

How to generate cited references with biber and xelatex

I've found my own solution. Here are the changes I've made to the source and configuration code that made this work. Source: #+TITLE: How to Automate Footnote Citations in Org-Mode #+AUTHOR: Sati ...
Sati's user avatar
  • 775
2 votes
Accepted

How to use a delayed evaluation function where a string is expected?

How to use a delayed evaluation function where a string is expected? Submit a feature request for bibtex.el via M-x report-emacs-bug RET. Is it possible to do what I'm trying to do? In the meantime,...
Basil's user avatar
  • 12.2k

Only top scored, non community-wiki answers of a minimum length are eligible