check_consecutive_words: Check consecutive typeset words

Description Usage Arguments Value

View source: R/check_consecutive_words.R

Description

Check consecutive typeset words

Usage

1
2
3
4
5
6
7
check_consecutive_words(
  path = ".",
  latex_file = NULL,
  md5sum.ok = NULL,
  outfile = NULL,
  outfile.append = FALSE
)

Arguments

path

Path containing the LaTeX file.

latex_file

The LaTeX file (without path) whose output will be checked.

md5sum.ok

The output of md5sum of an acceptable LaTeX file. Since some repeated words will be spurious, you can use the md5sum of the output of this function.

outfile

A file to which the output can be saved. If NULL, the default, the output is printed to the console (and not saved).

outfile.append

(logical, default: FALSE). Append or overwrite outfile if specified? If FALSE, the default, and file exists, outfile will be overwritten.

Value

NULL if the LaTeX document does not create a PDF with lines repeated. An error if words are repeated on consecutive lines, together with cat() output of the offending lines. The output is presented in 'stanzas':

1
2
'<Repeated word>'
        <Context>

for example a document that results in the following lines, notably the repetition of household, the output would be:

1
2
3
4
5
6
'household'
        affordable. This `mortgage burden' is often defined as the proportion of
        household income spent on repaying a mortgage. Depending on the
        household income measure used, the mortgage burden on a newly
        purchased first home, assuming a person borrows 80 per cent of the
        value of the home, is currently lower than much of the period between

Lastly the error message contains the md5sum of the file is returned in the error message, so it can be supplied to md5sum.ok.


TeXCheckR documentation built on Nov. 17, 2020, 9:08 a.m.