Skip to content
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

Punctuation with quotes #101

Open
3 tasks done
ctgraham opened this issue May 24, 2021 · 3 comments
Open
3 tasks done

Punctuation with quotes #101

ctgraham opened this issue May 24, 2021 · 3 comments

Comments

@ctgraham
Copy link

Please follow the general troubleshooting steps first:

  • I read the README and followed the instructions.
  • I am sure that the used CSL metadata follows the CSL schema.
  • I use a valid CSL stylesheet

Bug reports:

C.f. #50, but without the tag <style-options punctuation-in-quote="true"/>. Also tried adding the style-options to the CSL, but no change in output. Reproduced the unexpected behavior in citeproc-php 2.2.5, but not in Zotero's or ExLibris Primo's interpretation of the MLA stylesheet.

Expected:

“Colonizing Other Planets Is a Bad Idea.” <i>Futures</i>, vol. 110,

Actual:

“Colonizing Other Planets Is a Bad Idea”. <i>Futures</i>, vol. 110,

Used CSL stylesheet:

modern-language-association.csl 7140f39

Used CSL metadata

[
    {
        "DOI": "10.1016/j.futures.2019.02.020",
        "URL": "https://linkinghub.elsevier.com/retrieve/pii/S0016328718303136",
        "accessed": {
            "date-parts": [
                [
                    2021,
                    5,
                    24
                ]
            ]
        },
        "author": [
            {
                "family": "Billings",
                "given": "Linda"
            }
        ],
        "container-title": "Futures",
        "id": "10653761/QB9CKGG4",
        "issued": {
            "date-parts": [
                [
                    "2019"
                ]
            ]
        },
        "journalAbbreviation": "Futures",
        "language": "en",
        "page": "44-46",
        "title": "Colonizing other planets is a bad idea",
        "type": "article-journal",
        "volume": "110"
    }
]
@ctgraham
Copy link
Author

@seboettg , do you have any feedback on this?

@ewhanson
Copy link

I have also encountered the same issue. I was able to reproduce this with chicago-author-date.csl.

In the case @ctgraham describes, it looks like the . is added as a prefix to the journal title, e.g. . <i>Futures</I> so <style-options punctuation-in-quote="true"/> for the article title wouldn't capture it since . is a prefix to a separate Text node.

@seboettg
Copy link
Owner

seboettg commented May 7, 2022

Hi @ctgraham!
Sorry for my late response. Unfortunately I have no good news regarding this issue. I have no idea how to solve this. The problem is the structure of the Stylesheet and the way how citeproc-php handles that.
citeproc-php interprets a stylesheet as a tree and it travers through the branches and executes the "instructions" of the respective branch step by step.

In short, the structure of the stylesheet looks like this:

<style>
    <bibliography>
        <layout suffix=".">
            <group delimiter=". ">
                <text macro="author"/>
                <text macro="title"/>
                <text macro="container-title"/>
            </group>
        </layout>
    </bibliography>
    <macro name="title">
        <text variable="title" quotes="true" text-case="title"/>
    </macro>
    <macro name="author">
        <names variable="author">
            <name name-as-sort-order="first" and="text" delimiter-precedes-last="always" delimiter-precedes-et-al="always" initialize="false" initialize-with=". "/>
        </names>
    </macro>
    <macro name="container-title">
        <text variable="container-title" font-style="italic" text-case="title"/>
    </macro>
</style>

citeproc travers the style as follows: style > bibliography > group. Afterwards it renders each macro that is linked within this group (author, title, container-title) and remembers the results. Once citeproc is finished with each macro, it concatinates the results and separates them with the defined group delimiter ". " from <group delimiter=". ">. At this point citeproc has already finished the rendering of the title including quotes and other style defintions of the title and doesn't care about quotes and even doesn't know about quotes.

I've encountered similar problems over and over again reagrding the specification of CSL. Most problems I could solve by more or less hacky workaround approaches but in this special case I have no idea how to make a workaround.

You may change the stylesheet by removing delimiter=". " from group and add suffix=". " at text and name tags of the affected macros. I think this would solve your issue.

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

No branches or pull requests

3 participants