Merge pull request #16851 from robsean/patch-8

Translated
This commit is contained in:
Xingyu.Wang 2019-12-31 08:30:53 +08:00 committed by GitHub
commit 4050268b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 124 additions and 118 deletions

View File

@ -1,118 +0,0 @@
Translating by robsean
How to create an e-book chapter template in LibreOffice Writer
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC)
For many people, using a word processor is the fastest, easiest, and most familiar way to write and publish an e-book. But firing up your word processor and typing away isn't enough--you need to follow a format.
That's where a template comes in. A template ensures that your book has a consistent look and feel. Luckily, creating a template is quick and easy, and the time and effort you spend on it will give you a better-looking book.
In this article, I'll walk you through how to create a simple template for writing individual chapters of an e-book using LibreOffice Writer. You can use this template for both PDF and EPUB books and modify it to suit your needs.
### My approach
Why am I focusing on creating a template for a chapter rather than one for an entire book? Because it's easier to write and manage individual chapters than it is to work on a single monolithic document.
By focusing on individual chapters, you can focus on what you need to write. You can easily move those chapters around, and it's less cumbersome to send a reviewer a single chapter rather than your full manuscript. When you've finished writing a chapter, you can simply stitch your chapters together to publish the book (I'll discuss how to do that below). But don't feel that you're stuck with this approach--if you prefer to write in single file, simply adapt the steps described in this article to doing so.
Let's get started.
### Setting up the page
This is important only if you plan to publish your e-book as a PDF. Setting up the page means your book won't comprise a mass of eye-straining text running across the screen.
Select **Format > Page** to open the **Page Style** window. My PDF e-books are usually 5x8 inches tall (about 13x20cm, for those of us in the metric world). I also set the margins to half an inch (around 1.25 cm). These are my preferred dimensions; use whatever size suits you.
![LibreOffice Page Style window][2]
The Page Style window in LibreOffice Writer lets you set margins and format the page.
Next, add a footer to display a page number. Keep the Page Style window open and click the **Footer** tab. Select **Footer on** and click **OK**.
On the page, click in the footer, then select **Insert > Field > Page Number**. Don't worry about the position and appearance of the page number; we'll take care of that next.
### Setting up your styles
Like the template itself, styles provide a consistent look and feel for your documents. If you want to change the font or the size of a heading, for example, you need do it in only one place rather than manually applying formatting to each heading.
The standard LibreOffice template comes with a number of styles that you can fiddle with to suit your needs. To do that, press **F11** to open the **Styles and Formatting** window.
![LibreOffice styles and formatting][4]
Change fonts and other details using the Styles and Formatting window.
Right-click on a style and select **Modify** to edit it. Here are the main styles that I use in every book I write:
Style Font Spacing/Alignment Heading 1 Liberation Sans, 36 pt 36 pt above, 48 pt below, aligned left Heading 2 Liberation Sans, 18 pt 12 pt above, 12 pt below, aligned left Heading 3 Liberation Sans, 14 pt 12 pt above, 12 pt below, aligned left Text Body Liberation Sans, 12 pt 12 pt above, 12 pt below, aligned left Footer Liberation Sans, 10 pt Aligned center
![LibreOffice styles in action][6]
Here's what a selected style looks like when applied to ebook content.
That's usually the bare minimum you need for most books. Feel free to change the fonts and spacing to suit your needs.
Depending on the type of book you're writing, you might also want to create or modify styles for bullet and number lists, quotes, code samples, figures, etc. Just remember to use fonts and their sizes consistently.
### Saving your template
Select **File > Save As**. In the Save dialog box, select _ODF Text Document Template (.ott)_ from the formats list. This saves the document as a template, which you'll be able to quickly call up later.
The best place to save it is in your LibreOffice templates folder. In Linux, for example, that's in your **/home** directory, under . **config/libreoffice/4/user/template**.
### Writing your book
Before you start writing, create a folder on your computer that will hold all the files--chapters, images, notes, etc.--for your book.
When you're ready to write, fire up LibreOffice Writer and select **File > New > Templates**. Then select your template from the list and click **Open**.
![LibreOffice Writer template list][8]
Select your template from the list you set up in LibreOffice Writer and begin writing.
Then save the document with a descriptive name.
Avoid using conventions like _Chapter 1_ and _Chapter 2_ --at some point, you might decide to shuffle your chapters around, and it can get confusing when you're trying to manage those chapters. You could, however, put chapter numbers, like _Chapter 1_ or _Ch1,_ in the file name. It's easier to rename a file like that if you do wind up rearranging the chapters of your book.
With that out of the way, start writing. Remember to use the styles in the template to format the text--that's why you created the template, right?
### Publishing your e-book
Once you've finished writing a bunch of chapters and are ready to publish them, create a master document. Think of a master document as a container for the chapters you've written. Using a master document, you can quickly assemble your book and rearrange your chapters at will. The LibreOffice help offers detailed instructions for working with [master documents][9].
Assuming you want to generate a PDF, don't just click the **Export Directly to PDF** button. That will create a decent PDF, but you might want to optimize it. To do that, select **File > Export as PDF** and tweak the settings in the PDF options window. You can learn more about that in the [LibreOffice Writer documentation][10].
If you want to create an EPUB instead of, or in addition to, a PDF, install the [Writer2EPUB][11] extension. Opensource.com's Bryan Behrenshausen [shares some useful instructions][12] for the extension.
### Final thoughts
The template we've created here is bare-bones, but you can use it for a simple book, or as the starting point for building a more complex template. Either way, this template will quickly get you started writing and publishing your e-book.
### About The Author
Scott Nesbitt;I'M A Long-Time User Of Free Open Source Software;Write Various Things For Both Fun;Profit. I Don'T Take Myself Too Seriously;I Do All Of My Own Stunts. You Can Find Me At These Fine Establishments On The Web
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/10/creating-ebook-chapter-template-libreoffice-writer
作者:[Scott Nesbitt][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/scottnesbitt
[2]:https://opensource.com/sites/default/files/images/life-uploads/lo-page-style.png (LibreOffice Page Style window)
[4]:https://opensource.com/sites/default/files/images/life-uploads/lo-paragraph-style.png (LibreOffice styles and formatting window)
[5]:/file/374466
[6]:https://opensource.com/sites/default/files/images/life-uploads/lo-styles-in-action.png (Example of LibreOffice styles)
[8]:https://opensource.com/sites/default/files/images/life-uploads/lo-template-list.png (Template list - LibreOffice Writer)
[9]:https://help.libreoffice.org/Writer/Working_with_Master_Documents_and_Subdocuments
[10]:https://help.libreoffice.org/Common/Export_as_PDF
[11]:http://writer2epub.it/en/
[12]:https://opensource.com/life/13/8/how-create-ebook-open-source-way

View File

@ -0,0 +1,124 @@
如何在 LibreOffice Writer 中创建一个电子书章节模板
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC)
对于很多人来说,使用 word 程序来写和发布一本电子书是一种最好的,最容易的,最熟悉的方法。但是,启动你的 word 程序和打字是不够的--你需要遵循一种格式。
这就是模板的来源。一个模板确保你的电子书有一个一致的外观和体验。幸运的是,创建一个模板是快速和容易的,并你在其上花费的时间和努力将给你一本更好感官的书。
在这片文章中,我将陪伴你走过如何使用 LibreOffice Writer 创建一个简单的用于写一本电子书的各个章节的模板。你可以将这个模板用于 PDF 和 EPUB 书籍,并假以修改来满足你的需要。
### 我的方法
为什么我聚焦于为一个章节创建一个模板,而不是为一整本书创建一个模板?因为编写和管理单独的章节比编写和管理单个庞大而僵化的文档更容易。
通过聚焦于单独的章节,你可以聚焦于你需要编写的东西。你可以容易地向各处移动这些章节,给审阅者发单独一章节比发你完整的原稿更简单而高效。当你写完一章后,你可以简单地把你的章节拼凑在一起来出版这本书(我将在下面讨论如何做到这一点)。但是不要觉得你被这种方法所束缚 --如果你更喜欢在单个文件中编写,简单地调整在这篇文章中描述的步骤来做做成这样。
让我们开始吧。
### 设置页面
仅当你计划发布你的电子书为一本 PDF 书时,这是很重要的。设置页面意味着你的书将不包含大量的穿越屏幕的让眼睛疲劳的文本。
选择 **格式 > 页面** 来打开 **页面样式** 窗口。我的 PDF 电子书通常是 5x8 英寸高(大约 13x20cm ,对于我们这些生活在米制世界的人来说)。我也设置页边距为半英寸(约 1.25 cm)。这些是我较喜欢的尺寸;使用任何适合你的尺寸。
![LibreOffice Page Style window][2]
在 LibreOffice Writer 中的页面样式窗口让你设置页边距和页格式。
接下来,添加页脚以显示页码。保持页面样式窗口打开着,并单击 **页脚** 选项卡。选择 **在页脚上** 并单击 **确定**
在该页面上,在页脚中单击,然后选择 **插入 > 字段 > 页码**。不要担心页码的位置和外观;我们接下来会处理。
### 设置你的样式
像模板本身一样,样式为你的文档提供一种一致的外观和体验。如果你想更改一个标题的字体或大小,例如,你只需要在一个地方完成它,而不是手动应用格式化到每个标题。
标准化的 LibreOffice 模板带有许多样式,你可以调整它们以适应你的需要。为此,按 **F11** 来打开 **样式和格式** 窗口。
![LibreOffice styles and formatting][4]
使用样式和格式窗口更改字体和其它细节。
在一个样式上右键单击,并选择 **修改** 来编辑它。 这里是我在每本中使用的主要样式:
样式 | 字体 | 间距 / 对齐方式
:-: | :-: | :-:
标题 1 | Liberation Sans, 36 pt | 上面 36 pt ,下面 48 pt ,左对齐
标题 2 | Liberation Sans, 18 pt | 上面 12 pt ,下面 12 pt ,左对齐
标题 3 | Liberation Sans, 14 pt | 上面 12 pt ,下面 12 pt ,左对齐
正文 | Liberation Sans, 12 pt | 上面 12 pt ,下面 12 pt ,左对齐
页脚 | Liberation Sans, 10 pt | 居中对齐
![LibreOffice styles in action][6]
这是当我们应用到电子书内容时的一个选择的样式外观。
对于大多数书来说,这通常是最小量要求。可以随便更改字体和空格来适应你的要求。
根据你正在编写书的类型,你可能也想创建或修改项目符合样式,以及数字列表,引号、代码示例,数字符号等等。只需要记住始终如一地使用字体以及其大小。
### 保存你的模板
选择 **文件 > 另存为** 。在保持对话框中,从格式列表中选择 _ODF 文本文档模板 (.ott)_ 。这将保存模板为一个模板,以后你可以快速调用该模板。
保存模板的最佳位置是 LibreOffice 模板文件夹。例如,在 Linux 中,那是在你的 **/home** 目录下,在 . **config/libreoffice/4/user/template** 下。
### 编写你的书
在你开始编写前,在你的计算机上创建一个文件夹,它将为你的书保存所有的文件--章节,图像,笔记等等。
当你准备编写时,启动 LibreOffice Writer 并选择 **文件 > 新建 > 模板** 。然后从列表中选择你的模板,并单击 **打开**
![LibreOffice Writer template list][8]
从你在 LibreOffice Writer 中设置的列表中选择你的模板,并开始编写。
然后用一个描述性名称保存文档。
建议使用像 _章节 1__章节 2_ 这样的惯例--在某些时候,你可能决定重新编排你的章节,当你尝试管理这些章节时,它可能会变得混乱。然而,你可以在文件名称中放置章节数字,像 _章节 1__Ch1 。很容易重命名一个文件,_ 。如果你完成重新排版书的章节,像这样重命名更容易。
别再碍事,开始编写。记住在模板中使用样式来格式化文本--这就是为什么你要创建模板,对吧?
### 发布你的电子书
在完成编写一堆章节后并准备发布它们时创建一个主控文档。把一个主控文档作为你所编写章节的一个容器。使用一个主控文档你可以快速地组装你的书并任意重新排序你的章节。LibreOffice 帮助提供使用[主控文档][9]的详细信息。
假设你想生成一个 PDF ,不要只是单击**直接导出到 PDF** 按钮。这将创建一个相当不错的 PDF ,但是你可能想优化它。为此,选择 **文件 > 导出为 PDF** ,并在 PDF 窗口中轻微调整。你可以在 [LibreOffice Writer 文档][10] 中学到更多东西。
如果你想创建一个 EPUB 而不是 一个PDF ,或者除了一个 PDF 以外,另外创建一个 EPUB安装 [Writer2EPUB][11] 扩展。Opensource.com 的 Bryan Behrenshausen 为这个扩展[分享一些有用的说明][12] 。
### 结束语
我们在这里创建的模板是极简单的,但是你将其用于一本简单的书,或者作为构建一个复杂模板的起点。不管怎样,这个模板都会让你快速地开始编写和发布你的电子书。
### 关于作者About The Author
Scott Nesbitt ;我是一个长期使用自由开放源码软件的人;写各种东西都是为了玩;盈利。我不太看重我自己;我做我自己的特效。你可以在网上的一些高质量的大型组装找到我的踪迹。
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/10/creating-ebook-chapter-template-libreoffice-writer
作者:[Scott Nesbitt][a]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/scottnesbitt
[2]:https://opensource.com/sites/default/files/images/life-uploads/lo-page-style.png (LibreOffice Page Style window)
[4]:https://opensource.com/sites/default/files/images/life-uploads/lo-paragraph-style.png (LibreOffice styles and formatting window)
[5]:/file/374466
[6]:https://opensource.com/sites/default/files/images/life-uploads/lo-styles-in-action.png (Example of LibreOffice styles)
[8]:https://opensource.com/sites/default/files/images/life-uploads/lo-template-list.png (Template list - LibreOffice Writer)
[9]:https://help.libreoffice.org/Writer/Working_with_Master_Documents_and_Subdocuments
[10]:https://help.libreoffice.org/Common/Export_as_PDF
[11]:http://writer2epub.it/en/
[12]:https://opensource.com/life/13/8/how-create-ebook-open-source-way