Yes, if you have a Standard or Pro plan and you can use a Custom book Theme, you can switch between justified and unjustified (or ragged right) margins.

To do this, go to your book's Theme page, select "Custom", and scroll down until you see this:

By default, text is justified in Leanpub PDFs.

If you un-tick "Justify Text", then scroll to the bottom of the page and click the "Update Theme" button, then the next time your create a preview of your book, the text in the PDF will be ragged right, like this:

Did this answer your question?