How do I get “good” markup?<\/li>\n<\/ul>\nWhat Is “Markup”?<\/h2>\n
Pressbooks uses HTML (content and structure) and CSS (styling) to create ebooks, PDFs and web versions. You don’t need to know HTML or CSS to use Pressbooks, but understanding a little bit about how they work will help make sure your books look good when you export from Pressbooks.<\/p>\n
NOTE: the VISUAL editor in Pressbooks allows you to style things without ever knowing about markup, or seeing code or tags. But if you’ve got formatting problems with your output, 90% of the time it will be caused by “bad” underlying markup.<\/p>\n
Why is Good Markup Important?<\/h2>\n
The thing about ebooks is that you never quite know what kind of setup your book is going to be read on. Different ebook reading software might display things differently, and the people reading often have control over things like spacing, margins etc. What this means is: you cannot control exactly how your book is going to look.<\/em> But! If you have good<\/strong>\u00a0markup,\u00a0<\/strong>chances are that the output will look like it’s supposed to. This is especially important in Pressbooks, where our outputs include: PDF (for print), EPUB, MOBI and web … so ALL of these formats have to look good.<\/p>\nBasic Markup<\/h2>\n
Markup is the HTML part … it’s the text of your book, plus tags in the background.<\/p>\n
For instance, here is a brief passage of text with some formatting:<\/p>\n
A long,
long<\/em> time ago, in a galaxy far, far away, there lived a fine young man unaware<\/strong> of various things about his past, including:\u00a0the Force,\u00a0what his father was up to,\u00a0how to use a lightsaber.\u00a0All that, however, was about to change. Three things were about to happen: he would discover the Force, he would learn how to use a lightsaber, and he would meet his father.<\/div>\nThis is what you might write into the VISUAL editor of Pressbooks. But if you look at the TEXT editor, you’ll see that the way that italic <\/em>and bold <\/strong>is achieved is through “markup”, or HTML. So the markup of that text looks like:<\/p>\nA long, <em>long<\/em>\u00a0time ago, in a galaxy far, far away, there lived a fine young man <strong>unaware<\/strong>\u00a0of various things about his past, including:\u00a0the Force,\u00a0what his father was up to,\u00a0how to use a lightsaber.\u00a0All that, however, was about to change. Three things were about to happen: he would discover the Force, he would learn how to use a lightsaber, and he would meet his father.<\/code><\/div>\nThe <em>tag<\/em><\/em> specifies that a text should be italicized. The <strong>tag<\/strong> <\/strong>specifies that it should be bold.<\/p>\nA reader reading an ebook, or a print book, or a web page won’t see those tags. They are instead used to tell the ebook software, or browser, how those words should look.<\/p>\n
So, what is good markup?<\/p>\n
OK, So What Is “Good” Mark-up?<\/h2>\n
Doesn’t Pressbooks give me “good” markup without me worrying about it?\u00a0Yes, although sometimes bad markup can be introduced by applying formatting incorrectly or importing documents with hidden markup from word processing software. How do I get “good” mark-up? What is the basic markup used in Pressbooks (and indeed all books)?<\/p>\n
The example above is pretty simple, but there are other kinds of content that you might want to style in certain ways in a book. In addition to italics and bolds, there are a handful tags you should know about:<\/p>\n
\n\n\ntag name<\/td>\n | used for<\/td>\n | \u00a0tags<\/td>\n<\/tr>\n |
\nstrong<\/td>\n | used to make text bold<\/td>\n | <strong> \u00a0or <b><\/code><\/td>\n<\/tr>\n\nemphasis<\/td>\n | used to make text italic<\/td>\n | <em> or <i><\/code><\/td>\n<\/tr>\n\nblockquote<\/td>\n | used to quote a long text, can be used for instance for a letter, a poem etc<\/td>\n | <blockquote><\/code><\/td>\n<\/tr>\n\nunordered list<\/td>\n | used to create a list with bullets<\/td>\n | <ul><li>item 1<\/li><li>item 2<\/li><\/ul><\/code><\/td>\n<\/tr>\n\nordered list<\/td>\n | used to create a numbered list<\/td>\n | \u00a0<ol> \n<li>item 1<\/li> \n<li>item 2<\/li> \n<\/ol><\/code><\/td>\n<\/tr>\n\nheadings<\/td>\n | used to make headings in your document<\/td>\n | <h1>, <h2>, <h3> ... <\/h6><\/code><\/td>\n<\/tr>\n<\/thead>\n<\/table>\nThis set of tags is all we’ll cover in this chapter, but you can do a lot more with tags in ebooks and Pressbooks.<\/p>\n Here is that same text from above with more tags used, resulting more formatting:<\/p>\n \n The Background<\/h3>\nA long,\u00a0long<\/em>\u00a0time ago, in a galaxy far, far away, there lived a fine young man\u00a0unaware<\/strong>\u00a0of various things about his past, including:<\/p>\n | | | | | |