From 7dd319e16dffe8a4dca22bf5888d2b6c23aa6b9d Mon Sep 17 00:00:00 2001 From: mitchkeller Date: Sat, 20 Jul 2019 14:44:22 -0500 Subject: [PATCH] Progress on indexing --- basics/basics-part.xml | 224 ++++++++++++++++++++++++++++++----------- basics/sbsgroup.ptx | 11 +- basics/table.ptx | 2 - 3 files changed, 167 insertions(+), 70 deletions(-) diff --git a/basics/basics-part.xml b/basics/basics-part.xml index cd39f52..84aeaea 100644 --- a/basics/basics-part.xml +++ b/basics/basics-part.xml @@ -82,6 +82,8 @@ Some basic content of a paragraph + p code for + code forp @@ -102,10 +104,10 @@ and subsection as divisions. division document structure - section - sectiondivision - subsectiondivision - chapterdivision + section + sectiondivision + subsectiondivision + chapterdivision They are the key organizational elements of the structure of a document and all have (essentially) the same syntax. If a division does not contain any other divisions, then its structure looks like what we see in . (Plenty of other things can go inside other than paragraphs, @@ -114,18 +116,20 @@ The general outline of a section as a model division - section code for - code forsection + section code for + code forsection

- If a division has other divisions inside it, + divisioncontaining other divisions + introductionof a division + conclusionof a division + If a division has other divisions inside it, then the structure is a bit more complicated and regimented. In particular, if you want text before your first subdivision (subsection in this example), that text must go inside introduction. - introductionof chapter, section, etc. If you want to start with the subsection, then the introduction is optional. In the division with subdivisions model, @@ -136,21 +140,29 @@

A section with subsections. + section code for + code forsection + subsection code for + code forsubsection + introductionof a division code for + code forintroduction of a division + conclusionof a division code for + code forconclusion of a division - Limitations on introductions - introductionof chapter, section, etc.limitations + Limitations on introductions and conclusions + introductionof a divisionlimitations + conclusionof a divisionlimitations

- There are a lot of tags that are not - allowed in introductions. + There are many tags that are not + allowed in introductions and conclusions. In general, avoid things that would have numbers. For instance, - one should not put an example or an exercise in an introduction. - Once the schema is correct, this text should be updated. + one should not put an example or an exercise in an introduction or conclusion.

@@ -207,7 +219,9 @@ Displayed equations code fordisplayed equation equationdisplayed code for - + code forme + me code for +
@@ -227,7 +241,12 @@ Aligned equations code foraligned equations equationaligned code for - + code formd + md code for + code formrow + mrow code for + + @@ -279,6 +298,8 @@ listordered code for ordered list code for code forordered list + ol code for + code forol @@ -291,6 +312,7 @@

+ labelof ol You can use the label attribute on the ol tag to change the default labeling. For instance, if the opening tag for the list above were ol label="A", @@ -307,7 +329,9 @@ listunordered code for unordered list code for code forunordered list - + ul code for + code forul + @@ -323,7 +347,9 @@

- You can also use the cols attribute to split a list + colsof a list + listarranged in multiple columns + You can also use the cols attribute to split a list (ordered or unordered) across multiple columns if the screen/page is suitably wide. listdisplayed in columns @@ -388,7 +414,7 @@ but a definition cannot have a proof. definition You are encouraged to use the term tag to set off the word being defined. - term (in a definition) + termin a definition If you wish to include a list of notation to an appendix as your document, you might also add a notation tag such as shown in . notation (to be included in a notation list) @@ -751,9 +777,17 @@ Figures and Friends -

- <tag>figure</tag> +
+ <tag>image</tag> + image +

figurewithout captionimage + imagewithout caption + It is possible to include an image without a number or caption, centered on its own line by using image. In earlier days, required that such an image be contained in a sidebyside, but that is no longer the case, as this section will demonstrate.

+ graphics formats + SVG (Scalable Vector Graphics) format + PDF formatas image + PNG image format The gold standard for graphics to include in documents is, well, complicated. If you're only working with HTML output, @@ -769,22 +803,27 @@ PNG is also supported by modern web browsers and , so that's a good option when vector graphic formats like SVG and PDF are not available or appropriate.

- - - Code to include a figure - + + Code to include an image without a number or caption + image code for + code forimage + descriptionof image - +

- The code in produces the following output: + Use of width on an image must be a percentage, and for an image as in this example, the percentage is of the current line width. The code in produces the following output:

- + +

descriptionfor accessibilityThe example in also illustrates the use of description. We admit to not using a description for most of the other images in this Guide, but doing so is strongly recommended for accessibility reasons. A reader who is unable to see the visual element of your book can use assistive technology to have the description read to them. As much as is practical, authors should endeavor to include descriptions for their images. +

+ file extensionsfor graphics + extensionsfile extensions Note that the path to the image file does not include the file extension. When you run xsltproc, the output format you're generating will determine what gets added on so that the right file is grabbed. @@ -795,13 +834,38 @@ put the extension in the filename so that the file is used in both HTML and .

+
+ <tag>figure</tag> + figure +

To provide a number and caption for an image, the figure element is used.

+ + Code to include a figure + figure code for + code forfigure + captionof figure + imageinside figure code for + code forimage (inside figure) + + + + + + +

+ The code in produces the following output: +

+ + + +
- <tag>sidebyside</tag> + <tag>sidebyside</tag> + sidebyside

One of the more complex pieces of code in , by most accounts, is that used for positioning objects - (usually figures) + (frequently image and tabular, but also p) next to each other. If you've tried to do this in , you know that it can be challenging on a good day. Fortunately, @@ -818,6 +882,12 @@

Code to place things side by side + sidebyside code for + code forsidebyside + figureinside sidebyside + pinside sidebyside + sidebysidecontaining figure + sidebysidecontaining p @@ -832,6 +902,10 @@ A few more bells and whistles for sidebyside + sidebyside code for + code forsidebyside + figurecontaining sidebyside + sidebysideinside figure @@ -844,19 +918,16 @@ -

- Another use for sidebyside occurs when you want to center a graphc or tabular environment - (or a number of other things) - on a line by itself but without a caption and number. -

- -

- It is also possible to create a group of sidebyside tags with common widths by using the sbsgroup tag. +

side-by-side group + side-by-side groupsbsgroup + For a layout with multiple rows (but the same widths for each row, provides the side-by-side group using sbsgroup.

Use of sbsgroup - + sbsgroup code for + code forsbsgroup + @@ -870,8 +941,12 @@
- <latex/>-generated images -

+ <latex/>-generated images + using to generate images +

+ TikZ + mbx script + graphics formatsgenerating from source makes it straightforward to embed code that produces images (such as TikZ) into your source files. xsltproc basically just dumps your code out to your file so that it compiles nicely. @@ -883,7 +958,8 @@ so settle in with an experienced user before attempting the steps in this section.

-

+

latex-image-preamble + docinfo + TikZloading in latex-image-preamble Our example here just illustrates using TikZ to make a simple figure (the Hasse diagram of a poset), but lots of other graphics packages can be used. - One step required is to put + One step required is to put the following three lines in the docinfo tag of your main file. latex-image-preamble is used to set up the preamble that should be used for making SVG images from your source. + Macros that you wish to use more broadly should be put inside macros inside docinfo. +

@@ -924,14 +1004,11 @@
 </latex-image-preamble>
 
-

- in the docinfo tag of your main file. latex-image-preamble is used to set up the preamble that should be used for making SVG images from your source. - Macros that you wish to use more broadly should be put inside macros inside docinfo. -

- How to use latex-image to invoke TikZ - + latex-image code for + code forlatex-image + TikZinside latex-image @@ -970,18 +1047,18 @@ Tables - tables + table

After sidebyside, getting tables to lay out consistently between HTML and PDF is probably the second biggest headache that takes care of for us behind the scenes. - Lots of effort has been taken in order to fix some of the challenges inherent to working with the tabular environment in , and so if you author in , + Considerable effort has been taken in order to fix some of the challenges inherent to working with the tabular environment in , and so if you author in , you should be able to forget the hacks you had to learn to make nice tables in .

- tablenot for visual layout - tablenot for visual layoutside-by-side groupTables should only be used to display data. Too often in other authoring systems, tables are used as a crutch to facilitate the visual layout of a page. + tablenot for visual layout + tablenot for visual layoutside-by-side groupTables should only be used to display data. Too often in other authoring systems, tables are used as a crutch to facilitate the visual layout of a page. Do not do that when authoring . A good question to ask yourself before using a tabular is Do the xy-coordinates of a cell have semantic meaning in terms of my data? @@ -995,12 +1072,13 @@

Code to produce a table - tables - tables code for - code fortables - captionof a table - tablescaption - tabular + table code for + code fortable + titleof a table + captionof tabletitle + tabletitle + tabular code for + code fortabular rowof a table cellof a table entry of a tablecell @@ -1015,6 +1093,32 @@ +

tablewithout title or captiontabular + tabularwithout title or caption + Much like image, you can use tabular on its own to lay out a table of data, centered on a line, between (for instance) a couple of p elements. In many cases, the sort of data layout generated using tabular functions more as a figure than a table according to the definitions in the Chicago Manual of Style (CMOS), which attempts to follow in the absence of other guiding principles. The quote below from David Farmer on the pretext-dev Google Group provides guidance on deciding if your tabular should be contained in figure or table. +

+
+ tabledeciding when to use instead of figure +

There is an entire chapter on tables in CMOS, so I'll try to + summarize how those are distinct from many uses of grids of + numbers in PreTeXt. Some approximate quotes about tables from CMOS: +

    +
  • facts that are easy to scan and compare
  • +
  • a reader unfamiliar with the material should still be ale to make + sense of the table
  • +
  • tables are numbered and have titles (and not captions)
  • +
+

+

My take-away is that a CMOS table is a supplement to what is written + in the text and at any one time only a small amount of the table is + relevant. Rephrasing: a CMOS table is not intended to be integrated + with the narrative of the book, and the reader is not supposed to + pore over a large fraction of the table when it is first encountered. +

+ David Farmer +
+

In reality, the tabular in really should be contained in figure (and then the title must become a caption). Perhaps someday we will come up with an example tabular that meets the CMOS definition of a table to use instead.

+

columnof a table See for more information about how to make more complicated tables including formatting columns and vertical and horizontal rules. diff --git a/basics/sbsgroup.ptx b/basics/sbsgroup.ptx index 0112515..14c0ee0 100644 --- a/basics/sbsgroup.ptx +++ b/basics/sbsgroup.ptx @@ -1,11 +1,6 @@ - - - - -

- A short piece of text. -

- + + +

A longer piece of text. It goes on and on and on. diff --git a/basics/table.ptx b/basics/table.ptx index fdecb92..d57fe17 100644 --- a/basics/table.ptx +++ b/basics/table.ptx @@ -1,5 +1,3 @@ - - A simple table