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

If set, use nb.metadata.authors for LaTeX author line #867

Merged
merged 1 commit into from
Aug 29, 2018
Merged

If set, use nb.metadata.authors for LaTeX author line #867

merged 1 commit into from
Aug 29, 2018

Conversation

mpetroff
Copy link
Contributor

There's an authors metadata field that's part of the Notebook spec. If it's set, this pull request uses it to set the author line for LaTeX export.

@blink1073 blink1073 added this to the 5.4 milestone Aug 29, 2018
@blink1073
Copy link
Contributor

Thanks!

@blink1073 blink1073 merged commit 2f11f17 into jupyter:master Aug 29, 2018
@mpetroff mpetroff deleted the add-latex-author-support branch August 29, 2018 14:25
@ashwinvis
Copy link

@mpetroff How does this work? Can you share an example?

I tried to edit the notebook metadata towards the end of the file:

 "metadata": {
  "authors": ["Mr. A", "Mr. B"],
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  },
  "title": "Example"
 },

When I export as Latex, I only get this

    % Document parameters
    % Document title
    \title{Example}
    
    
    
    \author{, }

I wonder what is the need of the attribute='name' is in this line:

https://github.com/mpetroff/nbconvert/blob/80a1740cd2c31e20dbb6759e8b2cb778607e60f2/nbconvert/templates/latex/base.tplx#L157

@mpetroff
Copy link
Contributor Author

Per the Notebook spec, the authors metadata is a list of dictionaries, not strings:

"metadata": {
  "authors": [
    {
      "name": "Fernando Perez"
    },
    {
      "name": "Brian Granger"
    }
  ]
}

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

Successfully merging this pull request may close these issues.

3 participants