MyNixOS website logo
Description

Parses LaTeX Documents for Errors.

Checks LaTeX documents and .bib files for typing errors, such as spelling errors, incorrect quotation marks. Also provides useful functions for parsing and linting bibliography files.

Development page for TeXCheckR. See also https://github.com/hughparsonage/grattanReporter

# install.packages("TeXCheckR")
library(TeXCheckR)
library(knitr)
## Warning: package 'knitr' was built under R version 4.0.2
library(pander)
## Warning: package 'pander' was built under R version 4.0.3
library(magrittr)
eg <- system.file("extdata", "readme.tex", package = "TeXCheckR")
\documentclass{article}

\begin{document}

I'd like an en dash - now.

Quotes need to be entered 'precisely'.

Footnotes can't have spaces before. \footnote{And should be full sentences}

We shouldn't refer to section 1 by typing out the literal cross-reference.

\section{Consitent labels are a good custom}\label{good-customs}

And English spacing dictates sentence spacing HERE. Otherwise the spacing looks strange.

Here the mismatched parentheses are obvious. (But it's not always the case.

We want to avoid this formatting: 10 million payments of $5 would total $50 million. 
And \LaTeX{} won't raise an error.

\end{document}
check_dashes(eg)
## 
## Dash likely masquerading as hyphen. Use -- for a dash.
## <U+2716> 5: As always, visually check the result in the PDF.I'd like an en dash - now.
## 
## IMPORTANT: make sure you are replacing a hyphen with two hyphens, not a unicode dash  –

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Single hyphen surrounded by spaces. This is likely a hyphen masquerading as dash. Use -- for a dash.
## 
## IMPORTANT: make sure you are replacing a hyphen with two hyphens, not a unicode dash  –
## If you're not sure, reenter as two hyphens from the keyboard (rather than just appending a hyphen at the end). As always, visually check the result in the PDF.
check_quote_marks(eg)
## 
## Closing quote used at beginning of word. Use a backtick for an opening quote, e.g. The word `ossifrage' is quoted.
## <U+2716> 7: Quotes need to be entered 'precisely'.
##                                 ^

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Closing quote used at beginning of word. Use a backtick for an opening quote, e.g. The word `ossifrage' is quoted.
check_footnote_typography(eg)
## 
## Footnote does not end with full stop.
## <U+2716> 9: 
## \footnote
##          {And should be full sentences}

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Footnote does not end with full stop.
check_literal_xrefs(eg)
## 
## Hard-coded xref in document.
## <U+2716> 11: We shouldn't refer to section 1 by typing out the literal cross-reference.
## All xrefs need to use \Cref or \Vref (or \Chapref for cross-references to chapters). If you need to use this phrase, you can use a non-breaking space e.g. 'Section~81 of the Constitution.

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Hard-coded xref in document. All xrefs need to use \Cref or \Vref (or \Chapref for cross-references to chapters).
check_labels(eg)
## 
## \label used without prefix.
## <U+2716> 13: \section{Consitent labels are a good custom}\label{good-customs}
## Use fig: tbl: box: chap: subsec: paragraph: rec: fn: in every label.

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Each \label must contain a prefix.
TeXCheckR:::check_sentence_ending_periods(eg)
## 
## Capital letter ends sentence, but sentence-ending period mark absent.
## <U+2716> 15: And English spacing dictates sentence spacing HERE. Otherwise the spacing looks strange.
## Sentences which end with a capital letter need to be signalled with a sentence-ending period. (\@.)

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Sentences which end with a capital letter need to be signalled with a sentence-ending period. (\@.)
TeXCheckR:::check_unclosed_parentheses(eg)
## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : 17 contains parenthesis that does not close.
check_escapes(eg)
## 
## Unescaped $.
## <U+2716> 19: We want to avoid this formatting: 10 million payments of $5 would total
##                                                                 ^
## If you meant to print a dollar sign, use \$. If you want to use math-mode, use \(...\), not $...$ .

## Error in rmarkdown::render("C:/Users/hughp/Documents/TeXCheckR/README.Rmd", : Unescaped $. If you meant to print a dollar sign, use \$. If you want to use math-mode, use \(...\), not $...$ .
Metadata

Version

0.8.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows