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

Left align slide text #1897

Closed
afredstonhermann opened this issue May 10, 2017 · 3 comments
Labels

Comments

@afredstonhermann
Copy link

@afredstonhermann afredstonhermann commented May 10, 2017

I'm creating a presentation in rmarkdown with reveal.js and would like the text on my slides to be left-aligned, not centered. I understand there is a global option to toggle center on/off, but this only affects vertical centering when I knit the HTML file. How do I left-align text for the entire file? The output options I am using are:

output:
  revealjs::revealjs_presentation:
    theme: night
    transition: none
    center: false
    reveal_options:
      slideNumber: true
      progress: true
  beamer_presentation:
    toc: false
    incremental: true

Thanks for the help and for creating such a useful tool!

@sull

This comment has been minimized.

Copy link

@sull sull commented May 12, 2017

I was just looking for the same config but I think the only way is to adjust the CSS. If you use a theme, you can just add it there.

.reveal .slides > section > section { text-align:left; }

@afredstonhermann

This comment has been minimized.

Copy link
Author

@afredstonhermann afredstonhermann commented May 12, 2017

I haven't mastered adjusting CSS in RMarkdown yet, but I just came across this (clumsier) solution on Stack Overflow that left-aligns all text in the slides, although not the titles:

---

<style type="text/css">
  .reveal p {
    text-align: left;
  }
  .reveal ul {
    display: block;
  }
  .reveal ol {
    display: block;
  }
</style>

## First Slide
@bnjmnt4n

This comment has been minimized.

Copy link
Collaborator

@bnjmnt4n bnjmnt4n commented Jun 10, 2017

Yep, you can use CSS to style text to left align it. For individual slides, you can even use inline styles, like <section style="text-align: left;"> to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.