Zettlr / Zettlr

Your One-Stop Publication Workbench
https://www.zettlr.com
GNU General Public License v3.0
10.41k stars 642 forks source link

Using citations with alternative formats #5395

Open sorsted opened 2 months ago

sorsted commented 2 months ago

Description

Suppose that I have a citation, e.g. @svendsen2007. If I write @svendsen2007 [p. 233], then Zettlr correctly detects that I referred to page 233, and hence the citation is rendered in the editor as Svendsen (2007, 233). Similarly, if I write @svendsen2007 [part IV], it is rendered as Svendsen (2007, pt. IV). But suppose that I write something in a format that Zettlr didn’t expect, e.g. @svendsen2007 [epilogue]. Then it is simply rendered as Svendsen (2007). The epilogue part is completely invisible until I start editing the source again.

image

Reproducing

See above.

Zettlr version

3.2.1

Installation Method

From the Website or GitHub

Installation Method (Other)

No response

Your Platform

Architecture

Operating System Version

Windows 11

Additional Information

No response

boring-cyborg[bot] commented 2 months ago

Thanks so much for opening up your first issue here on the repository! 🎉 We would like to warmly welcome you to the community behind the app! ☺️ We'll check in soon and have a look at your issue. In the meantime, you can check your issue and make sure it aligns with our contribution guidelines! Here's the comprehensive list:

NOTE: Please do not share screen captures of buggy behavior on YouTube. If you have uploaded a video on YouTube and linked it already, don't worry! But, we would like to ask you to remove the video from YouTube and upload it directly to GitHub instead, by editing your comment. Read more here.

Enhancements

An enhancement takes a feature and improves or alters its behaviour. Please make sure to argue how your proposition will aid non-technical text workers, and why it can't be emulated easily with other features or apps!

Feature requests

Feature requests introduce whole new features into the app. This requires a lot of work, so these might be turned down if the implementation costs supersede the benefits we expect to see from implementing it. Please do not be disappointed if that happens. It likely has nothing to do with your great request but simply with us and our missing resources!

You can of course always ask someone to implement this feature, because a PR with a working new feature has much higher chances of being merged! :)

Bug reports

Please note that one of the main reasons for why bug reports cannot be addressed is that there's not enough information for us to find and fix the bug you describe, so make sure you try to pinpoint the bug as close as possible.

The ideal bug report for us has two qualities:

  1. The bug is always reproducible, at least within a certain context.
  2. We know exactly what specifically goes wrong, and there is consensus on what should happen instead.

Please note that if you encounter behaviour that does not align with your expectations of what would happen, this might as well be simply intended behaviour and we need to simply clarify why the behaviour is the way it is. This is not to be considered a bug and such issues may be closed! Suggest an enhancement instead!

But now, have a great day and thank you again!

nathanlesage commented 2 months ago

That is not an alternative format, but I agree that I cheaped out in the citation parsing until now and didn't properly implement non-locator citation suffixes. I was planning to revisit this at some point, but as nobody has complained until now it got bumped down the priority list.

sorsted commented 2 months ago

Honestly, why not just write out whatever it was that the user wrote? If they wrote @svendsen2007 [page 233], render it as Svendsen (2007, page 233). If they write @svendsen2007 [p. 233], render it as Svendsen (2007, p. 233). If they wrote @svendsen2007 [233], render it as Svendsen (2007, 233). Why go through the trouble of trying to make the citation format consistent in a Markdown editor? Such things can be done by whatever format the Markdown is converted to (such as LaTeX+BibLaTeX).

nathanlesage commented 2 months ago

Why go through the trouble of trying to make the citation format consistent in a Markdown editor? Such things can be done by whatever format the Markdown is converted to (such as LaTeX+BibLaTeX).

Because it should give users reasonable feedback if a locator was properly detected. There is quite a lot of complexity to citations, and "just giving out what the user wrote" doesn't really work.

sorsted commented 2 months ago

“Just giving out what the user wrote” is, as far as I know, more or less what BibLaTeX does. It interprets pure numbers as page numbers, but that's basically it. Is Zettlr supposed to have a more advanced locator detection system than BibLaTeX?

nathanlesage commented 2 months ago

Zettlr sticks to the Pandoc way, and I've seen John and Albert both criticize how complex it actually is.