28.10 Local Customization

  28.10.1 Customizing Paper/Screen Sizes
  28.10.2 Customizing Colors
  28.10.3 Include ALLPROSE Documentation
  28.10.4 Show the PROJECTROOT on the First Page
  28.10.5 Turning Inverse Search Off
  28.10.6 Customizing Code Chunks
  28.10.7 Undoing Customizations

The file local.sty need not exist, but is generated by some MAKE targets. If it exists, however, it will be included into allprose.sty.nw and therefore its contents is valid for the whole documentation.

The targets laptop, screen, colored, include-allprose-documentation, show-projectroot, no-srcltx, no-usedef, and rm-local.sty, appearing in this section are top-level targets.See Section 28.4 for more top-level targets.

388local documentation customization 388  (346)
customization of paper sizes 389
customization of colors 390
customization to include ALLPROSE documentation 391
customization to show PROJECTROOT 393
customization to disallow inverse search 396
customization to remove defs and uses of code chunks 397a
undo customizations 398

28.10.1 Customizing Paper/Screen Sizes

The target laptop adjusts the page length so that pages are smaller and no scrolling is needed on a small laptop screen. The target screen is like laptop, but the sizes are a bit bigger. The targets laptop and screen are auxiliary targets to work with the documentation while developing code. Adjust them to the size of your screen.

389customization of paper sizes 389  (388)
laptop:
        @echo ’\setlength{\textheight}{469.9626pt}’     >> local.sty
        @echo ’\setlength{\topmargin}{-74.04881pt}’     >> local.sty
        @echo ’\setlength{\oddsidemargin}{-66.50157pt}’ >> local.sty

screen:
        @echo ’\addtolength{\textheight}{-21mm}’    >> local.sty
        @echo ’\addtolength{\oddsidemargin}{-32mm}’ >> local.sty
        @echo ’\addtolength{\topmargin}{-32mm}’     >> local.sty

Defines:
laptop, never used.
screen, never used.

28.10.2 Customizing Colors

The target colored defines particular colors for the definitions and uses of terms as well as for backgrounds of code chunks, verbatim environments, etc. Look at Section 24.13 Known Styles in ALLPROSE at the end of the documentation of allprose.sty.nw.

Note that you must have one of the newer dviviewers20 . Older viewers might show the colored areas completely black and therefore make the output unreadable.

In order to compile a colored online documentation say

make rm-local.sty colored dvi

390customization of colors 390  (388)
colored:
        @echo ’\usepackage{color}’                              >> local.sty
        @echo ’\def\tcx{\textcolor[rgb]}’                       >> local.sty
        @echo ’\def\srcFileStyle#1{\tcx{0.4,0,0}{#1}%’          >> local.sty
        @echo ’  \raisebox{1ex}{\tcx{0.5,0.5,0.5}%’             >> local.sty
        @echo ’    {\footnotesize{\srcextension{}}}}}’          >> local.sty
        @echo ’\def\genFileStyle{\tcx{0.4,0.2,0.7}}’            >> local.sty
        @echo ’\def\generatedFileStyle{\tcx{0.4,0.2,0.7}}’      >> local.sty
        @echo ’\def\defineTermStyle{\textcolor{red}}’           >> local.sty
        @echo ’\def\useTermStyle{\textcolor{blue}}’             >> local.sty
        @echo ’\def\useMakeTargetStyle{\tcx{0,0.5,0.5}}’        >> local.sty
        @echo ’\def\adtypeStyle{\tcx{0.4,0,0}}’                 >> local.sty
        @echo ’\def\adnameStyle{\tcx{0,0,0.4}}’                 >> local.sty
        @echo ’\backgroundColor{ToDo}[rgb]{1,0.3,0.3}’          >> local.sty
        @echo ’\backgroundColor{Convention}[rgb]{1,0.6,0.6}’    >> local.sty
        @echo ’\backgroundColor{code}[rgb]{1,1,0.5}’            >> local.sty
        @echo ’\backgroundColor{aldordoc}[rgb]{0.8,1,0.8}’      >> local.sty
        @echo ’\backgroundColor{adsnippet}[rgb]{0.7,1,0.7}’     >> local.sty
        @echo ’\backgroundColor{verbatim}[rgb]{0.9,0.9,0.9}’    >> local.sty
        @echo ’\backgroundColor{verbatiminput}[rgb]{0.9,0.7,1}’ >> local.sty
        @echo ’\backgroundColor{showexports}[rgb]{0.9,0.7,1}’   >> local.sty
        customization to pale defs and uses of code chunks 397b

