"Best practices" for adjusting pdf output

123 Aufrufe
Direkt zur ersten ungelesenen Nachricht

kcri...@gmail.com

ungelesen,
30.05.2023, 16:49:0730.05.23
an PreTeXt support
I've seen a number of references over time to people doing adjustments to their pdf to make it look (even) better - it seems largely to ensure page breaks "looking nice"?  Perhaps also for other reasons.

Unfortunately, the publisher guide only has some fairly generic advice.
"Having said all that, you may find it necessary to manually adjust a file to control widows or orphans, or maybe the placement of a graphics file, or similar adjustments."

I'd be happy to collate an additional paragraph or two of information there about where to look for advice in doing so (and what things are worth bothering about), if authors who have experience doing so can reply here.  (Then I can use those tips myself, too.)  After all, while it's nice to maintain the distinction between publisher and author, in reality many (most? all?) PTX authors are also publishers now, but don't have as much experience massaging LaTeX for this purpose.  I know that I don't.  Thanks!

kcri...@gmail.com

ungelesen,
01.06.2023, 14:41:5701.06.23
an PreTeXt support
Or, to be more blunt as a support message, "What specific LaTeX commands are best in order to change page breaks in pdf output?"  I have instances where I would like to start a new page early (such as introduction to bullets being on page immediately previous to bullets) or ensure things stay on a page (proof that just is moved to the next page, presumably due to the tcolorbox business).  But my initial offer stands and is, I think, something authors would find useful.

Rob Beezer

ungelesen,
01.06.2023, 19:33:4801.06.23
an pretext...@googlegroups.com
I knew I owed you something else. With the proviso that I've not really done
this myself...

I imagine inserting \newpage strategically. And saving them on a git branch, in
hopes that next year's LaTeX won't be too different and the branch
rebases/merges without too many mysterious conflicts.

And moving floats between paragraphs to get better breaks (though you could do
this in source).

But working through some unrelated numbering stuff, I realized - move a float (a
"figure" say) too far (past a "theorem" say) and the numbers will change, since
(mostly) our LaTeX lets LaTeX do the numbering. And maybe it is worse if we
hardcode *all* the PreTeXt numbers into the LaTeX file...

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/32166962-9451-4302-ae9f-fb718cec45e7n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/32166962-9451-4302-ae9f-fb718cec45e7n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

ungelesen,
02.06.2023, 14:50:4402.06.23
an pretext...@googlegroups.com
And I should have added: having some concrete suggestions will be a nice
addition. So I hope others (Sean F, Michael D?), who have thought about this
more, will contribute some techniques.

Rob

Sean Fitzpatrick

ungelesen,
02.06.2023, 15:18:2202.06.23
an PreTeXt support
I will be experimenting soon to see what works best for restoring changes when you rebuild the .tex file from PreTeXt source.

In the past I tried:
1. Build the .tex file
2. Commit to git
3. Do whatever hand-editing is needed
4. Commit changes to git, on a branch (I think you want/need a branch at this step)
5. Edit your book in PreTeXt
6. Rebuild the .tex file
7. Apply your git commit to the new file to re-do the hand editing.

This works OK, but if this is something you do once per year, there is the risk that some of the LaTeX templates changed significantly since the last time you built.
When that happens, git doesn't always figure out where the changes are supposed to go.

The other option, which requires more manual effort, is to use a diff tool like Meld.

Alex Jordan

ungelesen,
02.06.2023, 18:02:4602.06.23
an pretext...@googlegroups.com
In past rounds of finalizing ORCCAs PDF, I have written a script where it applies targeted search and replace. For example if I want a \newline right before some paragraph and that paragraph has uniquely identifiable text or some unique something about it, I can enter that search and replace line into the script.

I do this, generate output as a new secondary tex file, run latex, read (scan) from the beginning and look for the next issue. Repeat.

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/23625441-a462-446e-b6f3-5b6fd43f9c06n%40googlegroups.com.

kcri...@gmail.com

ungelesen,
03.06.2023, 09:10:0403.06.23
an PreTeXt support
Thanks, Alex and Sean, those are a good start toward suggestions on the file management side.  I imagine you do more than put in "\newpage", though - and there is also \clearpage or something like that, right?  Under what circumstances do you use each of those, or other commands?  I think that even having a terse list of a few commands that (help) solve common problems in tex source would be helpful to authors - they can search up what those things do online or by trial and error.

Alex Jordan

ungelesen,
03.06.2023, 11:44:5803.06.23
an pretext...@googlegroups.com
My last run included the following. Current XSLT may already make some of this unnecessary.

First there are some global search-and-replace. Then there are targeted ones, many of which use a permid (like UqM) to target the line to edit. But permids are no more, so a different strategy would be needed.

