Comments (23)
Yes, I can confirm that \headlesscite
(and variants, at least the capitalized and pluralized variants) work too. Thank you!
Now I think that everything related to this feature request/bug report that I had noticed was missing (other than my custom commands, of course) has been implemented. Thanks for doing it so quickly!
from vimtex.
Describe the solution you'd like I would like the same standard syntax highlighting to be applied to commands of these form as well:
* `\volcite{1}[10]{ref}` (with or without the optional input variable) * `\headlesscite[10]{ref}` (ditto) * `\edcite[10]{ref}` (ditto) * `\transcite[10]{ref}` (ditto)
Also, all cite commands should be highlighted the same way if their first letter is capitalized (
\Cite
,\Volcite
, etc.), anotherbiblatex-chicago
feature.Hopefully this is a simple matter of tweaking the regex -- in any case, it would be wonderful to have this feature added!
I believe it should not be too hard. Could you provide a short example file that uses these commands and their forms? Preferable an example that compiles (just for completeness)?
from vimtex.
Also, can you refer me to the documentation of these commands?
from vimtex.
Btw., \volcite
is alreadty implemented:
from vimtex.
Ah, sorry, yes, you're right, \volcite
is already covered. The main place where I've noticed the lack is when I use that capitalized version of these commands (\Cite
, \Volcite
, etc.).
\edcite
and \transcite
(and \Edcite
and \Transcite
) are my own, which would be nice to have covered, but I understand if you'd rather keep to more general-interest features. As for the biblatex-chicago
commands, you can find a complete list in the package documentation, section 4.3.2.
MWE
main.tex:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Normal:
\documentclass[12pt,article,draft]{memoir}
\usepackage[notes, useibid]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}
\begin{document}
Test.\footnote{%
\cite{worman}.
Capitalized if ibid:
\Cite{worman}.
\mancite
Just the title:
\headlesscite{worman}.%
}
\end{document}
test.vim:
set nocompatible
set mmp=5000
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
call plug#end()
set spell
Spelling errors are highlighted in red in this MWE, indicating when the cite command highlighting has not been triggered:
![Screenshot 2024-01-27 at 8 00 42 AM](https://private-user-images.githubusercontent.com/6886906/300161400-14370e5f-952f-46f1-8e70-e2ecb8a20532.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMyMTM4OTYsIm5iZiI6MTcxMzIxMzU5NiwicGF0aCI6Ii82ODg2OTA2LzMwMDE2MTQwMC0xNDM3MGU1Zi05NTJmLTQ2ZjEtOGU3MC1lMmVjYjhhMjA1MzIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MTVUMjAzOTU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzcyN2E5ODdkMDQwN2FhM2VjYmFlMzNmZDExYThjZjIwYWUxMTQzOThlMzhkODllZDEwYTI0YzIzODg3ZGI5YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.DtwwKmKwd1aYlN3XdTAu1Hvh3y05pmINRVkXVDjCrTs)
from vimtex.
I just realized why I thought that \volcite
had not been implemented: it only works without the (mandatory) volume argument! As far as I know, \volcite
and its arguments should only be highlighted as a cite command when a volume is cited, as in \volcite{1}[23]{citekey}
or simply \volcite{1}{citekey}
but not if the volume argument is missing, so as to alert the user to the missing volume number.
MWE 2
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Normal:
\documentclass[12pt,article,draft]{memoir}
\usepackage[notes, useibid]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}
\begin{document}
Ordinary cite command:
\cite[23]{worman}
Capitalized if using ibidem.
\Cite{worman}.
\mancite
Just the title:
\headlesscite{worman}.
Volcite with volume number:
\volcite{1}[23]{worman}
Volcite without volume number:
\volcite[23]{worman}.
\end{document}
test.vim: same as before
from vimtex.
I've also noticed that the page number is correctly highlighted in the case of \Cite
and \headlesscite
(but not in the case of \volcite
with volume number), suggesting that you already implemented these commands too but omitted to implement the correct highlighting of their citekey.
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Normal:
\documentclass[12pt,article,draft]{memoir}
\usepackage[notes, useibid]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}
\begin{document}
Ordinary cite command:
\cite[23]{worman}
Capitalized if using ibidem.
\Cite[23]{worman}.
\mancite
Just the title:
\headlesscite[23]{worman}.
Volcite with volume number:
\volcite{1}[23]{worman}
Volcite without volume number:
\volcite[23]{worman}.
\end{document}
![Screenshot 2024-01-27 at 2 37 34 PM](https://private-user-images.githubusercontent.com/6886906/300181281-c8cb3ba0-3dc7-4339-be8a-4a2f2ac1a2ce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMyMTM4OTYsIm5iZiI6MTcxMzIxMzU5NiwicGF0aCI6Ii82ODg2OTA2LzMwMDE4MTI4MS1jOGNiM2JhMC0zZGM3LTQzMzktYmU4YS00YTJmMmFjMWEyY2UucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MTVUMjAzOTU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDQxMTZiNTE1MjI1ODE3MTI2NzliNzc2OGViOTA4YzRiNmJjOWE0MWYxNzg2MGFmNTg0OGYxY2U1MmMzMjhlMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.HeZXVMQZ-rVP4BvMPmWRaEJBIH7PzEudHRDcz9h2XUU)
from vimtex.
Thanks for the detailed follow-up!
\edcite
and\transcite
(and\Edcite
and\Transcite
) are my own, which would be nice to have covered, but I understand if you'd rather keep to more general-interest features.
Yes, I don't want to add things that are personal here. Sorry!
As for the
biblatex-chicago
commands, you can find a complete list in the package documentation, section 4.3.2.
To be honest, it's tricky to see which commands are special to biblatex-chicago. It seems most of the listed commands are already in biblatex and that they only have slighty ajdustments?
I just realized why I thought that \volcite had not been implemented: it only works without the (mandatory) volume argument! As far as I know, \volcite and its arguments should only be highlighted as a cite command when a volume is cited, as in \volcite{1}[23]{citekey} or simply \volcite{1}{citekey} but not if the volume argument is missing, so as to alert the user to the missing volume number.
Is this true for biblatex or biblatex-chicago or both?
As you probably see, I'm confused as to what here is related to biblatex and what is related to biblatex-chicago. Could I ask that we first fix things that may be wrong with biblatex, then add biblatex-chicago afterwards?
Thus, could you first comment on if any of the things you are raising here are relevant as "bugs" for the current biblatex implementation?
from vimtex.
from vimtex.
For reference, here are the lines of the biblatex documentation about \volcite
et sim.:
![Screenshot 2024-01-29 at 10 32 45 AM](https://private-user-images.githubusercontent.com/6886906/300404479-4e4e7a97-dfa4-465a-ab5c-5ae446c03c9c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMyMTM4OTYsIm5iZiI6MTcxMzIxMzU5NiwicGF0aCI6Ii82ODg2OTA2LzMwMDQwNDQ3OS00ZTRlN2E5Ny1kZmE0LTQ2NWEtYWI1Yy01YWU0NDZjMDNjOWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWR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iZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.VZiZHb4jY2FK5DXyMRN0VcfJw2Y5B8y9HHwPw4iPzRg)
from vimtex.
Let's focus on the bug report first:
- As far as I can see,
\volcite
is properly highlighted. But you do need to load thebiblatex
package for this to work. FYI, the support for these commands is not very thorough; it works by allowing any number of groups of argument groups. But it should work more or less as expected, I think. - It seems
\Cite
does not work.I'll fix that nowfixed.
Can you please verify that I'm not mistaken somehow? I.e., modify your MWE to use only biblatex and verify that it does work as expected.
from vimtex.
Thank you for fixing \Cite
. I haven't tested that yet (I'm still working with the previous commit of vimtex).
As for \volcite
, it does not appear to be correctly highlighted on my computer. Here is the updated MWE using plain biblatex
:
MWE
main.tex:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Normal:
\documentclass[12pt,article,draft]{memoir}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite[23]{worman}
\Cite[23]{worman}.
This is good biblatex syntax, so the citekey SHOULD be highlighted as such and should not be spell-checked:
\volcite{1}[23]{worman}
This is bad biblatex syntax, so the citekey would ideally NOT be highlighted as such and SHOULD be spell-checked:
\volcite[23]{worman}
\parencite[23]{worman}
\pvolcite[23]{worman}
\end{document}
test.vim:
set nocompatible
set mmp=5000
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
call plug#end()
set spell
And this is what I get with nvim -u test.vim main.tex
:
![Screenshot 2024-01-29 at 11 20 31 AM](https://private-user-images.githubusercontent.com/6886906/300419320-dc4d2789-00a2-4ccf-b00a-6530a35247e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMyMTM4OTYsIm5iZiI6MTcxMzIxMzU5NiwicGF0aCI6Ii82ODg2OTA2LzMwMDQxOTMyMC1kYzRkMjc4OS0wMGEyLTRjY2YtYjAwYS02NTMwYTM1MjQ3ZTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MTVUMjAzOTU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWM0OTVhZWE5NjU4MmI5MDY4YjE1NWI1N2M1ZWU2ZDgxZTg2MjM0YjQxYmE5NGE2OTUwNjQ1OTg1NTA1NjBjYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.oeWd_uPJoqBDsf2Z6J9d5UEiMLI6Iu6dQnxl1Sy1R-k)
As you can see, the citekey is highlighted as a spelling error only when the \volcite
syntax is right, not when it is wrong. The situation should be reversed.
from vimtex.
In other words, the situation with \volcite
(and all related commands like \pvolcite
) is exceptional, in that it needs to be allowed (indeed required) to have that mandatory volume argument.
from vimtex.
Ony my end, both of the \volcite
commands prevent spell checking.
from vimtex.
I've pushed a minimal version of biblatex-chicago now, FYI; it is probably not good enough yet, but at least it ensures to load the biblatex syntax rules and adds some form of support for \headlesscite
.
from vimtex.
That is curious. I will now update the vimtex plugin on my computer and try again.
from vimtex.
Oh; the problem is with the concealed variants. I'll look into that now.
from vimtex.
Ah, OK. Just to confirm the results of my update: I still am getting the spell-check highlighting on the correct \volcite
command (i.e., the problem is not solved for me).
from vimtex.
I've pushed a fix for the volcites now. Notice that it is not ideal: The bad form will still "look" right. I hope that's OK.
from vimtex.
That did the trick, thank you!
from vimtex.
And yes, it's fine for the bad form to still look correct. It's the kind of syntax error one rarely makes, since the whole point of using \volcite
is to enter a volume number!
from vimtex.
Great; glad to hear it! So, over to biblatex-chicago. The docs were not very specific on the arguments for \headlesscite
- could you check if the updates are sufficient?
from vimtex.
Great! Glad to hear it works as expected! And thanks for making it easy by providing all the necessary details!
from vimtex.
Related Issues (20)
- Zathura issues with finding Window ID HOT 2
- Disabling "latexmk is not executable" message on startup HOT 3
- Cannot create directory: file already exists error when compiling HOT 7
- Continuous mode for OpenBSD fails due to option HOT 8
- citekey: link to BibDesk HOT 49
- Concealing subscript letters stopped working HOT 4
- [help] Is there possible way for another plugin to get mainfile path that vimtex finds? HOT 1
- Viewer (evince) opening on top of neovim instance instead of new window HOT 1
- Support for nofile buffers (e.g. AirLatex) HOT 3
- inverse search not working WSL HOT 9
- Inline math environment not detected as text object HOT 7
- Disgusting visual editing mode HOT 1
- lots of errors despite a successful install HOT 5
- VimtexInverseSearch can be run but doesn't do anything HOT 8
- inverse search in zathura opens an extra gvim window HOT 6
- What can we do to improve the output parsing/visuals of pdflatex? HOT 1
- Vimtex very slow on basic navigations HOT 3
- Compile with Okular in Windows 10 HOT 1
- Push some files to vim runtime? HOT 9
- Detect "Overfull vbox" warning messages in log file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimtex.