User:Dcwilson/Smoothproofing
Smoothproofing TeXnicalities
Task specifications
To present compiled LaTeX in a form suitable for smoothproofing, the following are minimum requirements
- text shown in DPCustomMono2
- numerals shown in DPCustomMono2 in math mode
- other math symbols in bold (Computer Modern) to better match the weight of DPCustomMono2
- pagebreaks matching the scan, except for rejoined hyphenation
- linebreaks matching the scan, except for rejoined hyphenation
- line numbers shown (to facilitate reporting of errors by smoothproofers, because few will have tools to annotate pdfs)
- access to scan for reference
Document preamble code
Some of the specifications are more easily satisfied than others.
Text in DPCustomMono2
In the LaTeX document we just need
\renewcommand{\encodingdefault}{T1} \renewcommand{\rmdefault}{DPCustomMono2}
However, this requires that LaTeX support files for a T1-encoded DPCustomMono2 are installed, and that the actual font file DPCustomMono2.ttf is accessible to pdflatex (or other TeX system able to use TrueType fonts). For example, if you use a TDS-compliant system, a copy of DPCustomMono2.ttf could be placed in the directory localtexmf/fonts/truetype/DP/ (and the filename database refreshed if appropriate). For pdflatex to output the characters in the font you also need a copy of the encoding file T1-WGL4.enc, stored for example in localtexmf/fonts/enc (see below if you don't already have a copy).
TeX itself only needs font metric information: a copy of DPCustomMono2.tfm could be placed in the directory localtexmf/fonts/tfm/public/DP/ (and the filename database refreshed if appropriate).
LaTeX's font selection scheme needs a font definition file T1DPCustomMono2.fd, which can be stored anywhere in your LaTeX search path. The following example defines the basic font family, suppresses automatic hyphenation when using this font, and also suppresses bold, italic, slanted and smallcaps when this font is selected. The final line is an alternative to explicitly modifying pdftex configuration files to declare which actual font should be used and how it should be reencoded.
\ProvidesFile{t1DPCustomMono2.fd}[DPCustomMono2 font] \DeclareFontFamily{T1}{DPCustomMono2}{\hyphenchar\font=-1} % suppress hyphenation \DeclareFontShape{T1}{DPCustomMono2}{m}{n}{ <-> [0.9] DPCustomMono2 }{} \DeclareFontShape{T1}{DPCustomMono2}{bx}{n}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{m}{it}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{m}{sl}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{m}{sc}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{bx}{it}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{bx}{sl}{<->ssub * DPCustomMono2/m/n}{} \DeclareFontShape{T1}{DPCustomMono2}{bx}{sc}{<->ssub * DPCustomMono2/m/n}{} \pdfmapline{+DPCustomMono2\space <DPCustomMono2.ttf\space <T1-WGL4.enc}
Testing the installation
To check that DPCustomMono2 is properly installed for use by your TeX system, compile the following and see if your favourite font appears in the output. (Don't worry if you get a font scaling warning: all that matters is that the output is in DPCustomMono2.)
\documentclass{minimal} \renewcommand{\encodingdefault}{T1} \renewcommand{\rmdefault}{DPCustomMono2} \begin{document} Hello World! \end{document}
Numerals in DPCustomMono2
Assuming the code for changing the text font to DPCustomMono2 is in place, the following will draw the math mode numerals from DPCustomMono2 as well.
\DeclareSymbolFont{yuk}{T1}{DPCustomMono2}{m}{n} \DeclareMathSymbol{0}{\mathalpha}{yuk}{`0} \DeclareMathSymbol{1}{\mathalpha}{yuk}{`1} \DeclareMathSymbol{2}{\mathalpha}{yuk}{`2} \DeclareMathSymbol{3}{\mathalpha}{yuk}{`3} \DeclareMathSymbol{4}{\mathalpha}{yuk}{`4} \DeclareMathSymbol{5}{\mathalpha}{yuk}{`5} \DeclareMathSymbol{6}{\mathalpha}{yuk}{`6} \DeclareMathSymbol{7}{\mathalpha}{yuk}{`7} \DeclareMathSymbol{8}{\mathalpha}{yuk}{`8} \DeclareMathSymbol{9}{\mathalpha}{yuk}{`9}
Bold mathematics
This is easy.
\AtBeginDocument{\boldmath}
Pagination
We can exploit the standard DP page separators to force page breaks.
T1-WGL4.enc
% T1-WGL4.enc % % % This is LaTeX T1 encoding for WGL4 encoded TrueType fonts % (e.g. from Windows 95) % % % Note that /hyphen appears twice (for the T1 code points `hyphen' 0x2d % and `hyphenchar' 0x7f). % % % LIGKERN space l =: lslash ; % LIGKERN space L =: Lslash ; % LIGKERN question quoteleft =: questiondown ; % LIGKERN exclam quoteleft =: exclamdown ; % LIGKERN hyphen hyphen =: endash ; % LIGKERN endash hyphen =: emdash ; % LIGKERN quoteleft quoteleft =: quotedblleft ; % LIGKERN quoteright quoteright =: quotedblright ; % LIGKERN comma comma =: quotedblbase ; % LIGKERN less less =: guillemotleft ; % LIGKERN greater greater =: guillemotright ; % % LIGKERN f i =: fi ; % LIGKERN f l =: fl ; % LIGKERN f f =: ff ; % LIGKERN ff i =: ffi ; % LIGKERN ff l =: ffl ; % % We blow away kerns to and from spaces (TeX doesn't have a % space) and also remove any kerns from the numbers. % % LIGKERN space {} * ; * {} space ; % LIGKERN zero {} * ; * {} zero ; % LIGKERN one {} * ; * {} one ; % LIGKERN two {} * ; * {} two ; % LIGKERN three {} * ; * {} three ; % LIGKERN four {} * ; * {} four ; % LIGKERN five {} * ; * {} five ; % LIGKERN six {} * ; * {} six ; % LIGKERN seven {} * ; * {} seven ; % LIGKERN eight {} * ; * {} eight ; % LIGKERN nine {} * ; * {} nine ; /T1Encoding [ % now 256 chars follow % 0x00 /grave /acute /circumflex /tilde /dieresis /hungarumlaut /ring /caron /breve /macron /dotaccent /cedilla /ogonek /quotesinglbase /guilsinglleft /guilsinglright % 0x10 /quotedblleft /quotedblright /quotedblbase /guillemotleft /guillemotright /endash /emdash /compwordmark /perthousandzero /dotlessi /dotlessj /ff /fi /fl /ffi /ffl % 0x20 /visualspace /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash % 0x30 /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question % 0x40 /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O % 0x50 /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore % 0x60 /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o % 0x70 /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /hyphen % 0x80 /Abreve /Aogonek /Cacute /Ccaron /Dcaron /Ecaron /Eogonek /Gbreve /Lacute /Lcaron /Lslash /Nacute /Ncaron /Eng /Odblacute /Racute % 0x90 /Rcaron /Sacute /Scaron /Scedilla /Tcaron /Tcedilla /Udblacute /Uring /Ydieresis /Zacute /Zcaron /Zdot /IJ /Idot /dmacron /section % 0xA0 /abreve /aogonek /cacute /ccaron /dcaron /ecaron /eogonek /gbreve /lacute /lcaron /lslash /nacute /ncaron /eng /odblacute /racute % 0xB0 /rcaron /sacute /scaron /scedilla /tcaron /tcedilla /udblacute /uring /ydieresis /zacute /zcaron /zdot /ij /exclamdown /questiondown /sterling % 0xC0 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis % 0xD0 /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /OE /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /Germandbls % 0xE0 /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis % 0xF0 /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /oe /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /germandbls ] def % eof