echo 'DO NOT INDENT IN SOME PLACES'; \
perl -p0i -e 's/(\\end{inlineexercise}\n)(\w)/\1\\noindent \2/g' orcca.tex; \
perl -p0i -e 's/(\\end{example}\n)(\w)/\1\\noindent \2/g' orcca.tex; \
perl -p0i -e 's/(\\end{figure}\n)(\w)/\1\\noindent \2/g' orcca.tex; \
perl -p0i -e 's/(\\end{sidebyside}%\n\\par\n)(\w)/\1\\noindent \2/g' orcca.tex; \
echo 'GLOBAL SPACING'; \
echo 'Next line removes \leavevmode when it comes right before an enumerate'; \
perl -p0i -e 's/\\leavevmode%\n(\\begin{enumerate})/\1/g' orcca.tex; \
echo 'Next line removes \leavevmode when it comes right before a multicols'; \
perl -p0i -e 's/\\leavevmode%\n(\\begin{multicols})/\1/g' orcca.tex; \
echo 'Next line removes \par when it comes right before an equation'; \
perl -p0i -e 's/\\par\n(%\n\\begin\{equation)/\1/g' orcca.tex; \
echo 'Next two lines attempt to prevent pagebreaks after an "Explanation" title; not always with success'; \
perl -p0i -e 's/(\\noindent\\textbf\{Explanation\}.*?\n(((?!\\begin).)*?\n)*?)(.*\\par)/\\makeatletter\\\@beginparpenalty=10000\\makeatother\n\1\\makeatletter\\\@beginparpenalty=-51\\makeatother\n\4/g' orcca.tex; \
perl -p0i -e 's/(\\noindent\\textbf\{Explanation\}.*?\n(((?!\\par).)*?\n)*?\\end(?!({tikzpicture}|{aligned}|{alignedat})).*?\n)/\\makeatletter\\\@beginparpenalty=10000\\makeatother\n\1\\makeatletter\\\@beginparpenalty=-51\\makeatother\n/g' orcca.tex; \
echo 'Next line attempts to prevent pagebreaks after an "Exercises" starts; not always with success'; \
perl -p0i -e 's/(\\begin\{exercises-subsection\}\{Exercises\}.*?\n(.*?\n)*?\\end\{divisionexercise\}%\n)/\\makeatletter\\\@beginparpenalty=10000\\makeatother\n\1\\makeatletter\\\@beginparpenalty=-51\\makeatother\n/g' orcca.tex; \
echo 'Next two lines look for a list in an exercise where the exercise starts, and gets first line to start on exercise opening line'; \
perl -p0i -e 's/^(\\begin{divisionexerciseegcol}.*?\n\\begin{enumerate)(}\[label=\\alph\*\.)(\]\n)((.*?\n)*?\\end{enumerate)}/\1\*\2,itemjoin=\{\\vspace\{0\.5pc\}\\newline\},afterlabel=\{\\hspace\{1ex\}\}\3\4\*}\\vspace{0.5pc}\n\n/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseegcol}.*?\n\\hypertarget{.*?}\{\}%\n\\begin{enumerate)(}\[label=\\alph\*\.)(\]\n)((.*?\n)*?\\end{enumerate)}/\1\*\2,itemjoin=\{\\vspace\{0\.5pc\}\\newline\},afterlabel=\{\\hspace\{1ex\}\}\3\4\*}\\vspace{0.5pc}\n\n/gm' orcca.tex; \
echo 'IMAGE WIDTH ADJUSTMENT'; \
echo 'WeBWorK images in a multicolumn list or exercisegroup need these sizing adjustments, effectively resizing them to 100%. The for loops are just to make the regex search and replace repeat enough times to hit all instances within a list or exerisegroup'; \
for i in {1..3}; do perl -p0i -e 's/^(\\begin{inlineexercise}.*?(((?!inlineexercise).)*\n)*?\\begin{multicols}\{3\}\n(((?!multicols).)*\n)*?\\begin{sidebyside}\{1\})\{0\.3\}\{0\.3\}\{0\}%\n(\\begin{sbspanel})\{0\.4\}/\1\{0\}\{0\}\{0\}%\n\6\{1\}/gm' orcca.tex; done; \
for i in {1..6}; do perl -p0i -e 's/^(\\begin{exercisegroup}\n(((?!exercisegroup).)*\n)*?\\begin{sidebyside}\{1\})\{0\.3\}\{0\.3\}\{0\}%\n(\\begin{sbspanel})\{0\.4\}/\1\{0\}\{0\}\{0\}%\n\4\{1\}/gm' orcca.tex; done; \
for i in {1..28}; do perl -p0i -e 's/^(\\begin{exercisegroupcol}\{[234]\}\n(((?!exercisegroup).)*\n)*?\\begin{sidebyside}\{1\})\{0\.3\}\{0\.3\}\{0\}%\n(\\begin{sbspanel})\{0\.4\}/\1\{0\}\{0\}\{0\}%\n\4\{1\}/gm' orcca.tex; done; \
perl -p0i -e 's/^(The pie chart represents a collector.s collection of signatures from various artists.%\n\\begin{sidebyside}\{1\}){0\.166666666666667}{0\.166666666666667}\{0\}%\n\\begin{sbspanel}{0\.666666666666667}/\1\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}/gm' orcca.tex; \
perl -p0i -e 's/^((The pie chart .* artists.|The following is a nutrition .* box.|A community college .* the survey.)%\n\\begin{sidebyside}\{1\}){0\.166666666666667}{0\.166666666666667}\{0\}%\n\\begin{sbspanel}{0\.666666666666667}/\1\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}/gm' orcca.tex; \
echo 'SYSTEMS OF EQUATIONS IN DISPLAY MODE'; \
for i in {1..20}; do perl -p0i -e 's/^(\\textbf{Using a Graph to Solve a System}\\space\\space%\nUse a graph to solve the system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
for i in {1..50}; do perl -p0i -e 's/^(\\textbf{Solving System of Equations Using Substitution}\\space\\space%\nSolve the following system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
for i in {1..32}; do perl -p0i -e 's/^(\\textbf{Solving System of Equations by Elimination}\\space\\space%\nSolve the following system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
for i in {1..8}; do perl -p0i -e 's/^(\\textbf{Solving Systems of Linear Equations by Graphing}\\space\\space%\nUse a graph to solve the system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
for i in {1..8}; do perl -p0i -e 's/^(\\textbf{Substitution}\\space\\space%\nSolve the following system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
for i in {1..8}; do perl -p0i -e 's/^(\\textbf{Elimination}\\space\\space%\nSolve the following system of equations.%\n\\begin{exercisegroupcol}\{\d\}\n(.*?\n)*?\\begin{divisionexerciseegcol}.*?\n(.*?\n)*?)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*})/\1\\begin{fleqn}\[1em\]\n\\leavevmode\\vspace\*\{-\\dimexpr\\baselineskip\+\\abovedisplayskip\\relax}\4\\end{fleqn}\\newline/m' orcca.tex; done; \
perl -p0i -e 's/^(\\begin{example}[^\n]*?example:VQz}%\n.*?\n.*?\n.*?\n)(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*}\n)%\n\\item\{\}%\n(\\begin{equation\*}\n(.*?\n)*?\\end{equation\*}\n)/\1\\begin{fleqn}\[1em\]\n\2\\end{fleqn}\n%\n\\item\{\}%\n\\begin{fleqn}\[1em\]\n\4\\end{fleqn}\n/m' orcca.tex; \
echo 'INDIVIDUAL INSERTIONS'; \
echo 'Insert a \par following an aside, before a sidebyside'; \
perl -pi -e 's/(\{Figure\~\\ref\{x:figure:figure-balance-scale\}\} shows the scale\.\%\n)/\1\\par\n/' orcca.tex; \
echo 'Insert a \par following the last reading question which follows an aside from pages earlier causing problems'; \
perl -p0i -e 's/(Every time you solve an equation, there is something you should do to guarantee success\. Describe what that thing is that you should do\.%\n\\end{divisionexercise}%\n)/\1\\par\n/' orcca.tex; \
echo 'Insert a \par following an aside that is causing problems'; \
perl -pi -e 's/(If Carl has an out-of-town guest who asks him how to get to the restaurant, Carl could say:%)/\\par\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseegcol}\{\d+\}\{\}\{\}{p:exercise:KFJ}%\nLocate each point in the graph:%\n\\begin{sidebyside}\{1\})\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n/\1\{0.05\}\{0.05\}\{0\}%\n\\begin{sbspanel}\{0.9\}/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseegcol}\{\d+\}\{\}\{\}{p:exercise:qMS}%\nLocate each point in the graph:%\n\\begin{sidebyside}\{1\})\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n/\1\{0.05\}\{0.05\}\{0\}%\n\\begin{sbspanel}\{0.9\}/m' orcca.tex; \
perl -p0i -e 's/^(\\textbf{Domain and Range From a Graph}\\space\\space%\nA function is graphed.)(%\n\\begin{exercisegroupcol}\{3\}\n\\begin{divisionexerciseegcol}\{9\}\{\}\{\}{p:exercise:ruz}%)/\1 Find its domain and range\.\2/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{exercises-subsection}{Exercises}\{\}{Exercises}\{\}\{\}{p:exercises:iFU}\n.*?\n.*?\nA function is graphed\.)/\1 Find its domain and range\./m' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:fdz}%\n.*?\n\\begin{sidebyside})\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:LkI}%\n.*?\n\\begin{sidebyside})\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:rrR}%\n.*?\n\\begin{sidebyside})\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:Xza}%\n.*?\n\\begin{sidebyside})\{1\}\{0\.3\}\{0\.3\}\{0\}%\n\\begin{sbspanel}\{0\.4\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\.3\}\{0\.3\}\{0\}%\n\\begin{sbspanel}\{0\.4\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:lOV}%\n.*?\n\\begin{sidebyside})\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(\\begin{divisionexerciseeg}\{\d+\}\{\}\{\}{p:exercise:RWe}%\n.*?\n\\begin{sidebyside})\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n)\\end{sidebyside}%\n\\begin{sidebyside}\{1\}\{0\}\{0\}\{0\}%\n\\begin{sbspanel}\{1\}%\n(\\includegraphics\[width=1\\linewidth\]{images\/webwork-.*?png}\n\\end{sbspanel}%\n\\end{sidebyside}%\n)/\1\{2\}\{0.12\}\{0.12\}\{0.12\}%\n\\begin{sbspanel}\{0.32\}%\n\2\\begin{sbspanel}\{0.32\}%\n\3/gm' orcca.tex; \
perl -p0i -e 's/^(A function is graphed.)(%\n\\begin{exercisegroupcol}\{3\}\n\\begin{divisionexerciseegcol}\{21\}\{\}\{\}{p:exercise:gTd}%)/\1 Find its domain.\2/m' orcca.tex; \
echo 'INDIVIDUAL PAGE BREAKS'; \
echo 'CHAPTER 1'; \
echo 'SECTION 1.1'; \
perl -p0i -e 's/^(.*:UqM.*?\n(.*?\n)*?)(\\noindent\\textbf{Explanation})/\1\\newpage%\n\3/m' orcca.tex; \
perl -pi -e 's/(^\\begin{exercises-subsection}.*?:hKx)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 1.2'; \
perl -pi -e 's/(\\begin{example}\{\}{x:example:example-combining-like-terms}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/(\\begin{example}\{\}{p:example:XHm}%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:xZj)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 1.3'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?:xbu)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(\\hrulefill\\\\%\n.*?\n.*?\n.*?:DAA}%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 1.4'; \
perl -pi -e 's/(The following are some linear equations in one variable:%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\begin{inlineexercise}\{\}{p:exercise:yin}%\n(.*?\n)*?)(\\noindent\\textbf{Explanation})/\1\\newpage%\n\2/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?:nJi)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 1.5'; \
perl -pi -e 's/(^\\begin\{example\}\{\}\{x:example:example-one-step-equation-fraction-type-one\}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/(\\begin{example}\{\}{p:example:CyD}%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 1.7'; \
perl -pi -e 's/(\\begin{inlineexercise}\{\}{p:exercise:mST}%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 1.8'; \
echo 'CHAPTER 2'; \
echo 'SECTION 2.1'; \
perl -pi -e 's/(\\begin{inlineexercise}\{\}{p:exercise:ggs}%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(Here we revisit \\hyperref\[x:example:example-savings-pattern\]{Example~\\ref{x:example:example-savings-pattern\}\}\.%\n\\par\nA savings account starts with \\\(\\\$500\\\)\. Each month, an automatic deposit of \\\(\\\$150\\\) is made. Find the number of months it will take for the balance to reach \\\(\\\$1\{,\}700\\\)\.%\n\\par\\smallskip%\n)/\1\\newpage%\n/m' orcca.tex; \
perl -pi -e 's/^(\\noindent Here is a summary collection of the distinctions that you should understand between simplifying expressions, evaluating expressions and solving equations.%)/\1\n\\newpage%/' orcca.tex; \
perl -p0i -e 's/^(A savings account starts with \\\(\\\$500\\\)\. Each month, an automatic deposit of \\\(\\\$150\\\) is made\. Find.*?\n\\par\\smallskip%\n)/\1\\newpage%\n/m' orcca.tex; \
echo 'SECTION 2.2'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:JOH)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 2.3'; \
perl -pi -e 's/(\\noindent\\textbf{Explanation}.*Assume Bao)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 2.4'; \
perl -p0i -e 's/(\\begin{namedlist}\n\\captionof{namedlistcap}{Special Solution Sets for Equations and Inequalities\\label{x:list:list-special-solution-sets}})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 2.5'; \
perl -p0i -e 's/^(\\begin{example}\{\}{x:example:example-solve-for-variable-slope-intercept}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:Xlj})/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{inlineexercise}\{\}{x:exercise:exercise-solve-for-variable-standard-form}%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?\n.*?\n.*?exercises:dvU)/\\newpage%\n\1/m' orcca.tex; \
echo 'CHAPTER 3'; \
echo 'SECTION 3.1'; \
perl -p0i -e 's/^(\\begin{reading-questions-subsection-numberless}{Reading Questions}\{\}{Reading Questions}\{\}\{\}{.*?}\n\\begin{divisionexercise}\{1\}\{\}\{\}{.*?}%\nWhat are the coordinates of the gas station in the map of Carl.s neighborhood\?%)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 3.2'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:RHS)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 3.3'; \
perl -pi -e 's/^(\\begin{inlineexercise}\{\}{p:exercise:EYb}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{inlineexercise}\{\}{p:exercise:bQC}%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 3.4'; \
perl -pi -e 's/(.*?example:uFj)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/(.*?exercise:XRM)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 3.5'; \
perl -pi -e 's/(.*?example:gBr)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{.*?}\{\}\quad\{\}Do your best to identify two points on the line. We go with \\\(\(0,27500\)\\\) and \\\(\(11000,45000\)\\text\{\.\}\\\)%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 3.6'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:WRk)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:Ohs)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 3.7'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:zcU)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -pi -e 's/^(.*?p:exercises:PMK})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 3.8'; \
perl -pi -e 's/(.*?example:sSa)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{.*?}\{\}\\quad\{\}First, we will find Line \\\(A\\\).s slope by rewriting its equation from standard form to slope-intercept form:%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:PjY)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 3.10'; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:OrR}\{\}\\quad\{\}\\leavevmode%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:aGj}\{\}\\quad\{\}\\leavevmode%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:GNs}\{\}\\quad\{\}\\leavevmode%)/\\newpage%\n\1/' orcca.tex; \
echo 'CHAPTER 4'; \
echo 'SECTION 4.1'; \
perl -p0i -e 's/(\\begin{namedlist}\n\\captionof{namedlistcap}{A summary of the three types of systems of equations and their solution sets\.\\label{x:list:list-summary-of-types-of-systems}})/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?exercise:ysn)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 4.2'; \
perl -pi -e 's/(.*?exercise:lJw)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/(.*?example:ULl)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{.*?}\{\}\\quad\{\}If an equation involves fractions, it is helpful to clear denominators by multiplying both sides of the equation by a common multiple of the denominators.%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(Lastly, we can determine the value of \\\(v\\\) by using the earlier equation where we isolated \\\(v\\\):%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(And then substitute \\\(s\\\) in the second equation with \\\(600-v\\\):%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:qHK)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 4.3'; \
perl -pi -e 's/(To check our work, substitute \\\(A=560\\\) and \\\(B=440\\\) into the original equations:%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(To solve for \\\(y\\\), we can substitute \\\(2\\\) for \\\(x\\\) into either of the original equations or the new one\. We use the first original equation, \\\(3x-4y=2\\\):%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent To summarize, if a variable is already isolated or has a coefficient of \\\(1\\\), consider using the substitution method\. If both equations are in standard form or none of the coefficients are equal to \\\(1\\\), we suggest using the elimination method\. Either way, if you have fraction or decimal coefficients, it may help to scale your equations so that only integer coefficients remain.%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 5.1'; \
perl -p0i -e 's/^(\\hrulefill\\\\%\n.*?\n.*?\n.*?p:exercise:bzu)/\\newpage%\n\\noindent\1/m' orcca.tex; \
echo 'SECTION 5.2'; \
perl -p0i -e 's/^(\\begin{namedlist}\n\\captionof{namedlistcap}{Summary of the Rules of Exponents for Multiplication\\label{x:list:list-rules-of-exponents}})/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 5.3'; \
perl -p0i -e 's/^(\\begin{namedlist}\n\\captionof{namedlistcap}{Summary of the Rules of Exponents \(Thus Far\)\\label{x:list:list-rules-of-exponents-four-rules}})/\\newpage%\n\1/m' orcca.tex; \
perl -p0i -e 's/^(where \\\(m\\\) is the object.s mass, and \\\(V\\\) is its volume\. The mass of a certain cancerous growth can be modeled by \\\(4t\^3-6t\^2\+8t\\\) grams, where \\\(t\\\) is the number of days since the growth began\. If its volume is \\\(2t\\\) cubic centimeters, find the growth.s density\.%\n\\par\\smallskip%\n)/\1\\newpage%\n/m' orcca.tex; \
echo 'SECTION 5.4'; \
perl -pi -e 's/^(To finish multiplying, we.ll continue by distributing again, but this time across \\\(\(x+3\)\\\):%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 5.5'; \
perl -p0i -e 's/^(\\begin{inlineexercise}.*?\nExpand \\\(\(2y-6\)\^3\\text\{\.\}\\\)%)/\\newpage%\n\1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:goW)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 5.7'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:snB)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:vSb)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 6.1'; \
perl -p0i -e 's/^(\\begin{inlineexercise}\{\}{p:exercise:ALy}%\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n\\end{multicols}\n)/\1\\newpage%\n/m' orcca.tex; \
echo 'SECTION 6.3'; \
perl -pi -e 's/^(\\begin{remark}\{\}{x:remark:remark-two-representations-of-rational-exponents}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{example}\{\}{p:example:SaN}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{subsectionptx}{More Expressions with Rational Exponents}\{\}{More Expressions with Rational Exponents}\{\}\{\}{p:subsection:QlA})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 6.4'; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:KkT)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{divisionexerciseegcol}\{50\}\{\}\{\}{p:exercise:vMx}%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\textbf{Solving Radical Equations with Variables}.*?\n.*?\n.*?p:exercise:DLN)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 6.5'; \
perl -pi -e 's/^(\\begin{example}{More Expressions with Rational Exponents\.}{p:example:XFm}%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 7.1'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:Yhh)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 8.3'; \
perl -pi -e 's/^(\\begin{subsectionptx}{Summary}\{\}{Summary}\{\}\{\}{x:subsection:subsection-list-of-geometry-formulas})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 8.3'; \
perl -p0i -e 's/^(\\hrulefill\\\\%\n.*?\n.*?\n\\begin{divisionexerciseegcol}\{29\}\{\}\{\}{p:exercise:rSy}%)/\\newpage%\n\\noindent\1/m' orcca.tex; \
echo 'SECTION 8.5'; \
perl -p0i -e 's/^(\\begin{exercises-subsection}.*?\n.*?\n.*?\n.*?\n\\begin{divisionexerciseegcol}\{1\}\{\}\{\}{p:exercise:WFP}%)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 9.1'; \
perl -p0i -e 's/^(\\textbf{Tables for Equations}.*?\nMake a table for the equation.%\n\\begin{exercisegroupcol}\{2\}\n\\begin{divisionexerciseegcol}\{5\}\{\}\{\}{g:exercise:)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 9.2'; \
perl -pi -e 's/^(\\begin{example}{}{p:example:olh}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(.*?p:solution:TBs)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\textbf{Algebraically Determining the Vertex and Axis of Symmetry of Quadratic Functions}\\space\\space%\nFind the axis of symmetry and vertex of the quadratic )function.%/\\newpage%\n\\noindent \1equation\.%/m' orcca.tex; \
echo 'SECTION 9.3'; \
perl -pi -e 's/^(\\item\{\}To determine the horizontal intercepts, we.ll solve \\\(H=0\\\)\.%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 9.4'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?\n.*?This region is highlighted in \\hyperref\[x:figure:figure-parabola-line-inequality\])/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 10.7'; \
echo 'SECTION 10.8'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:KMR)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 12.3'; \
perl -pi -e 's/^(\\begin{divisionexerciseeg}\{98\}\{\}\{\}{p:exercise:AuZ}%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 12.1'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?p:exercise:zbl)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 12.2'; \
perl -pi -e 's/^(\\begin{exercises-subsection}{Exercises}\{\}{Exercises}\{\}\{\}{p:exercises:maM})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 12.5'; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:ECt})/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:oJB)/\\newpage%\n\1/m' orcca.tex; \
perl -pi -e 's/^(\\begin{divisionexerciseeg}\{19\}\{\}\{\}{p:exercise:lOV}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(.*?solution:jlT)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?p:exercise:fdz}%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?p:exercise:ciT}%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 12.2'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?p:exercise:SJh)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 12.5'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?p:exercise:NIp)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 13.4'; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:CCY)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 13.6'; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:TME)/\\newpage%\n\\noindent\1/m' orcca.tex; \
echo 'SECTION 13.1'; \
perl -pi -e 's/^(\\noindent.*solution:izz)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\begin{example}\{\}{g:example:.*?}%\nFind the slope and vertical intercept of \\\(y=h\(x\)\\\), where \\\(h\(x\)=\\frac\{5\}\{3\}x-4\\\)\.)/\\newpage%\n\1/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{inlineexercise}.*?\nFind the \\\(y\\\)-intercept and \\\(x\\\)-intercept of the line given by the equation\. If a particular intercept does not exist, enter \\mono{none} into all the answer blanks for that row\.%\n%\n\\begin{equation\*}\n2 x + 5 y = -20)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 13.2'; \
perl -p0i -e 's/^(\\hrulefill.*?\n.*?\n.*?\n.*?p:exercise:YvT}%)/\\newpage%\n\\noindent\1/m' orcca.tex; \
perl -pi -e 's/^(\\noindent Let.s look at another graph\. Let \\\(h\(x\)=-x\^2\\\) and let \\\(j\(x\)=-\(x+3\)\^2+4\\\)\.%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:zjp)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:tud)/\\newpage%\n\\noindent \1/m' orcca.tex; \
echo 'SECTION 13.4'; \
perl -pi -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{p:solution:wSm})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 13.5'; \
perl -pi -e 's/^(\\noindent.*?solution:zIF)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{exercises-subsection}{Exercises}\{\}{Exercises}\{\}\{\}{p:exercises:fBt})/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 13.5'; \
perl -p0i -e 's/^(\\noindent\\textbf{Explanation}\.\\hypertarget{g.*?\n.*?\n.*?\nThe specifics of how to use any one particular technology)/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 13.7'; \
perl -p0i -e 's/^(\\noindent Let.s turn to an example involving a linear equation.%\n\\begin{example}.*?\nSolve the inequality \\\(3x-2\\lt7\\\) graphically\.%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{example}.*?\nTo graphically solve the inequality \\\(\\abs{x-1} \\gt 3\\\) would mean looking for the \\\(x\\\)-values where the graph of \\\(y=\\abs{x-1}\\\) is \\emph{above} the line \\\(y=3\\\)\.%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -pi -e 's/^(\\noindent Solving inequalities with quadratic expressions graphically is very similar to solving absolute value inequalities graphically.%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\item\{\}To now solve \\\(42\(x-2\)\^2-60 \\lt 21x-39\\\),)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\noindent\\textbf{Explanation}.*?\n\\begin{sidebyside}.*?\n\\begin{sbspanel}\{0.47\}%\nTo solve the inequality \\\(2\\le f\(x\) \\lt 6\\\))/\\newpage%\n\1/m' orcca.tex; \
echo 'SECTION 13.8'; \
perl -p0i -e 's/^(\\begin{example}{Graphing Lines Using Intercepts.}.*?\nUse the intercepts of \\\(4x-2y=16\\\) to graph the equation\.%)/\\newpage%\n\1/m' orcca.tex; \
perl -p0i -e 's/^(\\item\{\}\\leavevmode%\n\\begin{sidebyside}.*?\n\\begin{sbspanel}{0\.47}%\nThe solutions are all \\\(x\\\)-values where)/\\newpage%\n\1/m' orcca.tex; \
echo 'APPENDIX'; \
perl -p0i -e 's/^(\\begin{inlineexercise[^\n]*?:VDr}%\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n.*?\n)/\1\\newpage%\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{inlineexercise.*exercise:LKP}%\n.*?\n.*?\n)/\1\\newpage%\n/m' orcca.tex; \
perl -pi -e 's/(\\begin{divisionexerciseeg}{\d+}{}{}{p:exercise:zKS}%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{inlineexercise}\{\}{p:exercise:FpW}%)/\\newpage%\n\1/' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?exercise:CJL}%)/\\newpage%\n\1/m' orcca.tex; \
perl -p0i -e 's/^(.*?\n.*?\n.*?\n.*?exercise:FNi}%)/\\newpage%\n\\noindent \1/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{sidebyside}.*?\n.*?\n.*?\n.*?\n.*?\n{Units of Area)/\\newpage%\n\\noindent\1/m' orcca.tex; \
echo 'INDIVIDUAL CUTTING'; \
echo 'SECTION 1.3'; \
perl -pi -e 's/^In .*? notation: +\\fillin{\d+}%\n//g' orcca.tex; \
echo 'SECTION 1.6'; \
perl -p0i -e 's/\\par\nIn .*? notation, the solution set is +\\fillin{\d+}\.%\n//g' orcca.tex; \
echo 'SECTION 2.2'; \
perl -pi -e 's/^ *\\fillin\{10\}  \\fillin\{2\}  \\fillin\{10\}%//g' orcca.tex; \
echo 'SECTION 3.6'; \
perl -pi -e 's/^An equation for this line in.*\\fillin{\d+}\.%\n//g' orcca.tex; \
perl -pi -e 's/^In slope-intercept form:  \\fillin\{20\}%\n//g' orcca.tex; \
echo 'SECTION 9.1'; \
perl -p0i -e 's/^(Axis of symmetry:  \\fillin{\d+}%\n\\par\nVertex:  \\fillin{\d+}%\n)//gm' orcca.tex; \
echo 'SECTION 9.2'; \
perl -p0i -e 's/^(\\\(y\\\)-intercept:  \\fillin{\d+}%\n\\par\n\\\(x\\\)-intercept\(s\):  \\fillin{\d+}%\n)//gm' orcca.tex; \
echo 'SECTION 9.3'; \
perl -pi -e 's/^(\\noindent If we are solving graphically and something is already providing you with the graph, it.s not even necessary to have math expressions for the two curves\.%)/\\newpage%\n\1/' orcca.tex; \
perl -pi -e 's/^(\\noindent Occasionally, a curve abruptly ..stops.., and we need to recognize this in a solution to an inequality\.%)/\\newpage%\n\1/' orcca.tex; \
echo 'SECTION 12.1'; \
perl -pi -e 's/^Interpretation:%$/%/g' orcca.tex; \
echo 'SECTION 12.2'; \
perl -p0i -e 's/\\par\n\\noindent In .*? notation: +\\fillin{\d+}%\n//g' orcca.tex; \
perl -p0i -e 's/^((This|The) function has domain  \\fillin\{\d+\} and range  \\fillin\{\d+\}\.%\n)//gm' orcca.tex; \
echo 'SECTION 13.1'; \
perl -p0i -e 's/^What is its domain\?%\n//gm' orcca.tex; \
perl -p0i -e 's/^(The domain of \\\(.\\\) is  \\fillin{\d+}%\n\\par\nThe range of \\\(.\\\) is  \\fillin{\d+}%\n)//gm' orcca.tex; \
echo 'REMOVE ALL ANSWER BLANKS AND EQUALS SIGNS THAT ARE IN SHORT LINES LIKE 1+2=___ '; \
perl -p0i -e 's/^(\\\(((?!(\\\)|text)).)*) *=([ \n}]*\\\)) *\\fillin{\d+} *\.?%\n/\1\4%\n/gm' orcca.tex; \
perl -pi -e 's/^(\\item\{\}\\\(((?!(\\\)|text)).)*) *=([ }]*\\\)) *\\fillin{\d+} *\.?%\n/\1\4%\n/g' orcca.tex; \
perl -pi -e 's/^(\\\(((?!(\\\)|text)).)*\\\)) *= *\\fillin{\d+} *\.?%\n/\1%\n/g' orcca.tex; \
perl -pi -e 's/^(\\item\{\}\\\(((?!(\\\)|text)).)*\\\)) *= *\\fillin{\d+} *\.?%\n/\1%\n/g' orcca.tex; \
perl -pi -e 's/^(\\\(((?!(\\\)|text)).)*) *=\{\}([ }]*\\\)) *\\fillin\{\d+\} *\.?%\n/\1\4%\n/g' orcca.tex; \
perl -pi -e 's/^(\\\(((?!(\\\)|text)).)*) *\\approx([ }]*\\\)) *\\fillin{\d+} *\.?%\n/\1\4%\n/g' orcca.tex; \
perl -p0i -e 's/^(\\\(((?!(\\\)|text)).)*) *\\approx([ \n}]*\\\)) *\\fillin{\d+} *\.?%\n/\1\4%\n/gm' orcca.tex; \
perl -pi -e 's/^(\\item\{\}\\\(((?!(\\\)|text)).)*) *\\approx([ }]*\\\)) *\\fillin{\d+} *\.?%\n/\1\4%\n/g' orcca.tex; \
perl -pi -e 's/^(\\\(((?!(\\\)|text)).)*\\\)) *\\approx *\\fillin{\d+} *\.?%\n/\1%\n/g' orcca.tex; \
perl -pi -e 's/^(\\item\{\}\\\(((?!(\\\)|text)).)*\\\)) *\\approx *\\fillin{\d+} *\.?%\n/\1%\n/g' orcca.tex; \
perl -pi -e 's/^(\\\(((?!(\\\)|text)).)*) *\\approx\{\}([ }]*\\\)) *\\fillin\{\d+\} *\.?%\n/\1\4%\n/g' orcca.tex; \
perl -p0i -e 's/^\\\(x\\\)%\n/%\n/gm' orcca.tex; \
echo 'EDGE INDEXING AND PAGE RENUMBERING'; \
perl -pi -e 's/^(\\begin{partptx}{Linear Equations and Lines})/\\xpatchcmd{\\part}{\\thispagestyle{plain}}{\\begin{tikzpicture}\[remember picture,overlay\]\\draw \[color=emerald, fill=emerald\] \(\[xshift=-0.625in\]current page\.north east\) rectangle \(current page\.south east\);\\end{tikzpicture}\\break\\pagenumbering{arabic}\\thispagestyle{plain}}\{\}\{\}\\xpatchcmd{\\\@endpart}{\\vfil\\newpage}{\\vfil\\newpage}\{\}\{\}\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{partptx}{Preparation for STEM})/\\xpatchcmd{\\part}{\\thispagestyle{plain}}{\\begin{tikzpicture}\[remember picture,overlay\]\\draw \[color=turquoise, fill=turquoise\] \(\[xshift=-0.625in\]current page\.north east\) rectangle \(current page\.south east\);\\end{tikzpicture}\\break\\pagenumbering{arabic}\\thispagestyle{plain}}\{\}\{\}\\xpatchcmd{\\\@endpart}{\\vfil\\newpage}{\\vfil\\newpage}\{\}\{\}\n\1/' orcca.tex; \
perl -pi -e 's/^(\\begin{partptx}{Preparation for College Algebra})/\\xpatchcmd{\\part}{\\thispagestyle{plain}}{\\begin{tikzpicture}\[remember picture,overlay\]\\draw \[color=amethyst, fill=amethyst\] \(\[xshift=-0.625in\]current page\.north east\) rectangle \(current page\.south east\);\\end{tikzpicture}\\break\\pagenumbering{arabic}\\thispagestyle{plain}}\{\}\{\}\\xpatchcmd{\\\@endpart}{\\vfil\\newpage}{\\vfil\\newpage}\{\}\{\}\n\1/' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=emerald,   fill=emerald  ] ([xshift=-0.625in] \$$ \(current page.north east\) \$$ ) rectangle ( \$$  \(A\)!1\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=emerald,   fill=emerald  ] ([xshift=-0.625in] \$$  \(A\)!2\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!2\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=emerald,   fill=emerald  ] ([xshift=-0.625in] \$$  \(A\)!3\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!3\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=emerald,   fill=emerald  ] ([xshift=-0.625in] \$$  \(A\)!4\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!4\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=turquoise, fill=turquoise] ([xshift=-0.625in] \$$  \(A\)!5\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!5\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=turquoise, fill=turquoise] ([xshift=-0.625in] \$$  \(A\)!6\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!6\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=turquoise, fill=turquoise] ([xshift=-0.625in] \$$  \(A\)!7\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!7\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=turquoise, fill=turquoise] ([xshift=-0.625in] \$$  \(A\)!8\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!8\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=turquoise, fill=turquoise] ([xshift=-0.625in] \$$  \(A\)!9\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$  \(A\)!9\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=amethyst,  fill=amethyst ] ([xshift=-0.625in] \$$ \(A\)!10\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$ \(A\)!10\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=amethyst,  fill=amethyst ] ([xshift=-0.625in] \$$ \(A\)!11\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$ \(A\)!11\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=amethyst,  fill=amethyst ] ([xshift=-0.625in] \$$ \(A\)!12\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$ \(A\)!12\/13!\(B\)          \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -p0i -e 's/^(\\begin{chapterptx}.*?{x:chapter:[^}]*?})\n/\1\\begin\{tikzpicture\}[remember picture,overlay]\\node \(A\) at ( \$$ (current page.north east) - (0,0.125) \$$ ) \{\}; \\node \(B\) at ( \$$ (current page.south east) + (0,0.125) \$$ ) \{\}; \\draw [color=amethyst,  fill=amethyst ] ([xshift=-0.625in] \$$ \(A\)!13\/13-1\/13!\(B\)    \$$ ) rectangle ( \$$ \(current page.south east\) \$$ );\\end{tikzpicture}\n/m' orcca.tex; \
perl -pi -e 's/^(\\begin{appendixptx}.*?\n)/\\cleardoublepage\n\\pagenumbering{arabic}\n\\renewcommand{\\thepage}{\\thechapter\\arabic{page}}\n\1\\begin{tikzpicture}\[remember picture,overlay\]\\draw \[color=ruby, fill=ruby\] \(\[xshift=-0.625in\]current page.north east\) rectangle \(current page\.south east\);\\end{tikzpicture}\n/g' orcca.tex; \
xelatex orcca.tex; \
xelatex orcca.tex; \
xelatex orcca.tex; \
# perl -p0i -e 's/(\\textbf{.*?}\\space\\space%\n\\begin\{exercisegroup.*?\n(.*?\n)*?\\end\{divisionexerciseeg.*?\n)((.*?\n)*?\\end\{exercisegroup.*?\n)/\\makeatletter\\\@beginparpenalty=10000\\makeatother\n\1\\makeatletter\\\@beginparpenalty=-51\\makeatother\n\3\\makeatletter\\\@beginparpenalty=-51\\makeatother\n/g' orcca.tex; \
echo 'SHORTEN UNRESOLVED XREF WARNINGS'; \
perl -pi -e 's/\{\(\(\(Unresolved xref, reference "[\w\-]*"; check spelling or use "provisional" attribute\)\)\)\}\\hyperlink\{\}\{(\w*?)~\}/\1 A.B/g' orcca.tex; \
perl -pi -e 's/\{\(\(\(Unresolved xref, reference "[\w\-]*"; check spelling or use "provisional" attribute\)\)\)\}(\w*?)~/\1 A.B/g' orcca.tex; \
perl -pi -e 's/\{\(\(\(Unresolved xref, reference "[\w\-]*"; check spelling or use "provisional" attribute\)\)\)\}\\hyperlink\{\}{(.*?)}/\1/g' orcca.tex; \




On Sat, Jun 3, 2023 at 6:10 AM kcri...@gmail.com <kcri...@gmail.com> wrote:
Thanks, Alex and Sean, those are a good start toward suggestions on the file management side.  I imagine you do more than put in "\newpage", though - and there is also \clearpage or something like that, right?  Under what circumstances do you use each of those, or other commands?  I think that even having a terse list of a few commands that (help) solve common problems in tex source would be helpful to authors - they can search up what those things do online or by trial and error.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

Rob Beezer

ungelesen,
03.06.2023, 14:25:1703.06.23
an pretext...@googlegroups.com
On 6/3/23 08:44, Alex Jordan wrote:
> But permids are no more,

You mean the "internal" IDs now utilized in the LaTeX file no longer use a
@permid? Or something different?

Rob

Alex Jordan

ungelesen,
03.06.2023, 14:46:0103.06.23
an pretext...@googlegroups.com
I don't know what is the status of permids in general, but they have all been removed from ORCCA source for now.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

Rob Beezer

ungelesen,
03.06.2023, 15:11:1803.06.23
an pretext...@googlegroups.com
Thanks, that was an one interpretation I'd thought of.

On 6/3/23 11:45, Alex Jordan wrote:
> I don't know what is the status of permids in general, but they have all been
> removed from ORCCA source for now.
>
> On Sat, Jun 3, 2023 at 11:25 AM Rob Beezer <bee...@privacyport.com
> <mailto:bee...@privacyport.com>> wrote:
>
> On 6/3/23 08:44, Alex Jordan wrote:
> > But permids are no more,
>
> You mean the "internal" IDs now utilized in the LaTeX file no longer use a
> @permid?  Or something different?
>
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-suppo...@googlegroups.com
> <mailto:pretext-support%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/MTAwMDA0OC5iZWV6ZXI.1685816715%40quikprotect <https://groups.google.com/d/msgid/pretext-support/MTAwMDA0OC5iZWV6ZXI.1685816715%40quikprotect>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/CA%2BR-jrdXCGFn8aNCPrEXO4abdzsz0utzd4NBghJ-hsg-xVFZfw%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-support/CA%2BR-jrdXCGFn8aNCPrEXO4abdzsz0utzd4NBghJ-hsg-xVFZfw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

ungelesen,
05.06.2023, 10:59:0705.06.23
an PreTeXt support
The main issue for me is that I need to deal with vertical placement of margin items.
My extra XSL defines some LaTeX commands that move things to the margin; there's an argument to the command that sets the vertical shift, with a default value of {0cm}
What I need to do for APEX is write a script that scans the LaTeX output for every occurrence of {0cm} and then checks last year's adjusted LaTeX file for the corresponding argument (which will be something like {-3cm} and replaces it.
But I don't know how to write such a script so I do it in Meld.

kcri...@gmail.com

ungelesen,
06.06.2023, 10:28:0206.06.23
an PreTeXt support
Thanks everybody, this has been very illuminating - especially a careful read through of Alex' well-commented script.  See https://github.com/PreTeXtBook/pretext/issues/1996 where I hope to add something to the guide.

Randall Pruim

ungelesen,
27.06.2023, 19:21:3527.06.23
an PreTeXt support
I'm a complete newbie to pretext, but I have some experience with other things, including Sweave, RMarkdown, bookdown, and more recently quarto, and I've also authored published books entirely in latex, one of which involved a custom script to execute and embed R code and output (back before the days of knitr et al, which made this much more robust).

Since I'm hoping to get a book finalized for Fall and will likely want to make both HTML and PDF versions available, I'm also interested in this topic.

Here's what I'm wondering:

* For me, the most common tex fiddling involves page breaks.  Does it make sense to introduce <newpage /> or <pagebreak /> which creates a page break in the PDF output and does nothing in HTML?  That's essentially what quarto has done.  See https://quarto.org/docs/authoring/markdown-basics.html#page-breaks.

* Perhaps there are a small number of additional tags like this that could handle some other common cases.

* Does it make sense to introduce <tex> </tex>, between which "arbitrary" tex can appear, again ignored for HTML output, but used when creating PDF output.

The idea of manually intervening in the .tex file seems to spoil the purpose of using something like pretext (and the other tools I mentioned), which is to have one source document from which a number of different outputs can be produced.  So I'm really hoping to avoid that.

Sean Fitzpatrick

ungelesen,
27.06.2023, 21:17:1727.06.23
an pretext...@googlegroups.com
I think <pagebreak/> has been discussed; can't recall if it was ever implement.

I'm off on the wilderness with my issues, since I'm using a lot of custom xsl to move things into the margin, and there is no way to get LaTeX to place things reasonably without manual intervention.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/b636ed05-3533-4504-ae90-c4e791446063n%40googlegroups.com.

kcri...@gmail.com

ungelesen,
28.06.2023, 07:54:3728.06.23
an PreTeXt support

* For me, the most common tex fiddling involves page breaks.  Does it make sense to introduce <newpage /> or <pagebreak /> which creates a page break in the PDF output and does nothing in HTML?  That's essentially what quarto has done.  See https://quarto.org/docs/authoring/markdown-basics.html#page-breaks.

I can anticipate an objection to that (reasonable) idea, which is that even *tiny* changes in the TeX often lead to big pagination changes.  I'm always amazed at how adding a line can make a page break appear *later*, and vice versa.  Since so many things are implemented using tcolorbox (which I understand not at all), and because of how TeX handles figures (floats?), it's almost impossible to predict where they will occur, and even a one character change in your ptx code might lead to needing to put the <pagebreak /> in a new spot, or to remove it entirely.

And despite Rob's ideas for a (print, not pdf) LaTeX replacement using Mathjax, I'm not sure that will be better, since presumably it would break pages while printing figures ... ?

* Does it make sense to introduce <tex> </tex>, between which "arbitrary" tex can appear, again ignored for HTML output, but used when creating PDF output.

Are there obvious use cases for that other than the stuff which can already go in the preamble?

Randall Pruim

ungelesen,
28.06.2023, 09:26:2528.06.23
an PreTeXt support
I don't disagree about manual pagebreaking being fragile, but that isn't really the issue here.  The question is where/how to make those fragile page breaks.

As for best practices regarding page breaks:

* Do them very last (because they will be fragile).
* Work from front to back (because page breaks have down stream effects).
* If/when you edit content, remove manual page breaks and start over (at least within sections that have a clean restart -- like chapters in most books).

Here's why I don't like the idea of manually intervening in the derived tex files:

* Someone writing pretext might not actually know much tex and find those files bewildering (or break things in ways they don't anticipate).
* If you make page breaks in chapter 1-5, then make an edit in chapter 3 and rebuild, this leads to redundant work for chapters 1, 2, 4, and 5 to keep the page breaks that don't need changing unless you are using some external tool (Yet Another Tool) to reinsert the page breaks.
* I prefer to have one source of truth since it makes things less cryptic and (usually) easier to maintain.

David W. Farmer

ungelesen,
28.06.2023, 10:10:3628.06.23
an PreTeXt support

I have two related suggestions about adjusting the PDF output.

1) It would be good to support a list of tags which do nothing,
or which do nothing in a particular output format. The first
pass through the document could "do the right thing" with these.
There would be two types: empty tags, which are just deleted on
first pass if those are do-nothing in that output format,
or tags with content, which have the tags removed, just leaving the
content.

There is the possibility of adding functionality to those tags
later.

An example tag I would like to see is a "sentence" tag. I'd like
that so I can experiment without having a lot of overhead trying
it out.

A <newpage/> could also be an example in non-PDF output.

In my naive view of XSL development, it would not be too onerous
to make a list of such tags and treat them all as described above.

The "tex" tag suggested previously is a 3rd category: replace with
its content in TeX output, otherwise delete it and its content.

Maybe all the official PreTeXt does it strip out those empty tags
replace the others as described above. So, little maintenance
required. It is the responsibility of the publisher to do an
initial pass through the document to make those tags have an effect.
(see footnote)

2) I think the above idea is important when it comes to page fitting,
because of the following principle which I will offensively put
in all caps (this is basically Randall's point, but blame me for
the shouting):

PAGE FITTING SHOULD BE DONE IN THE PRETEXT SOURCE,
NOT IN THE DERIVED LATEX OUTPUT.

By "SHOULD BE" I mean "would be better if PreTeXt allowed it to".

My reason for that comes from my experience as a pagefitter.
It is not just a matter of inserting page breaks. Pretty often
you want to remove one or two lines from a page. If you do that
in the LaTeX then now you are out of sync with the official
source, unless you edit the same thing twice. Now, it is true that
some git magic with branches can let you re-make the latex and
preserve the previous hand-edits to the derived latex. But that
is an uncomfortable workflow for most people, and not long-term
sustainable.

Does this seem to violate the first Principle of PreTeXt?
Perhaps.

Can this idea be abused?
Definitely.

Should we consider it anyway?
I think so.

Regards,

David

footnote:
Maybe no change at all is required to PreTeXt: an XSL guru can start
using those tags now: just pre-pre-process the document to turn those
tags into what you want, leaving you with official PreTeXt source which
then you process as usual.

Maybe some people are already doing things like that.
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> pretext-suppo...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/ab5514fa-0e80-4179-af8a-267802f1b5cfn%40googlegroups.com.
>
>

Sean Fitzpatrick

ungelesen,
28.06.2023, 10:30:2328.06.23
an pretext...@googlegroups.com
For APEX I was hoping to follow the all-caps advice in point #2.
But I couldn't convince anyone this was a good idea.

