Open davvil opened 5 years ago
How about this: by default the general search is deactivated, i.e. bibsearch expects keys in the \cite
commands. With an additional option (e.g. -g
, --general-search
) the \cite
commands may include arbitrary searches. The separator defaults to _
, but it can be configurable in the config file and possibly also with a command line argument.
In this way, if someone wants to use underscores in their keys, they could still write something like \cite{post#vilar#2018#constrained}
This is cool! Does it not work to have spaces in the search keys? Will look more closely after today.
No, bibtex compains if the \cite
keys contains spaces.
This is a proof of concept of something @mjpost wanted for some time. With this PR we can include \cite commands with arbitrary terms and
bibsearch tex
will execute a general query. E.g:The implementation is really simple and touches bibsearch only. This means that latex and bibtex see the queries as the "keys" for the bibtex entries. This has some implications that we should discuss (and are the main reason for this PR):
bibsearch tex
. We do not generate keys with underscores by default, but they can be customized or manually generated.\cite{post_vilar_2018}
it will generate [Post and Vilar, 2018a] and [Post and Vilar, 2018b]. If exactly the same search term is used, of course everything works fine.As said before, this is more a proof-of-concept. Probably a better solution would be to create a LaTeX package and address these issues. But I am no expert at TeX programming.