12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

18.16. Checking the processor\checkarrayindex checks if 〈arrayname〉 is an array and if 〈index〉 is a valid index for thearray. If both conditions hold then \ifbounderror is set false, but if either 〈arrayname〉is not an array or, if it is, 〈index〉 is out of range then \ifbounderror is set true.\stringtoarray{〈arrayname〉}{〈string〉}\arraytostring{〈arrayname〉}{〈result〉}<strong>The</strong> macro \stringtoarray puts each character from 〈string〉 sequentially into the〈arrayname〉 array, starting at index 1. <strong>The</strong> macro \arraytostring assumes that〈arrayname〉 is an array of characters, and defines the macro 〈result〉 to be that sequenceof characters. For example:\stringtoarray{MyArray}{Chars}\arraytostring{MyArray}{\MyString}is equivalent to\def\MyString{Chars}\checkifinteger{〈num〉}\ifinteger<strong>The</strong> command \checkifinteger ckecks if 〈num〉 is an integer (not less than zero). If it isthen \ifinteger is set true, otherwise it is set false.Note.Please note that \checkifinteger may only work on simple input.18.16 CHECKING THE PROCESSOR18.16.1 Checking for pdfLa<strong>TeX</strong>Both La<strong>TeX</strong> and pdfLa<strong>TeX</strong> can be run on the same document. La<strong>TeX</strong> produces a .dvi fileas output, while pdfLa<strong>TeX</strong> can produce either a .dvi or a .pdf file. On modern systemspdfLa<strong>TeX</strong> produces a pdf file by default.If you want a dvi file output use La<strong>TeX</strong> and if you want a pdf file use pdfLa<strong>TeX</strong>.\ifpdf ... \fi<strong>The</strong> <strong>class</strong> provides \ifpdf which is true when the document is being processed by pdfLa-<strong>TeX</strong> and false otherwise. You can use it like this:\ifpdfcode for pdfLa<strong>TeX</strong> only\elsecode for La<strong>TeX</strong> only\fiIf there is no La<strong>TeX</strong> specific code then don’t write the \else part.337

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!