-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow inline formatting in locators? #68
Comments
You can see why this happens from the types: -- | The part of a citation corresponding to a single work,
-- possibly including a label, locator, prefix and suffix.
data CitationItem a =
CitationItem
{ citationItemId :: ItemId
, citationItemLabel :: Maybe Text
, citationItemLocator :: Maybe Text
, citationItemType :: CitationItemType
, citationItemPrefix :: Maybe a
, citationItemSuffix :: Maybe a
} deriving (Show, Eq, Ord) Locator is a plain string, whereas prefix and suffix can be formatted. This representation makes it much easier for us to manipulate locators. I don't know, actually, whether the CSL spec says that formatting should be allowed on locators -- I had thought not, but I may be wrong. @denismaier @bdarcus do you know? |
Thank you for your answer. I cant find anything about this in the specification. But anyway, I don't want to argue for this or that solution, but to point to the inconsistency across citation modes. If you choose not to permit formatting inside locators, could it be noted in the manual? |
It's not an inconsistency across citation modes. The difference is that in your first case you've explicitly marked something as a locator using
(oddly excluding the page?) while in the second
you haven't done this. Since pandoc's heuristics for locators don't detect this as one, and you don't use the |
I haven't checked, but am pretty sure we're silent on that question ATM.
|
I could change it to allow formatted content, but conceptually this seems like something that should have a solution at the style level (some styles will want to format roman-numeral locators with small caps, others with large caps, etc.). |
Yeah, I can see that. I just don't recall it coming up. Thoughts on this @bwiernik? |
Sorry, I thought that in I excluded the page because CSL only supports one locator, so I had to format it myself. In this case one can set all the locator to small caps, so it is not so big a problem. It would be if one had to put some part in italics (like prooem.). Since CSL handles the locator in a monolithic way, it can't be supported by the style. |
It would also be useful to print folios like f. 35v. |
In your case the best workaround is probably to manually format the locators. You just need to block pandoc from treating them as locators; I think you could do that using something like
(untested) |
Ok, in the spec
In my understanding that means that the locator should not be treated differently than any other variable, the label mechanism aside. |
OK, resolved then to change this to allow formatted locators. |
Tricky aspects of this: currently we substitute the
What makes this harder in citeproc is that citeproc is polymorphic on the output format -- it could be any structured type that instantiates a certain class (CiteprocOutput), so ALL we can use are the methods defined for that class. We may need to add new methods to allow these operations. [EDIT: Changes to pandoc would also be needed: |
I don't see why we would need any specific support at the style level--I think we should just be able to apply the standard inline text formatting to locator contents, as appears to have been implemented. |
Oh I see. This should be addressable with the same new syntax that will be needed to style multiple locators. citation-style-language/schema#342 |
Actually I think you're right that this can be handled in the regular way. |
The locators contents could be handled in the regular way. For formatting of locator labels, that would need to be in a style, which would require something like the |
Ah, okay. |
I don't think that it is worth opening a new issue, so I add it here: the same problem arise with name variables, especially when citing works written by kings, emperors, popes or bishops in languages where the ordinal suffix should be in superscript (such as "Justinien Ier"). Again, the specifications are silent about it, but Zotero does parse HTML-like markup in name fields. |
From my perspective, markup should be allowed in any variable |
Fortunately you can still do "Iᵉʳ". <term name="ordinal-01" gender-form="feminine" match="whole-number">ʳᵉ</term>
<term name="ordinal-01" gender-form="masculine" match="whole-number">ᵉʳ</term> |
Btw, the issue for names is #63. |
With citeproc 0.3.0.9, when compiling the following MWE, the smallcaps in the "section" locator are stripped from the output:
Output (with acta-philosophica.csl):
However, if I set the output format to
native
, I can see thativ
is wrapped in aSmallCaps
object in the value of thecitationSuffix
property. It is only set to a plain string in the content of theCite
object.Now, if I modify the body of my markdown file like this:
The formatting is retained:
It can also be seen that the locator label is plural in the first case and singular in the second.
The text was updated successfully, but these errors were encountered: