-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concealment of \citet and \citep from natbib #2658
Comments
The first one seems simple and I've fixed it already. The other ones will require some more thought.
These are quite hard. We are parsing from left to right, and we are parsing group by group. Currently, I'm relying on vimtex/autoload/vimtex/syntax/core.vim Lines 2144 to 2155 in 6f7e507
That is a simple but effective implementation. To enable what you are asking, we would instead need to somehow match the entire optional groups in one go. It may be possible, but I don't quite see how to do it. Perhaps we can use the pattern offsets here (
Yes, I agree. I'll find a way to only hide the second option if it is empty.
I think having the square brackets makes it easier to recognize that this is a concealed |
Do not invest too much time in this issue. If there is no obvious way, keep the current way. It works.
That would be great and would resolve, from my point of view, the most urgent part of this issue.
Agreed. Leave it as it is. |
Then I believe the last patch should suffice. Clearly, this is not perfect, but it is not too bad either. |
I am wondering whether the concealment of
\citet
and\citep
from natbib can be improved.Here a screenshot from the documentation of natbib
The corresponding code is
Currently concealed as following
The most obvious change could be:
\citep*?{jon90}
with parentheses instead of square brackets (third and last line).Prepend optional parameters and replace inner brackets with spaces
\citet[chap.~2]{jon90}
as[chap. 2 jon90]
\citep[see][]{jon90}
as(see jon90)
\citep[see][chap.~2]{jon90}
. Here the chapter reference becomes completely invisible. I would at least show it. Showing it with less square brackets, e.g. as(see chap. 2 jon90)
.\citet
one could drop the surrounding square brackets. Here I am not so sure.I am not totally sold on all my suggestions and what is possible to mimic natbib functionality
The text was updated successfully, but these errors were encountered: