in the index buffer, Ebib creates a note for the entry, which is saved
in a separate file. If an entry already has a note associated with it,
N opens it. By default, notes are
-created as Org entries. (Changing that is possible, though it’s somewhat
-involved.)
+created as Org entries. (Changing that is possible, though you may lose
+some convenience. See below for some pointers.)
In the entry buffer, the first few lines of the note are shown under
a pseudo-field external note. This is not an actual field
in the .bib file, even though it is displayed as such. (You
@@ -2590,20 +2590,15 @@
Hooks
argument is set to the key of the current entry and the db
argument to the current database. With these arguments, it is possible
to, e.g., retrieve the value of a specific field in the entry:
-
(ebib-get-field-value <field> key db 'noerror 'unbraced 'xref)
+
(ebib-get-field-value <field> key db 'noerror 'unbraced 'xref 'expand-strings 'org)
where <field> is the field as a (case-insensitive)
-string whose value is to be retrieved.
+string whose value is to be retrieved. The argument
+'noerror is necessary to avoid triggering an error if
+field does not exist in the entry. The other arguments
+determine how the field value is returned. See the doc string of
+ebib-get-field-value for details.
Instead of a function, you may also provide a variable. The
variable’s value is then used to replace the specifier.
-
Because the template can be customised and the major mode is
-determined from the file extension, it is in principle possible to use
-another format than Org for notes. In this case, it is easier to use
-separate note files, but as long as you have a %K directive
-in your template (and an appropriately defined function for it, see the
-option ebib-notes-template-specifiers), it should still be
-possible to use a single notes file. (Emphasis on should,
-however, because this has not been tested.) You will also need to
-customise the three hooks discussed above in this case.
Displaying
notes
If an entry has an external note, the first few lines are shown in
@@ -2627,6 +2622,70 @@
Displaying
section Window Management for details),
because that is the only window layout that ensures that the note can be
displayed without getting in the way.
+
Using
+Markdown for notes
+
Because the template can be customised and the major mode is
+determined from the file extension, it is in principle possible to use
+another format than Org for notes. In this case, it is easier to use
+separate note files, because in a single notes file, Ebib needs to be
+able to identify the location of a note. In Org files, this is fairly
+straightforward using a :PROPERTIES: block, but there is no
+similar ready-made option for other formats.
+
Provided you use a single file for each note, however, it is possible
+to use another format. To do so, the following options will need to be
+customised:
+
+
ebib-note-file-extension: set this to the extension
+you use for your notes files, without the dot. The extension also
+determines the major mode Emacs uses to open note files.
+
ebib-notes-directory: this needs to be set to the
+directory containing your notes. Ebib does not support single note files
+in multiple directories, so you need to put all note files in a single
+directory.
+
ebib-notes-name-transform-function: this can be set
+to a function that creates a name for a note file. It should return just
+the base name, without the path and without the extension. If you don’t
+customise it, the option ebib-name-transform-function will
+be used instead. If you don’t customise that option either, the entry
+key will be used as the file name.
+
ebib-notes-template: this needs to be customised to
+match the format you are using. By default, this template creates an Org
+header with a properties block. Note that if you have one note per file,
+the requirement that the template contain the %K specifier
+does not apply, because the note is identified based on the file
+name.
+
ebib-notes-template-specifiers: create functions for
+the specifiers that you use in ebib-notes-template and
+customise this option to use them. Note that if you use Markdown, the
+relevant functions are already defined. They are named with
+markdown instead of org, so for the
+%T specifier, the Markdown function is
+ebib-create-markdown-title, etc.
+
ebib-notes-show-note-method: the default value of
+this option is only compatible with Org files. If you use a different
+format, you must either unset it, or set it to the value
+all. If you want to keep the default value
+(top-lines), you need to customise
+ebib-notes-extract-text-function, which would involve
+writing a function that extracts the top N lines of a note.
+
+
It should be possible to make Ebib work with multiple notes per file
+in a format other than Org, but this has not been tested. If you wish to
+try and make this work, two things are important: First, make sure to
+include a unique identifier for each note. Unique in this case means not
+only unique for the entry, but also unique in the notes file, because
+Ebib searches for this identifier to locate the note. For example, using
+just the entry key in a Markdown file does not guarantee uniqueness,
+because the entry key can be used to insert a citation. (Ebib includes
+the function ebib-create-markdown-identifier, which creates
+a unique identifier by prepending ID: to the entry
+key.)
+
Second, you will probably need to customise the hooks
+ebib-notes-search-note-before-hook,
+ebib-notes-open-note-after-hook and
+ebib-notes-new-note-hook discussed above. They are needed
+to ensure that Ebib positions point correctly when creating or editing a
+note.
Using org-capture to
record notes
diff --git a/ebib-utils.el b/ebib-utils.el
index b4e4aca..c8a84c5 100644
--- a/ebib-utils.el
+++ b/ebib-utils.el
@@ -1658,6 +1658,8 @@ error."
(setq url (match-string 1 url)))
url))
+;; Template specifiers for Org
+
(defun ebib-create-org-identifier (key _)
"Create a unique identifier for KEY for use in an org file.
The key is prepended with the string \"Custom_id:\", so that it
@@ -1666,24 +1668,18 @@ can be used in a :PROPERTIES: block."
(defun ebib-create-org-title (key db)
"Return a title for an Org mode note for KEY in DB.
-The title is formed from the title of the entry. Newlines are
-removed from the resulting string."
- (ebib--ifstring (title (ebib-clean-TeX-markup-from-entry "title" key db))
- (remove ?\n (format "%s" title))
- "(No Title)"))
+The title is formed from the title of the entry."
+ (ebib-get-field-value "title" key db "(No Title)" 'unbraced 'xref 'expand-strings 'org))
(defun ebib-create-org-description (key db)
"Return a description for an Org mode note for KEY in DB.
The title is formed from the author(s) or editor(s) of the entry,
-its year and its title. Newlines are removed from the resulting
-string."
- (let ((author (or (ebib-get-field-value "author" key db 'noerror 'unbraced 'xref)
- (ebib-get-field-value "editor" key db 'noerror 'unbraced 'xref)
- "(No Author)"))
+its year and its title."
+ (let ((author (or (ebib-get-field-value "author" key db 'noerror 'unbraced 'xref 'expand-strings 'org)
+ (ebib-get-field-value "editor" key db "(No Author)" 'unbraced 'xref 'expand-strings 'org)))
(year (ebib-get-year-for-display key db))
- (title (or (ebib-get-field-value "title" key db 'noerror 'unbraced 'xref)
- "(No Title)")))
- (remove ?\n (format "%s (%s): %s" author year title))))
+ (title (ebib-get-field-value "title" key db "(No Title)" 'unbraced 'xref 'expand-strings 'org)))
+ (format "%s (%s): %s" author year title)))
(defun ebib-create-org-cite (key _db)
"Return a citation for an Org mode note for KEY in DB."
@@ -1744,6 +1740,79 @@ empty string."
(url (ebib--select-url urls nil)))
(if url (format "[[%s]]" url) "")))
+;; Template specifiers for Markdown
+
+(defun ebib-create-markdown-identifier (key _)
+ "Create a unique identifier for KEY for use in a Markdown file.
+The identifier consists of the entry key, prepended with the
+string \"ID:\", to avoid confusion with citations."
+ (format "ID:%s" key))
+
+(defun ebib-create-markdown-title (key db)
+ "Return a title for a Markdown note for KEY in DB.
+The title is formed from the title of the entry. Newlines are
+removed from the resulting string."
+ (ebib-get-field-value "title" key db "(No Title)" 'unbraced 'xref 'expand-strings 'markdown))
+
+(defun ebib-create-markdown-description (key db)
+ "Return a description for a Markdown note for KEY in DB.
+The title is formed from the author(s) or editor(s) of the entry,
+its year and its title. Newlines are removed from the resulting
+string."
+ (let ((author (or (ebib-get-field-value "author" key db 'noerror 'unbraced 'xref 'expand-strings 'markdown)
+ (ebib-get-field-value "editor" key db "(No Author)" 'unbraced 'xref 'expand-strings 'markdown)))
+ (year (ebib-get-year-for-display key db))
+ (title (ebib-get-field-value "title" key db "(No Title)" 'unbraced 'xref 'expand-strings 'markdown)))
+ (format "%s (%s): %s" author year title)))
+
+(defun ebib-create-markdown-cite (key _db)
+ "Return a citation for a Markdown note for KEY in DB."
+ (format "@%s" key))
+
+(defun ebib-create-markdown-link (key db)
+ "Create a Markdown link for KEY in DB.
+Check the entry designated by KEY whether it has a file, a DOI or
+a URL (in that order) and use the first element found to create a
+link. If none of these elements is found, return the empty
+string."
+ (cond
+ ((ebib-get-field-value "file" key db 'noerror 'unbraced 'xref)
+ (ebib-create-markdown-file-link key db))
+ ((ebib-get-field-value "doi" key db 'noerror 'unbraced 'xref)
+ (ebib-create-markdown-doi-link key db))
+ ((ebib-get-field-value "url" key db 'noerror 'unbraced 'xref)
+ (ebib-create-markdown-url-link key db))
+ (t "")))
+
+(defun ebib-create-markdown-file-link (key db)
+ "Create an org link to the file in entry KEY in DB.
+The file is taken from the \"file\" field in the entry designated
+by KEY in the current database. If that field contains more than
+one file name, the user is asked to select one. If
+the \"file\" field is empty, return the empty string."
+ (let ((files (ebib-get-field-value "file" key db 'noerror 'unbraced 'xref)))
+ (if files
+ (format "" (ebib--expand-file-name (ebib--select-file files nil key)))
+ "")))
+
+(defun ebib-create-markdown-doi-link (key db)
+ "Create an org link to the DOI in entry KEY in DB.
+The file is taken from the \"doi\" in the entry designated by KEY
+in the current database. If the \"doi\" field is empty, return
+the empty string."
+ (let ((doi (ebib-get-field-value "doi" key db 'noerror 'unbraced 'xref)))
+ (if doi (format "" doi) "")))
+
+(defun ebib-create-markdown-url-link (key db)
+ "Create an org link to the URL in entry KEY in DB.
+The URL is taken from \"url\" in the entry designated by KEY in
+the current database. If that field contains more than one url,
+the user is asked to select one. If \"url\" is empty, return the
+empty string."
+ (let* ((urls (ebib-get-field-value "url" key db 'noerror 'unbraced 'xref))
+ (url (ebib--select-url urls nil)))
+ (if url (format "[[%s]]" url) "")))
+
(defun ebib-format-template (template specifiers &rest args)
"Format TEMPLATE using SPECIFIERS.
SPECIFIERS is an alist of characters and symbols. Each symbol
@@ -2102,7 +2171,7 @@ system."
,@(when crossref-key `(("crossref" . ,crossref-key)))
,@(when xref-key `(("xref" . ,xref-key)))))))
-(defun ebib-get-field-value (field key db &optional noerror unbraced xref expand-strings)
+(defun ebib-get-field-value (field key db &optional noerror unbraced xref expand-strings replace-TeX)
"Return the value of FIELD in entry KEY in database DB.
If FIELD or KEY does not exist, trigger an error, unless NOERROR
is non-nil. In this case, if NOERROR is a string, return NOERROR,
@@ -2114,13 +2183,19 @@ cross-referenced entry. If the result is non-nil, the returned
text has the text property `ebib--xref', which has as value the
key of the entry from which the field value was retrieved.
+Similarly, the value can be retrieved from an alias field. (See
+the variable `ebib--field-aliases'). In this case, the returned
+string has the text property `ebib--alias' with value t.
+
If EXPAND-STRINGS is non-nil and the field is unbraced then
abbreviation strings and concatenation are expanded. The result
has the text property `ebib--expanded' with value t.
-Similarly, the value can be retrieved from an alias field. (See
-the variable `ebib--field-aliases'). In this case, the returned
-string has the text property `ebib--alias' with value t."
+If REPLACE-TEX is non-nil, TeX markup is cleaned up using the
+function `parsebib-clean-TeX-markup'. The value of REPLACE-TEX
+should be one of the symbols `display', `org' or `markdown',
+indicating the type of clean-up to be done. See the variable
+`parsebib-TeX-cleanup-target' for details."
(let* ((value (ebib-db-get-field-value field key db 'noerror))
(type (ebib-db-get-field-value "=type=" key db 'noerror))
(xref-key-alist)
@@ -2169,6 +2244,9 @@ string has the text property `ebib--alias' with value t."
(setq value (ebib--replace-granular-xdata-references value db)))
(when unbraced
(setq value (ebib-unbrace value)))
+ (when (memq replace-TeX '(display org markdown))
+ (let ((parsebib-TeX-cleanup-target replace-TeX))
+ (setq value (parsebib-clean-TeX-markup value))))
(when alias
(add-text-properties 0 (length value) '(ebib--alias t) value)))
(when (and (not value)
diff --git a/ebib.el b/ebib.el
index 9c5b88f..7cd67e7 100644
--- a/ebib.el
+++ b/ebib.el
@@ -7,10 +7,10 @@
;; Author: Joost Kremers
;; Maintainer: Joost Kremers
;; Created: 2003
-;; Version: 2.44
+;; Version: 2.45
;; Keywords: text bibtex
;; URL: http://joostkremers.github.io/ebib/
-;; Package-Requires: ((parsebib "4.0") (emacs "27.1") (compat "29.1.4.3"))
+;; Package-Requires: ((parsebib "5.0") (emacs "27.1") (compat "29.1.4.3"))
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
diff --git a/ebib.info b/ebib.info
index ede5913..241569b 100644
--- a/ebib.info
+++ b/ebib.info
@@ -2381,7 +2381,8 @@ way to do that as well. When you hit ‘N’ on an entry in the index
buffer, Ebib creates a note for the entry, which is saved in a separate
file. If an entry already has a note associated with it, ‘N’ opens it.
By default, notes are created as Org entries. (Changing that is
-possible, though it's somewhat involved.)
+possible, though you may lose some convenience. See below for some
+pointers.)
In the entry buffer, the first few lines of the note are shown under a
pseudo-field ‘external note’. This is not an actual field in the ‘.bib’
@@ -2406,6 +2407,7 @@ configuration. See *note Upgrading from earlier Ebib versions:
* Upgrading from earlier Ebib versions::
* Customising the notes file format::
* Displaying notes::
+* Using Markdown for notes::
* Using org-capture to record notes::
@@ -2589,26 +2591,19 @@ the key of the current entry and the ‘db’ argument to the current
database. With these arguments, it is possible to, e.g., retrieve the
value of a specific field in the entry:
-(ebib-get-field-value key db 'noerror 'unbraced 'xref)
+(ebib-get-field-value key db 'noerror 'unbraced 'xref 'expand-strings 'org)
where ‘’ is the field as a (case-insensitive) string whose value
-is to be retrieved.
+is to be retrieved. The argument ‘'noerror’ is necessary to avoid
+triggering an error if ‘field’ does not exist in the entry. The other
+arguments determine how the field value is returned. See the doc string
+of ‘ebib-get-field-value’ for details.
Instead of a function, you may also provide a variable. The variable's
value is then used to replace the specifier.
-Because the template can be customised and the major mode is determined
-from the file extension, it is in principle possible to use another
-format than Org for notes. In this case, it is easier to use separate
-note files, but as long as you have a ‘%K’ directive in your template
-(and an appropriately defined function for it, see the option
-‘ebib-notes-template-specifiers’), it should still be possible to use a
-single notes file. (Emphasis on _should_, however, because this has not
-been tested.) You will also need to customise the three hooks discussed
-above in this case.
-
-File: ebib.info, Node: Displaying notes, Next: Using org-capture to record notes, Prev: Customising the notes file format, Up: Notes files
+File: ebib.info, Node: Displaying notes, Next: Using Markdown for notes, Prev: Customising the notes file format, Up: Notes files
10.5 Displaying notes
=====================
@@ -2636,9 +2631,81 @@ because that is the only window layout that ensures that the note can be
displayed without getting in the way.
-File: ebib.info, Node: Using org-capture to record notes, Prev: Displaying notes, Up: Notes files
+File: ebib.info, Node: Using Markdown for notes, Next: Using org-capture to record notes, Prev: Displaying notes, Up: Notes files
-10.6 Using ‘org-capture’ to record notes
+10.6 Using Markdown for notes
+=============================
+
+Because the template can be customised and the major mode is determined
+from the file extension, it is in principle possible to use another
+format than Org for notes. In this case, it is easier to use separate
+note files, because in a single notes file, Ebib needs to be able to
+identify the location of a note. In Org files, this is fairly
+straightforward using a ‘:PROPERTIES:’ block, but there is no similar
+ready-made option for other formats.
+
+Provided you use a single file for each note, however, it is possible to
+use another format. To do so, the following options will need to be
+customised:
+
+ • ‘ebib-note-file-extension’: set this to the extension you use for
+ your notes files, without the dot. The extension also determines
+ the major mode Emacs uses to open note files.
+
+ • ‘ebib-notes-directory’: this needs to be set to the directory
+ containing your notes. Ebib does not support single note files in
+ multiple directories, so you need to put all note files in a single
+ directory.
+
+ • ‘ebib-notes-name-transform-function’: this can be set to a function
+ that creates a name for a note file. It should return just the
+ base name, without the path and without the extension. If you
+ don't customise it, the option ‘ebib-name-transform-function’ will
+ be used instead. If you don't customise that option either, the
+ entry key will be used as the file name.
+
+ • ‘ebib-notes-template’: this needs to be customised to match the
+ format you are using. By default, this template creates an Org
+ header with a properties block. Note that if you have one note per
+ file, the requirement that the template contain the ‘%K’ specifier
+ does not apply, because the note is identified based on the file
+ name.
+
+ • ‘ebib-notes-template-specifiers’: create functions for the
+ specifiers that you use in ‘ebib-notes-template’ and customise this
+ option to use them. Note that if you use Markdown, the relevant
+ functions are already defined. They are named with ‘markdown’
+ instead of ‘org’, so for the ‘%T’ specifier, the Markdown function
+ is ‘ebib-create-markdown-title’, etc.
+
+ • ‘ebib-notes-show-note-method’: the default value of this option is
+ only compatible with Org files. If you use a different format, you
+ must either unset it, or set it to the value ‘all’. If you want to
+ keep the default value (‘top-lines’), you need to customise
+ ‘ebib-notes-extract-text-function’, which would involve writing a
+ function that extracts the top N lines of a note.
+
+It should be possible to make Ebib work with multiple notes per file in
+a format other than Org, but this has not been tested. If you wish to
+try and make this work, two things are important: First, make sure to
+include a unique identifier for each note. Unique in this case means
+not only unique for the entry, but also unique in the notes file,
+because Ebib searches for this identifier to locate the note. For
+example, using just the entry key in a Markdown file does not guarantee
+uniqueness, because the entry key can be used to insert a citation.
+(Ebib includes the function ‘ebib-create-markdown-identifier’, which
+creates a unique identifier by prepending ‘ID:’ to the entry key.)
+
+Second, you will probably need to customise the hooks
+‘ebib-notes-search-note-before-hook’, ‘ebib-notes-open-note-after-hook’
+and ‘ebib-notes-new-note-hook’ discussed above. They are needed to
+ensure that Ebib positions point correctly when creating or editing a
+note.
+
+
+File: ebib.info, Node: Using org-capture to record notes, Prev: Using Markdown for notes, Up: Notes files
+
+10.7 Using ‘org-capture’ to record notes
========================================
Instead of using Ebib's own system to record notes, you can also use
@@ -3270,34 +3337,36 @@ Node: Calling a Browser for URLs and DOIs112524
Ref: #calling-a-browser-for-urls-and-dois112740
Node: Notes files115155
Ref: #notes-files115305
-Node: Configuring files for storing notes116814
-Ref: #configuring-files-for-storing-notes116992
-Node: Hooks119962
-Ref: #hooks120125
-Node: Upgrading from earlier Ebib versions121522
-Ref: #upgrading-from-earlier-ebib-versions121745
-Node: Customising the notes file format122655
-Ref: #customising-the-notes-file-format122883
-Node: Displaying notes126989
-Ref: #displaying-notes127180
-Node: Using org-capture to record notes128525
-Ref: #using-org-capture-to-record-notes128716
-Node: Managing a reading list134712
-Ref: #managing-a-reading-list134874
-Node: Managing Keywords137889
-Ref: #managing-keywords138045
-Node: Using a Canonical Keywords List139652
-Ref: #using-a-canonical-keywords-list139810
-Node: Window Management141948
-Ref: #window-management142113
-Node: Copying Entries to the Kill Ring145248
-Ref: #copying-entries-to-the-kill-ring145447
-Node: Printing the Database148170
-Ref: #printing-the-database148343
-Node: Customisation151786
-Ref: #customisation151902
-Node: Modifying Key Bindings153393
-Ref: #modifying-key-bindings153520
+Node: Configuring files for storing notes116880
+Ref: #configuring-files-for-storing-notes117058
+Node: Hooks120028
+Ref: #hooks120191
+Node: Upgrading from earlier Ebib versions121588
+Ref: #upgrading-from-earlier-ebib-versions121811
+Node: Customising the notes file format122721
+Ref: #customising-the-notes-file-format122949
+Node: Displaying notes126728
+Ref: #displaying-notes126910
+Node: Using Markdown for notes128255
+Ref: #using-markdown-for-notes128453
+Node: Using org-capture to record notes132111
+Ref: #using-org-capture-to-record-notes132310
+Node: Managing a reading list138306
+Ref: #managing-a-reading-list138468
+Node: Managing Keywords141483
+Ref: #managing-keywords141639
+Node: Using a Canonical Keywords List143246
+Ref: #using-a-canonical-keywords-list143404
+Node: Window Management145542
+Ref: #window-management145707
+Node: Copying Entries to the Kill Ring148842
+Ref: #copying-entries-to-the-kill-ring149041
+Node: Printing the Database151764
+Ref: #printing-the-database151937
+Node: Customisation155380
+Ref: #customisation155496
+Node: Modifying Key Bindings156987
+Ref: #modifying-key-bindings157114
End Tag Table
diff --git a/manual/ebib.text b/manual/ebib.text
index 66c2a5f..f593ae3 100644
--- a/manual/ebib.text
+++ b/manual/ebib.text
@@ -925,7 +925,7 @@ Ebib uses the Emacs function `browse-url` to call the default browser on the sys
# Notes files #
-Ebib supports the `annotation` field (or `annote` field in BibTeX), but if you prefer to keep notes outside the `.bib` file, there is an easy way to do that as well. When you hit [`N`]{.key} on an entry in the index buffer, Ebib creates a note for the entry, which is saved in a separate file. If an entry already has a note associated with it, [`N`]{.key} opens it. By default, notes are created as Org entries. (Changing that is possible, though it's somewhat involved.)
+Ebib supports the `annotation` field (or `annote` field in BibTeX), but if you prefer to keep notes outside the `.bib` file, there is an easy way to do that as well. When you hit [`N`]{.key} on an entry in the index buffer, Ebib creates a note for the entry, which is saved in a separate file. If an entry already has a note associated with it, [`N`]{.key} opens it. By default, notes are created as Org entries. (Changing that is possible, though you may lose some convenience. See below for some pointers.)
In the entry buffer, the first few lines of the note are shown under a pseudo-field `external note`. This is not an actual field in the `.bib` file, even though it is displayed as such. (You can customise this behaviour.)
@@ -997,15 +997,13 @@ It is possible to change the strings that the specifiers produce, or to add new
When the specifier functions are called, the `key` argument is set to the key of the current entry and the `db` argument to the current database. With these arguments, it is possible to, e.g., retrieve the value of a specific field in the entry:
```
-(ebib-get-field-value key db 'noerror 'unbraced 'xref)
+(ebib-get-field-value key db 'noerror 'unbraced 'xref 'expand-strings 'org)
```
-where `` is the field as a (case-insensitive) string whose value is to be retrieved.
+where `` is the field as a (case-insensitive) string whose value is to be retrieved. The argument `'noerror` is necessary to avoid triggering an error if `field` does not exist in the entry. The other arguments determine how the field value is returned. See the doc string of `ebib-get-field-value` for details.
Instead of a function, you may also provide a variable. The variable's value is then used to replace the specifier.
-Because the template can be customised and the major mode is determined from the file extension, it is in principle possible to use another format than Org for notes. In this case, it is easier to use separate note files, but as long as you have a `%K` directive in your template (and an appropriately defined function for it, see the option `ebib-notes-template-specifiers`), it should still be possible to use a single notes file. (Emphasis on *should*, however, because this has not been tested.) You will also need to customise the three hooks discussed above in this case.
-
## Displaying notes ## {.unlisted .unnumbered}
@@ -1014,6 +1012,29 @@ If an entry has an external note, the first few lines are shown in the entry buf
Note also that displaying the note inline in the entry buffer is only possible with Org files, so your notes must use Org mode for it to work. Showing the entire note in a separate buffer can be done with any format, but only works if you use Ebib's default window layout (see the section [Window Management](#window-management) for details), because that is the only window layout that ensures that the note can be displayed without getting in the way.
+## Using Markdown for notes ## {.unlisted .unnumbered}
+
+Because the template can be customised and the major mode is determined from the file extension, it is in principle possible to use another format than Org for notes. In this case, it is easier to use separate note files, because in a single notes file, Ebib needs to be able to identify the location of a note. In Org files, this is fairly straightforward using a `:PROPERTIES:` block, but there is no similar ready-made option for other formats.
+
+Provided you use a single file for each note, however, it is possible to use another format. To do so, the following options will need to be customised:
+
+- `ebib-note-file-extension`: set this to the extension you use for your notes files, without the dot. The extension also determines the major mode Emacs uses to open note files.
+
+- `ebib-notes-directory`: this needs to be set to the directory containing your notes. Ebib does not support single note files in multiple directories, so you need to put all note files in a single directory.
+
+- `ebib-notes-name-transform-function`: this can be set to a function that creates a name for a note file. It should return just the base name, without the path and without the extension. If you don't customise it, the option `ebib-name-transform-function` will be used instead. If you don't customise that option either, the entry key will be used as the file name.
+
+- `ebib-notes-template`: this needs to be customised to match the format you are using. By default, this template creates an Org header with a properties block. Note that if you have one note per file, the requirement that the template contain the `%K` specifier does not apply, because the note is identified based on the file name.
+
+- `ebib-notes-template-specifiers`: create functions for the specifiers that you use in `ebib-notes-template` and customise this option to use them. Note that if you use Markdown, the relevant functions are already defined. They are named with `markdown` instead of `org`, so for the `%T` specifier, the Markdown function is `ebib-create-markdown-title`, etc.
+
+- `ebib-notes-show-note-method`: the default value of this option is only compatible with Org files. If you use a different format, you must either unset it, or set it to the value `all`. If you want to keep the default value (`top-lines`), you need to customise `ebib-notes-extract-text-function`, which would involve writing a function that extracts the top N lines of a note.
+
+It should be possible to make Ebib work with multiple notes per file in a format other than Org, but this has not been tested. If you wish to try and make this work, two things are important: First, make sure to include a unique identifier for each note. Unique in this case means not only unique for the entry, but also unique in the notes file, because Ebib searches for this identifier to locate the note. For example, using just the entry key in a Markdown file does not guarantee uniqueness, because the entry key can be used to insert a citation. (Ebib includes the function `ebib-create-markdown-identifier`, which creates a unique identifier by prepending `ID:` to the entry key.)
+
+Second, you will probably need to customise the hooks `ebib-notes-search-note-before-hook`, `ebib-notes-open-note-after-hook` and `ebib-notes-new-note-hook` discussed above. They are needed to ensure that Ebib positions point correctly when creating or editing a note.
+
+
## Using `org-capture` to record notes ## {.unlisted .unnumbered}
Instead of using Ebib's own system to record notes, you can also use `org-capture` to do so. This has two advantages: first, Org capture templates allow you to specify the type of the note and the location where the note is to be stored more precisely than what Ebib's system allows. Second, you can define more than one template, so you can capture different kinds of notes or record them in different files.
diff --git a/manual/news.text b/manual/news.text
index 9ad0209..b430aa8 100644
--- a/manual/news.text
+++ b/manual/news.text
@@ -1,5 +1,9 @@
% Ebib News
+## Version 2.45, October 2024 ##
+
+- Handle TeX markup better when creating a note.
+
## Version 2.44, September 2024 ##
- New user option `ebib-doi-resolver`.