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

No css for bibliography? #5

Closed
postylem opened this issue Jun 24, 2021 · 2 comments
Closed

No css for bibliography? #5

postylem opened this issue Jun 24, 2021 · 2 comments

Comments

@postylem
Copy link
Contributor

I was compiling HTML from markdown using pandoc with the --citeproc option, and I noticed that the bibliography looked bad (basically because there's no hanging indent).

Here is an example with tufte-pandoc-css
Screen Shot 2021-06-24 at 16 24 52

Compare to the following (with the default css), it's clear that the lack of hanging indent makes it pretty unreadable.

Screen Shot 2021-06-24 at 16 25 09

This seems to be caused by the fact that no classes such as div.csl-entry are defined in tufte-css, or in the additional css files in this repo.
I hacked together a quick fix by copying things from the default css. This is what I added:

div.csl-bib-body {
  /* font-size: 1.4rem; */
  /* line-height: 2rem; */
  width: 55%;
}
div.csl-entry {
  clear: both;
  margin-top: .25em;
}
.hanging div.csl-entry {
  margin-left:2em;
  text-indent:-2em;
}
div.csl-left-margin {
  min-width:2em;
  float:left;
}
div.csl-right-inline {
  margin-left:2em;
  padding-left:1em;
}
div.csl-indent {
  margin-left: 2em;
}
div.hanging-indent{
  margin-left: 1.5em;
  text-indent: -1.5em;
}

@media (max-width: 760px) {
  div.csl-bib-body {
    width: 100%;
  }
}

to get the following
Screen Shot 2021-06-24 at 17 21 57

This is better. But, a more comprehensive fix would be needed to make this work with arbitrary CSLs, I think (I'm just using the default Chicago author-year CSL, ones that make numbered references (e.g. Springer, or IEEE) would need additional attention.) Am I missing something, and is this fix not needed? Is fixing this something within the scope of this project?

(Also, This repo is great. Thanks for putting it up!)

@jez
Copy link
Owner

jez commented Jun 25, 2021

Sorry I’ve never used pandoc with citations. Feel free to contribute whatever styles you think you need!

@postylem postylem mentioned this issue Jun 25, 2021
@postylem
Copy link
Contributor Author

Ok. I just made a pull request here #6 (comment) with this addition. It doesn't provide complete support (I've only tested it with the default chicago-author-date style), but it should work for people who just use the default settings which is better than nothing :).

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