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

Set CSS class for bibtex fields #36

Open
MLopez-Ibanez opened this issue Jan 16, 2023 · 0 comments
Open

Set CSS class for bibtex fields #36

MLopez-Ibanez opened this issue Jan 16, 2023 · 0 comments

Comments

@MLopez-Ibanez
Copy link

In the HTML output, every field should be enclosed in an appropriate CSS class. This would ease a lot defining a custom layout. For example, given the bibtex entry:

@Book{texbook,
    author = "Donald E. Knuth",
    title= "The {{\TeX}book}",
    publisher = "Addison-Wesley",
    year = 1984
}

The desired output HTML would be something like:

<dl>
<dt>
[<a name="texbook">1</a>]
</dt>
<dd class="Book">
<span class="author">Donald E. Knuth</span>.
<span class="title">The TeXbook.</span>
  <span class="publisher">Addison-Wesley</span>, <span 
class="year">2005</span>.<br>

<pre class="bibtex" id="texbook">
@BookK{texbook,
    author = "Donald E. Knuth",
    title= "The {{\TeX}book}",
    publisher = "Addison-Wesley",
    year = 1984
}
</pre>
</dd>
</dl>

The <span>, class and id tags don't do anything by themselves. However, they allow to modify the layout easily using CSS. For example, I would be able to use something like this:

.author {
	font-weight: bold;
}
.title {
	font-variant: italic;
}
pre.bibtex {
	overflow: auto; /* if larger than maximum width, will produce scrollbars */
}

Moreover, implementing layout properties of different bibliographic styles will be rather straightforward since the CSS can be embedded in the header of the html file.

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

1 participant