Defines:
colored, never used.

Uses adnameStyle 286, adtypeStyle 266, code 432, generatedFileStyle 228, genFileStyle 228, showexports 370, useMakeTargetStyle 207a, and verbatim 210.
28.10.3 Include ALLPROSE Documentation

In order to include the ALLPROSE documentation, issue

make include-allprose-documentation dvi

391customization to include ALLPROSE documentation 391  (388)
include-allprose-documentation:
        @echo ’\IncludeALLPROSEDocumentationtrue’ >> local.sty

Defines:
include-allprose-documentation, used in chunk 408.

If the ALLPROSE documentation should not be in the documentation, first remove local.sty.

make rm-local.sty dvi

See also Section 24.1.

28.10.4 Show the PROJECTROOT on the First Page

For development of a project on different branches it might be useful to show the name of the directory where the development takes place.

The directory name of the project root is shown on the first page via

make show-projectroot dvi

393customization to show PROJECTROOT 393  (388)
show-projectroot:
        @echo ’\ShowPROJECTROOTtrue’ >> local.sty

Defines:
show-projectroot, never used.

If the project root should no longer be shown, remove the line containing

\ShowPROJECTROOTtrue

from local.sty via the command

make rm-local.sty dvi

See also Section 24.2.

28.10.5 Turning Inverse Search Off

By default, if the file srcltx.sty can be found, inverse search is switched on. If the target no-srcltx is used in the form

make no-srcltx dvi

then no source specials appear in the .dvi file and thus inverse search is disabled.

396customization to disallow inverse search 396  (388)
no-srcltx:
        @echo ’\SRCOKfalse’ >> local.sty

Defines:
no-srcltx, never used.

28.10.6 Customizing Code Chunks

The target no-usedef can be used to remove Noweb output that otherwise might distract from the actual code. Noweb generates at the end of the code chunk lines like, for example,

Defines:  
  TOOLS, used in chunks 102a, 103, ...  
Uses PROJECTROOT 92.

in case a code chunk defines or uses tagged identifiers. If such lines are not wanted, one can simply redefine two commands from the noweb LATEX package.

397acustomization to remove defs and uses of code chunks 397a  (388)
no-usedef:
        @echo ’\def\nwidentdefs#1{}’ >> local.sty
        @echo ’\def\nwidentuses#1{}’ >> local.sty

Defines:
no-usedef, never used.

There is a weaker form of making the output not too distracting. The target colored includes the following code chunk. It makes the defined identifiers appear in a pale red and the used identifiers appear in pale blue.

397bcustomization to pale defs and uses of code chunks 397b  (390)
@echo ’\let\rhxidentdefs\nwidentdefs’ >> local.sty
@echo ’\let\rhxidentuses\nwidentuses’ >> local.sty
@echo ’\def\nwidentdefs#1{\textcolor[rgb]{1.0,0.5,0.5}{\rhxidentdefs{#1}}}’ >> local.sty
@echo ’\def\nwidentuses#1{\textcolor[rgb]{0.5,0.5,1.0}{\rhxidentuses{#1}}}’ >> local.sty

28.10.7 Undoing Customizations

The target rm-local.sty removes the file local.sty.

Since the above targets always add lines to the file local.sty, it is sometimes necessary to remove this file so that the default output format with no local modifications is achieved by

make rm-local.sty dvi

398undo customizations 398  (388)
rm-local.sty:
        -@$(RM) local.sty

Defines:
rm-local.sty, never used.