summaryrefslogtreecommitdiff
path: root/doc/faq.txt
diff options
context:
space:
mode:
authorStuart Rackham <srackham@methods.co.nz>2012-03-17 15:38:02 +1300
committerStuart Rackham <srackham@methods.co.nz>2012-03-17 15:38:02 +1300
commitee7ddb507f110bea2ca2f546cae0b8e455b32fc8 (patch)
tree3c7f0740dbb425e141adaf5c0587687e8d979639 /doc/faq.txt
parent4f6e38a588313885d1799711aa076dd586e008b2 (diff)
downloadasciidoc-git-ee7ddb507f110bea2ca2f546cae0b8e455b32fc8.tar.gz
FAQ updates.8.6.7
Diffstat (limited to 'doc/faq.txt')
-rw-r--r--doc/faq.txt74
1 files changed, 59 insertions, 15 deletions
diff --git a/doc/faq.txt b/doc/faq.txt
index 944673b..ae4d436 100644
--- a/doc/faq.txt
+++ b/doc/faq.txt
@@ -381,7 +381,7 @@ http://dblatex.sourceforge.net/doc/sec-custom.html[doc.lot.show XSL
parameter] -- you can set it using the dblatex `--param` command-line
option, for example:
- $ a2x --dblatex-opts="--param=doc.lot.show=figure,table" doc/article.txt
+ a2x --dblatex-opts="--param=doc.lot.show=figure,table" doc/article.txt
== How can I stop the document title being displayed?
@@ -477,7 +477,7 @@ CSS stylesheet. For example the following command will generate a
single `article.html` file containing embedded images, admonition
icons and the CSS stylesheet:
- $ asciidoc -a data-uri -a icons article.txt
+ asciidoc -a data-uri -a icons article.txt
== Are there any tools to help me understand what's going on inside AsciiDoc?
@@ -943,20 +943,55 @@ http://live.gnome.org/Yelp[Yelp], the GNOME help viewer, does a
creditable job of displaying DocBook XML files directly.
-== Can you create ODF documents using AsciiDoc?
+== Can you create ODF and PDF files using LibreOffice?
-The easiest and highest fidelity method I've seen is to generate
-HTML from AsciiDoc then paste it from your browser (we use Firefox)
-into OpenOffice Writer.
+https://www.libreoffice.org/[LibreOffice] can convert HTML produced by
+AsciiDoc to ODF text format and PDF format (I used LibreOffice 3.5 at
+the time of writing, the fidelity is very good but it's not perfect):
-- I found that that there is better fidelity pasting HTML generated by
- the 'html4' backend instead of the default 'xhtml11' backend.
-- Don't paste AsciiDoc tables of contents, OpenOffice Writer (I was
- using version 2.3) hangs when saving. This may be something to do
- with the embedded JavaScript but I haven't looked closely at it, I
- may even be wrong about this.
+. Create the HTML file using AsciiDoc, for example:
-This tip was contributed by Bernard Amade.
+ asciidoc -a icons -a numbered -a disable-javascript article.txt
++
+JavaScript is disabled because LibreOffice does not execute
+JavaScript, this means that AsciiDoc table of contents and footnotes
+will not be rendered into ODF (if you want the table of contents and
+footnotes you could manually cut and paste them from a Web browser).
+
+. Convert the HTML file to an ODF text file using LibreOffice:
+
+ lowriter --invisible --convert-to odt article.html
++
+--
+The images imported from an HTML file will be linked, if your document
+contains images you should convert them to embedded images:
+
+[lowerroman]
+. Open the document in LibreOffice Writer.
+. Run the 'Edit->Links...' menu command.
+. Select all links and press the 'Break Link' button.
+
+Some images may also have been resized. To restore an image to its
+original size:
+
+[lowerroman]
+. Right-click on the image and select the 'Picture...' menu item.
+. Click on the 'Crop' tab.
+. Press the 'Original Size' button.
+
+--
+
+. Convert the ODF file to an PDF text file using LibreOffice:
+
+ lowriter --invisible --convert-to pdf article.odt
++
+A PDF index is automatically created using the section headings.
+
+Alternatively you could manually copy-and-paste the entire document
+from a Web browser into a blank ODF document in LibreOffice -- this
+technique will bring through the table of contents and footnotes.
+
+This tip was originally contributed by Bernard Amade.
== How can I suppress cell separators in included table data files?
@@ -1017,7 +1052,7 @@ characters. If you need spaces encode them as `%20`. For example:
Set the AsciiDoc 'lang' attribute to the appropriate language code.
For example:
- $ a2x -a lang=es doc/article.txt
+ a2x -a lang=es doc/article.txt
This will ensure that downstream DocBook processing will generate the
correct language specific document headings (things like table of
@@ -1090,7 +1125,7 @@ The default format for the `{localdate}` attribute is the ISO 8601
the `{localdate}` attribute. For example by setting it using the
asciidoc(1) `-a` command-line option:
- $ asciidoc -a localdate=`date +%d-%m-%Y` mydoc.txt
+ asciidoc -a localdate=`date +%d-%m-%Y` mydoc.txt
You could also set it by adding an Attribute Entry to your source
document, for example:
@@ -1252,3 +1287,12 @@ and this where you want the TOC to appear:
toc::[]
-------
+
+== HTML generated by AsciiDoc fills the width of the browser, how can I limit it to a more readable book width?
+You can set the maximum with for outputs generated by 'html5',
+'xhtml11' and 'slidy' backends by assigning the
+link:userguide.html#X103[max-width] attribute (either from the
+command-line or with an attribute entry in the document header). For
+example:
+
+ asciidoc -a max-width=55em article.txt