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

justified text alignment #353

Closed
igordot opened this issue Jul 2, 2020 · 8 comments
Closed

justified text alignment #353

igordot opened this issue Jul 2, 2020 · 8 comments

Comments

@igordot
Copy link

igordot commented Jul 2, 2020

I just started exploring manubot. I saw it was possible to do center and right-alignment. However, there does not seem to be an option to fully justify text where the text falls flush with both margins. This should be possible with at least HTML and Word output (it might be more complicated with PDF). Is it possible to add that feature?

@dhimmel
Copy link
Member

dhimmel commented Jul 2, 2020

I think this should be possible using the text-align: justify style in HTML. The PDF is created from HTML, so it should apply there.

References:

@vincerubinetti might be able to provide the best CSS to justify text for all manuscript paragraphs.

The DOCX probably won't be affected, but you could edit the DOCX document provided to --reference-doc.

@igordot
Copy link
Author

igordot commented Jul 2, 2020

I thought I can only edit the markdown files. Aren't the HTML files automatically generated?

@vincerubinetti
Copy link
Collaborator

Add this to your default.html theme:

p {
  text-align: justify;
}
#refs p {
  text-align: left;
}

The second rule overrides the first in the case of the paragraph elements in the bibliography section, where justifying the text doesn't look good.

Check to make sure this doesn't have any unintended side effects, but from my limited testing, it should be okay.

@dhimmel
Copy link
Member

dhimmel commented Jul 2, 2020

@igordot that file is located at build/themes/default.html. It ends up being inserted into the HTML document Pandoc generates.

@vincerubinetti
Copy link
Collaborator

I thought I can only edit the markdown files. Aren't the HTML files automatically generated?

Yes the HTML files are automatically generated. But you can customize the look/style of them by editing the CSS in the /build/themes/default.html theme file. This will affect all of your future generated manuscripts in that repo.

@igordot
Copy link
Author

igordot commented Jul 2, 2020

Thank you for clarifying. What would I need to edit for DOCX?

@vincerubinetti
Copy link
Collaborator

ctrl+shift+alt+s to open the styles pane. Find the normal style, and click the down arrow and find "modify...". Then change the alignment of the style to justify:
image

I think that should change the justification of all the text by default. If that has unintended side effects, try modifying the body text style instead of the normal style. I'm not a word expert though. Idk if they have a style just to apply to paragraphs (and not, for example, text in tables or captions).

@vincerubinetti
Copy link
Collaborator

Closing and deferring to #413

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

3 participants