# [OS X TeX] Writing a book

John B. Thoo jthoo at yccd.edu
Mon Apr 14 08:54:49 EDT 2014

Hello, everyone.

Since my last post on this, I have modified the main page a little (but not much).  It now starts off as follows.

---------------------------------begin---------------------------------

\documentclass[extrafontsizes,showtrims]{memoir}
% extrafontsizes sets the default font for the document to
% Latin Modern in the T1 font encoding, which is equivalent to
% \usepackage{lmodern}\usepackage[T1]{fontenc}

\setstocksize{11in}{8.5in}
\settrimmedsize{10in}{7in}{*}
\settrims{1in}{1.5in}   % set page size to 10in tall x 7 in wide
\settypeblocksize{8.5in}{5.75in}{*}
\setlrmargins{*}{0.8333in}{*}
\setulmargins{0.8in}{*}{*}
\checkandfixthelayout

\headstyles{wilsondob}   % sets chapter style = Italic
%      section style = CAPS
%      subsect style = Italic

\setsecnumdepth{subsection}   % number down to subsections
\setcounter{tocdepth}{2}      % show down to subsections in TOC

%%% Uncomment to typeset a specific chapter
\includeonly{pt_numthry}

%\usepackage{tgtermes}  % http://www.tug.dk/FontCatalogue/tgtermes/
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[]{amsmath,amssymb}

----------------------------------end----------------------------------

Also, as Themis pointed out, my trouble with longtable inside the Exercise package environment is that longtable is a float.  Thus, to avoid putting floats inside the Exercise environ, I gave up on longtable altogether and am switching to ctabular throughout the book.

The only technical problem I haven't resolved at this point is in the TOC.  For some reason, when it lists Part III in the TOC, shows "IIIFoundations" instead of "III Foundations" (with a space).  Parts I and II show up correctly in the TOC as "I Numeration Systems" and "II Arithmetic Snapshots" (each with a space).  I would appreciate any help to fix this.

Finally, I have a couple of additional questions.  It was suggested to me that perhaps I ought to include the following lines in the main page.

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

I'm using the Memoir documentclass option "extrafontsizes," and the Memoir manual states, "if you use the extrafontsizes option the default font for the document is Latin Modern in the T1 font encoding. This is like putting

\usepackage{lmodern}\usepackage[T1]{fontenc}

in the documents’s preamble (but with the extrafontsizes option you need not do this)."  That's why I thought I wouldn't need the fontenc and inputenc lines.  Was I mistaken?

It was also suggested to me that, in thinking of future editions, I may want to use UTF-8 (but that I should remember that *both* LaTeX (via the inputenc) *and* my editor (I'm using vi and pdflatex from the command line) *have to use the same encoding*).  I don't know anything about this.  What is your advice?

Thank you all so much.

Yours sincerely,

---John.

(I receive the digest of this mailing list.)

On Feb 18, 2014, at 12:00 PM, macosx-tex-request at email.esm.psu.edu wrote:

> Message: 6
> Date: Tue, 18 Feb 2014 09:03:54 -0800
> From: "John B. Thoo" <jthoo at yccd.edu>
> To: "<macosx-tex at email.esm.psu.edu> Mailing List"
> 	<MacOSX-TeX at email.esm.psu.edu>
> Subject: Re: [OS X TeX] Writing a book
> Message-ID: <99BC31A3-2605-4879-B95A-E87AE9075A87 at yccd.edu>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello, again.
>
> Thank you again to everyone who responded to my post.  If anyone has more suggestions, please do not hesitate to add to the responses.
>
> By the way, this is a bit of a long post.  I'm sorry about that.
>
> The deal with my friend is that I would typeset, and she would find a publisher. (She has experience with this, whereas this would be my first.) So, now that she's found a publisher and we've signed a contract, I can't tell her to dump them.
>
> I guess that the publisher is just not comfortable dealing with LaTeX. Eventually, they did say that they do contract a "compositor," but it was clear that it was not their preference to work with LaTeX.  Nevertheless, they finally told me to send them a PDF along with the LaTeX source files, but not to expect any help with the typesetting.
>
> Here is where the project stands now.
>
> They provided me the following specifications.
>
> 1) Trim size: 7" wide x 10" tall
> 2) Text on page:  5.75" wide x 8.5" tall
> 3) In the header, page number and book title on the verso page, and chapter title and page number on the recto page.
> 4) Chapter titles: each word capitalized.
> 5) Section titles: all caps (full size).
> 6) Subsection titles: each word capitalized.
> 7) Front matter: page numbers in Roman.
> 8) Main matter: page numbers in Arabic.
> 9) Figures and images: black and white.  (Book will be printed in black and white.)
>
> I decided to put the book in the "memoir" class as many here suggested. Below is my main page, but, just in case you don't read that to the end (and I wouldn't blame you if you don't), I have a question first.
>
> I chose to use the Exercise package for the exercises because it looked reasonable to use, but I have run into one problem with using it with the Longtable package.  It appears that if longtable has to break a table within an exercise, the table does not appear at all.  Does anyone have any suggestions for dealing with this, or maybe a suggestion for a different package for exercises?
>
> Thanks again for all your help.
>
> ---John.
>
> (I receive the digest of this mailing list.)
>
> -------------------------------cut here--------------------------------
> ---------------------------------begin---------------------------------
>
> Ok, here is my main page.
>
> % LaTeX filename aic_main.tex %%
>
> \documentclass[extrafontsizes,showtrims]{memoir}
> \setstocksize{11in}{8.5in}
> \settrimmedsize{10in}{7in}{*}
> \settrims{1in}{1.5in}   % set page size to 10in tall x 7 in wide
> \settypeblocksize{8.5in}{5.75in}{*}
> \setlrmargins{*}{0.8333in}{*}
> \setulmargins{0.8in}{*}{*}
> \checkandfixthelayout
>
> \headstyles{wilsondob}   % sets chapter style = Italic
>                         %      section style = CAPS
>                         %      subsect style = Italic
>
> %\usepackage[T1]{fontenc}
> %\usepackage[latin1]{inputenc}
> %\usepackage{tgtermes}
> \usepackage[protrusion=true,expansion=true]{microtype}
> \usepackage[]{amsmath,amssymb}
>
>
> %\renewcommand{\baselinestretch}{1.3}  % Uncomment this for double-spacing
>
>
> \usepackage[]{graphicx} \graphicspath{{../Text/trunk/Figures/}}
>                        \newsubfloat{figure}
>                          % Allow subfloats (sufigures) in figure environment
> \usepackage[]{url}
> \usepackage[]{xcolor}
> \usepackage[]{multicol}
> \usepackage[]{cancel}    % use \cancel{...} to cross off a term
> \usepackage[]{exercise}  \counterwithin{Exercise}{chapter}
>                         \setlength{\QuestionBefore}{1ex}
>                         \setlength{\subQuestionBefore}{1ex}
> \usepackage[]{etex}  % required for rotate.sty or rotating.sty
> \usepackage[]{rotating}
> \usepackage[]{array}
> \usepackage[]{longtable}
>
>
> %%% SPECIAL FONTS
> \usepackage[]{CJK}   % for Chinese characters
> \usepackage[]{oldprsn}   % for Old Persian cuneiform
> \usepackage[]{hieroglf}    % for Egyptian hieroglyph
>
> %%% MACROS FOR SPECIAL FONTS
> %
> % Chinese
> \newcommand{\cjk}[2]{\CJKchar[Bg5]{#1}{#2}}
>
> % Cuneiform
> \newcommand{\Oonehundred}{\mbox{\textcopsn{\Oone}\hspace{0.8em}\raisebox{0.4ex}{\turnbox{90}{\textcopsn{\Oone}}}}\:}
> \newcommand{\Olalone}{\mbox{\textcopsn{\Oone}\hspace{0.8em}\raisebox{1.0ex}{\turnbox{90}{\textcopsn{\Oone}}}\hspace{-0.8em}{\tiny \textcopsn{\Oone}}}\,}
> \newcommand{\Olal}{\mbox{\textcopsn{\Oone}\hspace{0.8em}\raisebox{1.0ex}{\turnbox{90}{\textcopsn{\Oone}}}}\,}
> \newcommand{\Oblank}{\,\raisebox{1.6ex}{\turnbox{-90}{\mbox{\textcopsn{\Owd}}} \hspace{-1.0em} \turnbox{-90}{\mbox{\textcopsn{\Owd}}}}\hspace{1.2em}}
>
> % Egyptian
> \newcommand{\HXmillion}{\raisebox{0.55ex}{$$\bigcirc\mskip-17.75mu\raisebox{-0.5ex}{\rule{1.0em}{0.5pt}}$$}}
>
>
> %%% MACROS
> % Preserve end-of-row \\ in tabular when \raggedright is used
> %\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
>
> \newcommand{\term}[1]{\textit{#1}}
> \newcommand{\bc}[1]{#1 \textsc{bc}}
> \newcommand{\bcdot}{\boldsymbol{\cdot}}
>
> \input{longdiv}    % use \longdiv{dividend}{divisor} for long division
>
>
> %%% ENVIRONMENTS
> \newenvironment{Quotation}{\begin{quotation}\small}{\end{quotation}}
>
>
> %%% THEOREM-LIKE ENVIRONMENTS
> \newtheorem{rmk}{Remark}[chapter]
> \newenvironment{remark}{\begin{rmk}\normalfont}{\hfill$$\blacktriangle$$\end{rmk}}
>
> \newtheorem{tai}{Think About It}[chapter]
> \newenvironment{thinkaboutit}{\begin{tai}\normalfont}{\hfill$$\diamond$$\end{tai}}
>
> \newtheorem{nyt}{Now You Try}[chapter]
> \newenvironment{nowyoutry}{\begin{nyt}\normalfont}{\hfill$$\blacksquare$$\end{nyt}}
>
> \newtheorem{rle}{Rule}[chapter]
> \newenvironment{rule!}{\begin{rle}\normalfont}{\hfill$$\circledast$$\end{rle}}
>
> \newtheorem{ex}{Example}[chapter]
> \newenvironment{example}{\begin{ex}\normalfont}{\hfill$$\square$$\end{ex}}
>
>
> %%% begin COVER
> %%% Source: <http://mirror.jmu.edu/pub/CTAN/info/latex-samples/TitlePages/>
> %%% \titleSW (modified)
> \newlength{\tpheight}\setlength{\tpheight}{0.9\textheight}
> \newlength{\txtheight}\setlength{\txtheight}{0.9\tpheight}
> \newlength{\tpwidth}\setlength{\tpwidth}{0.9\textwidth}
> \newlength{\txtwidth}\setlength{\txtwidth}{0.9\tpwidth}
> \newlength{\drop}
>
> \newcommand*{\thistitle}{\begingroup% Story of Writing
> \raggedleft
> \vspace*{\baselineskip}
> {\Huge\itshape Algebra in Context}\\[\baselineskip]
> {\large\itshape Introductory Algebra from
>                Origins to Applications}\\[0.2\textheight]
> {\Large Amy Shell-Gellasch \\[1ex] J.~B.\ Thoo}\par
> \vfill
> {\Large  \sffamily Johns Hopkins University Press}
> \vspace*{\baselineskip}
> \endgroup}
> %%% end COVER
>
>
> %%% BEGIN DOCUMENT
> \begin{document}
>
>
> %%% FRONT MATTER
> \frontmatter
> %
> %%% Cover
> \pagestyle{empty}
> \thistitle
> \clearpage
>
> %%% Copyright page
> \null\vfill
> \begin{flushleft}
>  \textit{Algebra in Context: Introductory Algebra from Origins to Applications}
>
>
>  ISBN--INFO
>
>  ISBN--13:
>
>  \bigskip
> \end{flushleft}
> \clearpage
>
>
> \setcounter{tocdepth}{2}
> \tableofcontents
>
> %%% Introduction and Preface
> \setcounter{page}{1}
> \include{fm_intro}
> \include{fm_preface}
> \cleardoublepage
>
>
> %%% MAIN MATTER
> \mainmatter
>
>
> \include{pt_numsys}
>
>
> % Bibliography
> \nocite{*}
> \bibliographystyle{plain}
> \bibliography{aic_main}
>
> \end{document}
>
> ----------------------------------end----------------------------------
>
>
>> Message: 4
>> Date: Sat, 1 Feb 2014 09:23:34 -0800
>> From: "John B. Thoo" <jthoo at yccd.edu>
>> To: <macosx-tex at email.esm.psu.edu>
>> Subject: Re: [OS X TeX] Writing a book
>> Message-ID: <EFE64E80-61BD-4407-9DB6-CBCFE853403A at yccd.edu>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Hello.  I'd like to thank everyone who responded.  You are all very generous.  I'm sorry for not acknowledging each of you individually yet. I'd like to read through each response carefully first.  There's a lot for me to take in, but I am grateful for all your advice.  Thank you all again.
>>
>> ---John.
>>
>> (I receive the digest of this mailing list.)
>>
>>
>> On Jan 30, 2014, at 12:00 PM, macosx-tex-request at email.esm.psu.edu wrote:
>>
>>> Message: 1
>>> Date: Thu, 30 Jan 2014 06:05:44 -0800
>>> From: "John B. Thoo" <jthoo at yccd.edu>
>>> To: TeX on Mac OS X Mailing List <MacOSX-TeX at email.esm.psu.edu>
>>> Subject: [OS X TeX] Writing a book
>>> Message-ID: <EC291215-C82A-44E8-9251-A1206791A559 at yccd.edu>
>>> Content-Type: text/plain; charset="us-ascii"
>>>
>>> Hello, everyone.
>>>
>>> This is not directly a Mac TeX question, so I hope you will forgive me for asking here.
>>>
>>> A friend and I are working on a book.  I've written it using
>>>
>>> \documentclass[11pt]{amsbook}
>>> \usepackage[utf8]{inputenc}
>>> \usepackage[T1]{fontenc}
>>>
>>>
>>> It turns out that the publisher does not work with (La)TeX and, unfortunately, my LaTeX skills are very basic.  (E.g., I kludged the exercise sections using the enumerate environ.  I wish I knew a better way to include exercises so that they would be better formatted and particular exercises would be easier to reference from the text.)  My friend, thus, raised the following concern.
>>>
>>> "So the book would look exactly like how it types sets for you. So it would look like a very long article. To get different color, size and style fonts for things like section tiles, text to wrap around images, sidebars, and all the other things that make a text book look appealing, we would need to do it in Word. so the question is do we stick with what we have because it is almost done and you have put sooooo much time into the Tex, or switch to Word so it can look like other texts?"
>>>
>>> Now, I don't use Word.  I don't even have a copy of Word.  My question is, can my friend's concerns be addressed using LaTeX and, if so, where do you suggest I learn how to do it?
>>>
>>> Here is a draft that shows what the book format looks like now.
>>>
>>> <http://ms.yccd.edu/Data/Sites/1/userfiles/facstaff/jthoo/cvandpubs/books/imh_dft20130913.pdf>  (77 MB)
>>>
>>> I am still using TeX Live 2012 in XQaurtz.  (I type in vi.)  I should upgrade to the latest.
>>>
>>> Thanks very much in anticipation for your advice.
>>>
>>> Yours sincerely,
>>>
>>> ---John.
>>>
>>> (I receive the digest of this mailing list.)