What I wanted to do:

If a figure/table/video/aside should go in the margin, add an attribute like `marginshift="2cm"` to the tag for the object you want to move.

The logic in our extra XSL would be much simpler, too: instead of conditioning like, "if it's a figure, but not a figure in a side-by-side, and not a child of this, and not with that ancestor, then move it to the margin".

Instead, you just move anything with a non-empty marginshift attribute.
Maybe attributes are more expensive than tags in a way I haven't thought of but I don't think so.

If I had that, and a page break, I'd have 97% of what I need to fix.

The only other problem I run into: there are a small number of theorems/definitions with overfull hboxes. When your tcolorbox for these environments has a border or a coloured background, it becomes very apparent when your text is overflowing. My approach so far with these has been to temporarily resize those tcolorboxes.

I don't think there's a reasonable way to capture that in PreTeXt source. Maybe this problem shifts from the publisher back to the author: those segments need to be rewritten to avoid bad boxes.

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/hS2Mi0bk3N0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/39592bf3-3e77-f03-204c-c0504ee670e%40aimath.org.

Randall Pruim

ungelesen,
28.06.2023, 15:50:2528.06.23
an PreTeXt support
Your wish may also be related to the conversation about options for <sage> (See https://groups.google.com/g/pretext-support/c/rdIi42AJ8cg/.)

The ability to work with (potentially new) attributes would be useful there as well.

kcri...@gmail.com

ungelesen,
29.06.2023, 09:07:1429.06.23
an PreTeXt support
There is the possibility of adding functionality to those tags
later.

An example tag I would like to see is a "sentence" tag. I'd like
that so I can experiment without having a lot of overhead trying
it out.

A <newpage/> could also be an example in non-PDF output.

In my naive view of XSL development, it would not be too onerous
to make a list of such tags and treat them all as described above.


In principle, one can do this now and the xsl will just ignore those, correct?  So the real question is whether they would be "official" and/or in the schema.

I would support this - it would also make general experimentation easier, perhaps - but I would not be the one implementing it, of course. 

Alex Jordan

ungelesen,
29.06.2023, 11:56:1629.06.23
an pretext...@googlegroups.com
I have an idea on my to do list for marking page breaks. If it is a good idea and someone else wants to implement it, go for it. I might not get to trying it this summer 

In the publisher file, latex element, a pagebreaks element. It has one attribute that is a space-separated list of xml:ids. During assembly, following each element with an xml:I'd from this list, a pi:pagebreak is inserted. And then acted on in latex as a \newpage or something.

This makes it a publisher duty, not author. And you could maintain several different publisher files (letter vs a4? PDF for print vs for screen? etc.) Without worrying about turning certain pagebreaks on and off in the author's source as the publisher tries to make different versions.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

Sean Fitzpatrick

ungelesen,
29.06.2023, 12:38:5729.06.23
an pretext...@googlegroups.com
Hmm... That has me wondering about my margin figure issue.

It's too much data to put directly into the publisher file, but could I have a list (CSV? JSON?) of pairs in a separate file along the lines of:

xml:id  |  shift
----------------------
fig-cool-1, -2.5cm

that could be used by the extra XSL?

The LaTeX package we use to place figures has a mandatory argument for vertical placement. Right now we just default that to {0cm} for each figure, and then manually edit each one in the .tex source after the fact.



Rob Beezer

ungelesen,
29.06.2023, 22:02:2829.06.23
an pretext...@googlegroups.com
I like this idea. So much so, that I won't volunteer what I would have done.

As Alex notes, it

(a) makes it clear this is a publisher activity.
(b) allows for multiple schemes.
(c) easy to turn on and off (which the publisher file could have done anyway).

I think I'd allow for multiple such elements, maybe a publisher wants one per
chapter, just to stay organized. (Might not fit with Alex's new
publisher-attribute scheme, but not too rough to organize anyway.)

Someone who might implement this would learn a lot of useful XSL and the
inner-workings of the pre-processor.

Rob

On 6/29/23 08:56, Alex Jordan wrote:
> I have an idea on my to do list for marking page breaks. If it is a good idea
> and someone else wants to implement it, go for it. I might not get to trying it
> this summer
>
> In the publisher file, latex element, a pagebreaks element. It has one attribute
> that is a space-separated list of xml:ids. During assembly, following each
> element with an xml:I'd from this list, a pi:pagebreak is inserted. And then
> acted on in latex as a \newpage or something.
>
> This makes it a publisher duty, not author. And you could maintain several
> different publisher files (letter vs a4? PDF for print vs for screen? etc.)
> Without worrying about turning certain pagebreaks on and off in the author's
> source as the publisher tries to make different versions.
>
> On Thu, Jun 29, 2023, 6:07 AM kcri...@gmail.com <mailto:kcri...@gmail.com>
> <kcri...@gmail.com <mailto:kcri...@gmail.com>> wrote:
>
>
> There is the possibility of adding functionality to those tags
> later.
>
> An example tag I would like to see is a "sentence" tag. I'd like
> that so I can experiment without having a lot of overhead trying
> it out.
>
> A <newpage/> could also be an example in non-PDF output.
>
> In my naive view of XSL development, it would not be too onerous
> to make a list of such tags and treat them all as described above.
>
>
> In principle, one can do this now and the xsl will just ignore those,
> correct?  So the real question is whether they would be "official" and/or in
> the schema.
>
> I would support this - it would also make general experimentation easier,
> perhaps - but I would not be the one implementing it, of course.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/beb110a6-bdda-4434-a246-635c7cd2d6c6n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/beb110a6-bdda-4434-a246-635c7cd2d6c6n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/CA%2BR-jrdiYwrC40YcbAA%3D_zqFTEJUqHTg%2BNTiyibFN4bkpqs1ZA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-support/CA%2BR-jrdiYwrC40YcbAA%3D_zqFTEJUqHTg%2BNTiyibFN4bkpqs1ZA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Rob Beezer

ungelesen,
29.06.2023, 22:05:0629.06.23
an pretext...@googlegroups.com
On 6/29/23 09:38, Sean Fitzpatrick wrote:
> It's too much data to put directly into the publisher file,

Nothing is "too big" to put into the publisher file. ;-)

And you could likely "xi:include" it if you didn't always want it in the way.

kcri...@gmail.com

ungelesen,
30.06.2023, 07:46:3330.06.23
an PreTeXt support
On Thursday, June 29, 2023 at 10:02:28 PM UTC-4 Rob Beezer wrote:
I like this idea. So much so, that I won't volunteer what I would have done.

As Alex notes, it

(a) makes it clear this is a publisher activity.
(b) allows for multiple schemes.
(c) easy to turn on and off (which the publisher file could have done anyway).

Yeah, this seems like a good way to separate this out without cluttering the code itself (and git history, though some people worry about that too much) with something very fragile.

Michael Doob

ungelesen,
04.07.2023, 17:42:1604.07.23
an PreTeXt support
If all final page adjustments are to be done by adjusting the tex file, 
it might be helpful to allow comments to be inserted from the source. 
Perhaps something like:

<latex_comment> Use \tcbbreak to adjust page break in a tcolorbox</latex_comment>

could be useful.

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten