Skip to content

Add "Open arXiv" action to cite context menu#2082

Merged
lervag merged 2 commits intolervag:masterfrom
postylem:patch-1
Jun 27, 2021
Merged

Add "Open arXiv" action to cite context menu#2082
lervag merged 2 commits intolervag:masterfrom
postylem:patch-1

Conversation

@postylem
Copy link
Copy Markdown
Contributor

@postylem postylem commented Jun 27, 2021

Makes a new item to the VimtexContextMenu, so when doing <localleader>la on a citation, you get the option to open it on arXiv.org if the citation is an arXiv preprint.

This PR is just something I had done in my own branch so I could use it. I thought I'd make it available to others this way. I hope I'm following the correct procedure here (should I have suggested it in an issue first? I don't know the etiquette. Should I have created some tests too? It worked for me with the following citations).

@article{0801.1144,
	author = {John Kitchin and Karsten Reuter and Matthias Scheffler},
	doi = {10.1103/PhysRevB.77.075437},
	eprint = {arXiv:0801.1144},
	title = {Alloy surface segregation in reactive environments: A first-principles atomistic thermodynamics study of Ag3Pd(111) in oxygen atmospheres},
	year = {2008}}

@misc{wilcox.e:2021,
	archiveprefix = {arXiv},
	author = {Ethan Gotlieb Wilcox and Pranali Vani and Roger P. Levy},
	eprint = {2106.03232},
	primaryclass = {cs.CL},
	title = {A Targeted Assessment of Incremental Processing in Neural Language Models and Humans},
	year = {2021}}

lervag added a commit that referenced this pull request Jun 27, 2021
@lervag lervag merged commit e92233c into lervag:master Jun 27, 2021
@lervag
Copy link
Copy Markdown
Owner

lervag commented Jun 27, 2021

Makes a new item to the VimtexContextMenu, so when doing <localleader>la on a citation, you get the option to open it on arXiv.org if the citation is an arXiv preprint.

Thanks, that's useful!

This PR is just something I had done in my own branch so I could use it. I thought I'd make it available to others this way. I hope I'm following the correct procedure here (should I have suggested it in an issue first? I don't know the etiquette. Should I have created some tests too? It worked for me with the following citations).

This works fine! From my point of view, the only important procedure is that the communication of ideas and issues are clear, and by submitting a PR like this you make it perfectly clear what you want and you even propose a solution. It doesn't get much better than that. :)

I did make some changes before I merged:

  • I use 2 spaces indents and 80 columns maximum. I sometimes break the line width rule, but only if there is a good reason for it.
  • I added the example entries and a couple of simple tests.

@postylem postylem deleted the patch-1 branch June 28, 2021 02:38
@postylem
Copy link
Copy Markdown
Contributor Author

Ok I see thanks for the tips. I’ll obey the style if I make any further PRs. This is my first foray into vimscript so to be honest I wasn’t sure how to break long lines.

@lervag
Copy link
Copy Markdown
Owner

lervag commented Jun 28, 2021

No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants