Skip to content

Author metadata wrong with multiple authors in v0.9.0 #2556

Closed

Description

@marnicbar

Description

The author metadata is not set correctly in Typst version 0.9.0 when defining multiple authors.

The behavior was tested against version 0.8.0 which sets the metadata correctly.

Authors Version 0.8.0 Version 0.9.0
1 v0 8 0_one_author v0 9 0_one_author
2 v0 8 0_two_authors v0 9 0_two_authors
3 v0 8 0_three_authors v0 9 0_three_authors

Code for testing:

  • One author: #set document(author: "author 1")
  • Two authors: #set document(author: ("author 1", "author 2"))
  • Three authors: #set document(author: ("author 1", "author 2", "author 3"))

It seems as if the first author is set as a string of all authors when there is more than one author.

I also tested it with an array of only one author. This does not change the output compared to passing the string.

#set document(author: ("author 1"))

v0 9 0_one_author_array

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Nov 1, 2023
  2. samueltardieu commented on Nov 1, 2023

    @samueltardieu
    Contributor

    I cannot reproduce this on Linux with typst 0.9.0:

    $ pdfinfo t.pdf
    Author:          author 1, author 2, author 3

    Moreover, both the PDF metadata (/Author (author 1, author 2, author 3)) and XMP info (<dc:creator><rdf:Seq><rdf:li>author 1</rdf:li><rdf:li>author 2</rdf:li><rdf:li>author 3</rdf:li></rdf:Seq></dc:creator>) look correct.

  3. marnicbar commented on Nov 2, 2023

    @marnicbar
    Author

    I used the web app with either version 0.8.0 or 0.9.0 selected.

    I haven‘t tested it locally yet.

  4. marnicbar commented on Nov 2, 2023

    @marnicbar
    Author

    I compiled the same test file locally on Windows 11 and Adobe Acrobat shows the authors in the same weird way.

    I then tried pdfinfo and exiftool and they both showed the authors correctly.

    $ exiftool -a -G1 test.pdf
    [ExifTool]      ExifTool Version Number         : 11.88
    [System]        File Name                       : test.pdf
    [System]        Directory                       : .
    [System]        File Size                       : 10 kB
    [System]        File Modification Date/Time     : 2023:11:02 07:58:36+01:00
    [System]        File Access Date/Time           : 2023:11:02 07:58:38+01:00
    [System]        File Inode Change Date/Time     : 2023:11:02 07:58:37+01:00
    [System]        File Permissions                : rwxrwxrwx
    [File]          File Type                       : PDF
    [File]          File Type Extension             : pdf
    [File]          MIME Type                       : application/pdf
    [PDF]           PDF Version                     : 1.7
    [PDF]           Linearized                      : No
    [PDF]           Page Count                      : 1
    [PDF]           Language                        : en
    [PDF]           Author                          : author 1, author 2
    [PDF]           Creator                         : Typst 0.9.0
    [PDF]           Create Date                     : 2023:11:02 06:58:36Z
    [PDF]           Modify Date                     : 2023:11:02 06:58:36Z
    [XMP-x]         XMP Toolkit                     : xmp-writer
    [XMP-dc]        Creator                         : author 1, author 2
    [XMP-dc]        Format                          : application/pdf
    [XMP-dc]        Language                        : en
    [XMP-xmp]       Creator Tool                    : Typst 0.9.0
    [XMP-xmp]       Create Date                     : 2023:11:02 06:58:36Z
    [XMP-xmp]       Modify Date                     : 2023:11:02 06:58:36Z
    [XMP-xmpTPg]    N Pages                         : 1
    [XMP-xmpMM]     Document ID                     : yyjhjUTMNykBkGbi2WijNg==
    [XMP-xmpMM]     Instance ID                     : BImTNw9C7dIyjtepxT+IaA==
    [XMP-xmpMM]     Rendition Class                 : proof
    [XMP-pdf]       PDF Version                     : 1.7

    It seems to be the behavior of Adobe Acrobat (which does not look right to me) rather than an issue with Typst. Sorry for the false bug report.

  5. marnicbar commented on Nov 2, 2023

    @marnicbar
    Author

    I assumed that Typst version 0.8.0 does not include the XMP-dc Creator and that's why Adobe Acrobat shows the authors correctly. That assumption was wrong however as the same document compiled with Typst version 0.8.0 has [PDF] Author and XMP-dc Creator set. This leads me to believe that version 0.9.0 does things differently.

    Are there any other PDF properties that store information about the authors?

    This is the output of exiftool when the document is compiled with version 0.8.0:

    $ exiftool -a -G1 test.pdf
    [ExifTool]      ExifTool Version Number         : 11.88
    [System]        File Name                       : test.pdf
    [System]        Directory                       : .
    [System]        File Size                       : 9.9 kB
    [System]        File Modification Date/Time     : 2023:11:02 08:12:54+01:00
    [System]        File Access Date/Time           : 2023:11:02 08:12:55+01:00
    [System]        File Inode Change Date/Time     : 2023:11:02 08:12:55+01:00
    [System]        File Permissions                : rwxrwxrwx
    [File]          File Type                       : PDF
    [File]          File Type Extension             : pdf
    [File]          MIME Type                       : application/pdf
    [PDF]           PDF Version                     : 1.7
    [PDF]           Linearized                      : No
    [PDF]           Page Count                      : 1
    [PDF]           Language                        : en
    [PDF]           Author                          : author 1, author 2
    [PDF]           Creator                         : Typst
    [XMP-x]         XMP Toolkit                     : xmp-writer
    [XMP-dc]        Creator                         : author 1, author 2
    [XMP-dc]        Format                          : application/pdf
    [XMP-dc]        Language                        : en
    [XMP-xmp]       Creator Tool                    : Typst
    [XMP-xmpTPg]    N Pages                         : 1
    [XMP-xmpMM]     Rendition Class                 : proof
    [XMP-pdf]       PDF Version                     : 1.7
  6. added
    pdf
    on Nov 2, 2023
  7. added
    urgent
    needs-investigation
    on Nov 14, 2023
  8. tingerrr commented on Nov 14, 2023

    @tingerrr
    Contributor

    I've investigated a bit. The value that is written to the PDF in the end is set here:

    author: self.author(styles).0,

    And as @GFPJ said, without any content in the document, no author information is shown regardless of author count. The style chain entry for author is simply empty there.

    At first, my assumption was that the style was taken out of the child itself, so when the loop is not entered it won't get those styles of the first page. But this cannot be true as styles is never written to from inside the loop, it's shadowed.

    Unfortunately, that's all I found out so far, as the style.rs is rather complicated, containing a lot of very similarly named structs. @laurmaedje I think this is important for the styling rework you're working on. Maybe working on this independently is not worth it if this changes drastically in the new future.

  9. laurmaedje commented on Nov 14, 2023

    @laurmaedje
    Member

    @tingerrr I think the fact that no author metadata is written at all without content is independent from the issue with the wrong metadata.

  10. tingerrr commented on Nov 14, 2023

    @tingerrr
    Contributor

    @tingerrr I think the fact that no author metadata is written at all without content is independent from the issue with the wrong metadata.

    Yes, indeed, perhaps we should open an additional issue just for that?

  11. Dherse commented on Nov 17, 2023

    @Dherse
    Contributor

    @tingerrr I agree, there seems to be a general issue that documents with only set rules don't produce a correct document, not that it really matters I suppose.

  12. laurmaedje commented on Nov 17, 2023

    @laurmaedje
    Member

    I agree, there seems to be a general issue that documents with only set rules don't produce a correct document, not that it really matters I suppose.

    I will try to fix that when reworking the styling system. Feel free to open an issue for it.

  13. added
    model
    and removed on Nov 24, 2023
  14. laurmaedje commented on Nov 29, 2023

    @laurmaedje
    Member

    Turns out that if the authors are given in both the document information dictionary and the XMP metadata, Acrobat takes a little bit of both.

    With document information

    /Author (author 1, author 2, author3)
    

    and XMP metadata

    <dc:creator>
      <rdf:Seq>
        <rdf:li>author 1</rdf:li>
        <rdf:li>author 2</rdf:li>
        <rdf:li>author 3</rdf:li>
      </rdf:Seq>
    </dc:creator>

    Acrobat takes the first author from the document information dictionary and the remaining authors from the XMP metadata.

    To fix this for Acrobat, we could omit the remaining authors or all metadata from the document information catalog (it is optional) and only write XMP. However, not all other tools (including Apple Preview) read the XMP data. This means we do want to include all authors in the document information dictionary.

    Thus, the only alternative is to fold all authors into a single <rdf:li> in the XMP metadata. This is, in fact, exactly what the PDF/A spec Part 1 section 6.7.3 has to say about the matter. It's a bit weird to not use the array (and it makes Acrobat show the author list in quotes), but there's not much we can do about that.

  15. added a commit that references this issue on Jan 25, 2024
    af9d872
  16. added a commit that references this issue on Sep 12, 2026
    0b34999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmodelneeds-investigationpdfurgent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions