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

Support for AuthorInText and AuthorOnly in CiteprocOptions #69

Open
kjambunathan opened this issue May 27, 2021 · 1 comment
Open

Support for AuthorInText and AuthorOnly in CiteprocOptions #69

kjambunathan opened this issue May 27, 2021 · 1 comment

Comments

@kjambunathan
Copy link

citeproc has no support for pandoc's AuthorInText.[1][2] It will
be good if citeproc implements AuthorInText natively.

The pandoc executable simulates AuthorInText by emitting
AuthorOnly and SuppressAuthor in sequence for the associated
key.[3] I believe citeproc could do likewise. The consequence of
this is that, citeproc will offer AuthorOnly and AuthorInText as
two new features, in addition to existing linkCitations, in
CiteprocOptions[4].


[1]: CitationItemType of citeproc makes no mention of AuthorInText. So, AuthorInText is not supported by citeproc.

data CitationItemType =
    AuthorOnly      --  e.g., Smith
  | SuppressAuthor  --  e.g., (2000, p. 30)
  | NormalCite      --  e.g., (Smith 2000, p. 30)
  deriving (Show, Eq, Ord)

[2]: CitationMode of pandoc-types supports AuthorInText in additon to SuppressAuthor.

data CitationMode
  = AuthorInText
  | SuppressAuthor
  | NormalCitation
  deriving (Show, Eq, Ord, Read, Typeable, Data, Generic)

[3]: In fromPandocCitations of pandoc simulates AuthorInText by emitting in AuthorOnly and SuppressAuthor in sequence for the associated key.

     in if Pandoc.citationId c == "*"
           then []
           else
             case citationMode c of
                  AuthorInText   -> [ cit{ citationItemType = AuthorOnly
                                         , citationItemSuffix = Nothing }
                                    , cit{ citationItemType =
                                              Citeproc.SuppressAuthor
                                         , citationItemPrefix = Nothing } ]
                  NormalCitation -> [ cit ]
                  Pandoc.SuppressAuthor
                                 -> [ cit{ citationItemType =
                                              Citeproc.SuppressAuthor } ]

[4]: CiteprocOptions of citeproc`

newtype CiteprocOptions =
  CiteprocOptions
  { linkCitations :: Bool
    --  Create hyperlinks from citations to bibliography entries
  }
  deriving (Show, Eq)
@kjambunathan kjambunathan changed the title Support for AuthorInText and SuppressAuthor in CiteprocOptions Support for AuthorInText and AuthorOnly in CiteprocOptions May 27, 2021
@jgm
Copy link
Owner

jgm commented May 27, 2021

Here we're implementing CSL, which up to now didn't have any concept of an author-only citation. When that changes (and I think there are current discussions on this issue), we can update citeproc accordingly. Until then, simulating the feature seems like the right thing to do.

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

2 participants