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

Themes #334

Closed
thorowitz opened this issue Apr 22, 2020 · 9 comments · Fixed by #338
Closed

Themes #334

thorowitz opened this issue Apr 22, 2020 · 9 comments · Fixed by #338

Comments

@thorowitz
Copy link

The Manubot manuscript promises that

The build process can also accommodate different “themes”, which change the general aesthetics and appearance of the exported document (e.g. from a contemporary sans-serif style to a more traditional serif style).

Are there existing alternate themes available? Where would I find them?

@dhimmel
Copy link
Member

dhimmel commented Apr 23, 2020

Currently, we only have a single default HTML theme available. Multiple themes has been a common user request (see #112), so we'd like to develop alternative themes in the future.

@thorowitz if there are specific tweaks you'd like to the theme, then let us know here. Many things are possible with small changes to build/themes/default.html. Happy to help you figure out how to tweak the theme to your needs.

@thorowitz
Copy link
Author

Changing the font and font size is my basic request. More complex would be changing the citation style.

@dhimmel
Copy link
Member

dhimmel commented Apr 23, 2020

A bit about changing these aspects is metnionted in USAGE.

More complex would be changing the citation style.

Changing the citation style to an existing CSL style is as simple as changing a single line. See #242 (comment)

Changing the font and font size is my basic request

@vincerubinetti have we explained in any issues how to change the font? Can you point @thorowitz to which lines of default.html to change?

@vincerubinetti
Copy link
Collaborator

vincerubinetti commented Apr 23, 2020

Luckily changing the font is very easy. You can import online fonts, like Google Fonts, right at the top of default.html like this

@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,700");
@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro");

Then to apply the font to everything, replace "Open Sans" on this line with your desired font name:

font-family: "Open Sans", "Helvetica", sans-serif;

You can put multiple fonts there, separated by comma, and for each character of text in your document, the browser will try the left-most font first, then try the next if the it isn't installed on the user's system or if it font doesn't have that particular text character, and so on.

@thorowitz
Copy link
Author

I was able to change the font, as described. However, I have not been able to change the CSL style. I think the directions in comment #242 may be out of date. The build.sh file does not have the line CSL_PATH=build/assets/style.csl . Instead, it just loads the Pandoc defaults: PANDOC_DEFAULTS_DIR="${PANDOC_DEFAULTS_DIR:-build/pandoc-defaults}" (line 25). I tried altering the pandoc-defaults, but that failed for some unknown reason. Then I tried adding the CSL line to build.sh, right after the Pandoc default line: CSL_PATH=https://www.zotero.org/styles/apa.csl. But this had no effect on the output.

@agitter
Copy link
Member

agitter commented Apr 27, 2020

@thorowitz sorry about the outdated documentation. The CSL behavior changed in #290. Now the CSL style is specified in a pandoc defaults in line 12 of the common.yaml file.

Is that the part of the Pandoc defaults you already tried editing?

Let's keep this issue open until we update the CSL information in USAGE.md.

@thorowitz
Copy link
Author

Yes, I tried to edit common.yaml. It failed with Process completed with exit code 64.

@thorowitz
Copy link
Author

Instead of pointing to a URL, I copied the app.csl file into my build/assets directory, and then changed Pandoc-defaults to point to that file. Success!

@dhimmel
Copy link
Member

dhimmel commented Apr 30, 2020

Let's keep this issue open until we update the CSL information in USAGE.md.

Opened #338. @thorowitz can you see whether the updates in that PR clarify how to set the citation style?

dhimmel added a commit that referenced this issue May 1, 2020
ploegieku added a commit to ploegieku/2023-functional-homology-paper that referenced this issue Aug 6, 2024
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 a pull request may close this issue.

4 participants