1.1 The preamble and global settings

We have tested only the article format. A fontsize of 12pt on A4 paper should be specified. This is the largest font size available in standard LaTeX  and the smallest considered to be appropriate for a clear print format by the RNIB [1]. Using a clear print format will ensure your base document format can be immediately accessed by more people. This is particularly important when producing a PDF containing — the reader will not be able to change the font and equations will not be reflowed with the text if the font size is increased. The RNIB also recommends that the text layout be simple and clear hence text should be presented in one column only.

\documentclass[12pt,a4paper,onecolumn]{article}

The following packages and commands can or must be used:

%All changes to page geometry must be via the geometry package. 
\usepackage[a4paper]{geometry} %Required
\usepackage[english]{babel} %Required
\usepackage[OT1]{fontenc} %Required

\usepackage[intlimits]{amsmath} %Required if using amsmath
\usepackage{amssymb} %Required if using amssymb
\usepackage{amsfonts} %Required if using amsfonts
\usepackage[mathscr]{eucal} %Required if using eucal
\usepackage{eufrak} %Required if using eufrak
\usepackage{amsthm} %Required if typesetting theorems etc. 
\usepackage{longtable} %Required if using tables with headings
\usepackage{graphicx} %Required if including images 
\usepackage{verbatim} %Required if including verbatim text
\usepackage{url} %Required if including urls

\let\columnlines\empty %Required (transformation to Word format)

%All theorem-like entities should use a newtheorem-like structure, 
%do not use {\bf Theorem} etc. as the structure is lost.
%Currently the transformation via plastex does not retain numbering,
%this will be fixed in the future.
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}

%Theorem styles can be used but in large print will be redefined.
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{remark}
%Unnumbered theorem environments may be used
\newtheorem*{note}{Note}

%All newenvironments should be produced using the newenvironment tool
\newenvironment{Proof}{\noindent{\bf Proof.}\hspace*{1em}}{\qed\par}

%All definitions must be via newcommand or renewcommand to ensure that 
%previous definition is not overridden. Do not use declaremathoperator 
%or def. All definitions which include superscripts or subscripts 
%will need to be copied into tex4ht configuration file for the document.
%Do not use newcommand to produce macros for begin and end environments.
\newcommand{\xsb}{x_{1}} 
\newcommand{\xsp}{x^{2}}
\newcommand{\xsbnum}[1]{x_{#1}}
\newcommand{\boo}{\mathrm{boo}}
\newcommand{\End}{\mathrm{End}}

%Required to ensure that the theorem numbering is correct after plastex 
%transformation. As well as this the equation numbering needs to be set 
%back to 0 at the start of every section and subsection including
%numbered equations. Numbering should not be reset apart from this. 
%\nonumber can be used, \tag and \notag cannot be
\numberwithin{equation}{subsection} 

\newif\ifplastex %Required
\plastexfalse %Required
\newif\iftht %Required
\thtfalse %Required

\newif\ifLP %Required
\LPfalse %Required
\ifLP %Required
%Reflow cannot occur within a root symbol in large print PDF so the 
%root symbol is transformed to other notation
\renewcommand{\sqrt}[2][2]
{\left( #2 \right)^{\frac{1}{#1}}}
\fi

\newcommand{\nextalt}[1]{} %Required for alt tags 
\newcommand{\PICalt}[1]{{#1}} %Required for alt tags

%Required for basic commuting diagrams, please note that labelled 
%diagonal arrows are not currently possible.
%\tab must be used inside commuting diagrams instead of &
\newcommand{\mapright}[1]
{{\stackrel{#1}{\longrightarrow}}}
\newcommand{\mapdown}[1]
{\Big\downarrow{\scriptstyle{#1}}} 
\newcommand{\tab}{&}

\allowdisplaybreaks %Required

The introduction of any other packages may cause any or all of the transformations to fail even if no commands from the package are used! Examples of this were found when assessing the legacy documents but will not be documented here. If you introduce any other package you will need to test all the output formats accordingly.

Other RNIB guidelines include:

The following sequence of commands will switch the global document font, remove indents (using whitespace between paragraphs instead), redefine \emph to use bold for emphasis instead of italics and establish basic document information which will assist students with difficulties accessing text to quickly establish whether this is the document for which they are looking.

\setlength{\parindent}{0.0pt}
\setlength{\parskip}{1.0\baselineskip}
\renewcommand{\emph}{\textbf}

%Required for identifying documents
%date should be hardcoded as future versions with identical 
%content may be compiled on a different date or student might 
%be provided with the LaTeX file
\title{Writing \LaTeX~ for multiple output formats} 
\author{Emma Cliffe} 
\date{May 2012} 

%Helps with navigation, if you use this you must supply short 
%forms of section titles (~4 words max) if they are long.
\pagestyle{headings}
%To ensure that the page numbering of the front matter and
%the main content (after the contents page) is distinct.
\pagenumbering{roman}

\begin{document}
\ifplastex
\else \iftht
\else
\renewcommand{\familydefault}{phv}
\fontfamily{phv}\selectfont
\fi \fi

\maketitle %Required for identifying documents

The last line in the file must be

\end{document}

Content after this point can interfere with some transformation processes.

Finally, when writing your LaTeX  file it is important to recall that two of the transformation formats involve a student having direct access to the LaTeX  source itself. It is advisable that you only include what you wish to be read so either avoid comments or using a tools to strip comments out to create a clean version is recommended.

Running LaTeX

This structure of document and all advice is given in the context of compiling to PDF using pdflatex, that is, straight to pdf without using DVI or postscript as an intermediate format. This method of compiling means that packages which work only with postscript will not function. However, in all cases considered documents making use of such packages will not transform anyway. Specific advice on using images in this context is given elsewhere in the document.

The transformations

The transformations will not be covered in this document, please see the separate document on the main project page.

It is more important to remember that what you are writing will be transformed. Most authors use LaTeX  to produce PDF or hard-copy documents. Most authors will compile a document as they write to see precisely how it is formatted and make adjustments by hand — treating LaTeX  as a strict typesetting tool. The act of transforming the LaTeX  can destroy or alter much of the formatting and layout (consider a version delivered only in speech, or a format in a 20pt font size for instance).

Ideally, of course, you should proofread all output formats in use — and if the format supports speech then you should in addition proofread the speech output. However, practically speaking it is admitted that this is likely to be very time-consuming. Student feedback acknowledges this but recommends that at least a subset of the documents you produce are proofread in all formats. Authors are likely to find this a useful exercise as it can assist in the transition of mindset from using LaTeX  to typeset an inflexible document to using it primarily to encode content and describe structure.

Very common transformation errors

Having ensured that only the packages, structures and symbols described in this document are used, errors with transformations when given a LaTeX  document which compiles can still occur. The most common errors when performing the transformations, come from instances where LaTeX  is, arguably, more permissive than expected or welcome. To avoid these problems ensure that following:

Footnotes

  1. http://www.ctan.org/pkg/match_parens, http://www.ctan.org/pkg/check-parens