Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
.. SPDX-FileCopyrightText: 2023 His Majesty in Right of Canada
SPDX-License-Identifier: LicenseRef-MIT-DND
This file is part of the ERRERS package.
ERRERS stands for "Enhanced Review of Reports via Extraction using Rule-based Substitutions". It extracts text from LaTeX files so as to reduce the number of false positives when checking grammar and spelling with Microsoft Word or other software. It is performed through the application of substitution rules based on regular expressions.
ERRERS runs on Python 3, more specifically version 3.6 or more recent. Version 3.2 was tested on Microsoft Windows 10 and 11, Apple macOS 14, and Debian GNU/Linux 12. It uses the third-party regex module if available (https://pypi.org/project/regex), as it allows for faster execution, but defaults back to the standard re module if not.
The Python distribution provided by Apple on macOS includes an older version of the Tkinter GUI library with which ERRERS is not compatible, but it can still be used in command-line mode. To use ERRERS in GUI mode on that platform, an alternate version of Python must be installed, such as those available from the Python website (https://www.python.org/). On macOS 14, it is preferable to use Python 3.11.7 or more recent, as buttons may become unresponsive with the version of Tkinter included in earlier versions. There are two workarounds for the unresponsiveness bug if upgrading Python is not an option: the first is to use keyboard shortcuts, and the second one is to move the window (which reactivates the buttons).
ERRERS depends on two third-party Python packages:
regex (all platforms) Provides faster and more robust processing of regular expressions; and
pywin32 (Windows only) Enables creation of shortcuts and inclusion of a "Check" button to initiate grammar and spell check in Microsoft Word.
ERRERS is distributed as a platform-independent Python package, which requires a local Python installation. To install it:
Open a command prompt or shell from which Python can be run. For instance, with the Anaconda Python distribution, you would choose Programs >> Anaconda3 >> Anaconda Prompt in the Windows Start menu.
Type python3 -m pip install errers
and press enter. On some systems, you
may need to use py
or python
rather than python3
. You may also
need to use pipx
rather than pip
.
Type errers --shortcuts
at the command prompt and press enter.
In the shortcut-update window that appears, choose the locations where you would like application shortcuts to be created and click "Create". The available locations vary from one operating system to another:
a) On Windows: Desktop, "Send To" menu, and Start menu; b) On macOS: user Applications folder, Launchpad, and "Open with" menu; and c) On Linux: Desktop (or Home directory), Application menu, and "Open With" menu.
Copy shortcuts to other locations if desired. For instance, on Windows, one of them could be pinned to the taskbar; on macOS, it could be added to the Dock.
If pip cannot download ERRERS at step 2 above, you may be able to download it manually from https://pypi.org/project/errers/#files. If so:
python3 -m pip install WHEEL
and press enter, where WHEEL
is
the name of the installation file from step 1. On some systems, you may need
to use py
or python
rather than python3
. You may also need to
use pipx
rather than pip
.The installation procedures above fail if regex is not available. On Windows,
they also fail if pywin32 is not available. If for some reason these two
packages cannot be installed, the installation can be forced by using option
--no-deps
when calling pip, which omits package dependencies:
python3 -m pip install --no-deps errers
or
python3 -m pip install --no-deps WHEEL
. Without regex, text extraction will
be slower. Without pywin32 on Windows, shortcut creation will not be available,
and the "Check" button will be missing.
Installation files can also be downloaded from https://github.com/steve-guillouzic-gc/errers/releases, where pre-release versions will also be made available.
Local network administrators may offer other methods of installing ERRERS. For instance, the ERRERS source code is distributed with a script that bundles it into a standalone Windows application that does not require Python. This is not covered here, as it is outside the scope of this manual.
To remove ERRERS:
errers --shortcuts
at the command prompt and press enter.python3 -m pip uninstall errers
and press enter. On some systems,
you may need to use py
or python
rather than python3
. You may
also need to use pipx
rather than pip
.ERRERS can also be used from the command-line. Type errers -h
at the
command prompt and press enter for more information.
The extraction is performed through the application of substitution rules based on regular expressions. The current set of rules covers the most common LaTeX commands, and additional rules will be added over time. Rules are created automatically for LaTeX commands defined in the document using \newcommand, \rewnewcommand, \providecommand, \def, \edef, \gdef, and \xdef. In many cases, there is no need for users to define additional substitution rules.
However, if needed, rules can be defined directly in LaTeX documents; such rules are applied first and can be used to override those provided with ERRERS or determined automatically from command definitions. When installed as Python package rather than standalone application, users can also place custom rules in a local.py file saved to the rules sub-directory of the ERRERS installation folder so they can be applied to all their documents.
The substitution rules being based on regular expressions, the first step in learning how to create new rules is to look at the re module page: https://docs.python.org/3/library/re.html.
The ERRERS package provides LaTeX-specific sequences for use in regular expressions:
For instance, Rule(r'\\foo%C%C', r'\g') substitutes each occurrence of a two-argument \foo command with the content of its first argument. If the rule should be applied only when the arguments are in curly brackets, %C should be replaced with %c. To use it in a given document, add the following line anywhere in the LaTeX file:
% Rule(r'\\foo%C%C', r'\g')
More information can be found in the user manual: https://cradpdf.drdc-rddc.gc.ca/PDFS/unc459/p813656_A1b.pdf.
A list of changes from one version to the next is provided in the change log: https://github.com/steve-guillouzic-gc/errers/blob/main/CHANGELOG.rst.
If you wish to contribute to the development of ERRERS, please see the CONTRIBUTING file: https://github.com/steve-guillouzic-gc/errers/blob/main/CONTRIBUTING.rst.
The source code is hosted on GitHub: https://github.com/steve-guillouzic-gc/errers.
The following people contributed to the project:
The ERRERS source code is distributed under the MIT license (https://spdx.org/licenses/MIT). The LICENSES directory in the source code, wheel, and source distribution files contains the text of the license.
FAQs
ERRERS: Enhanced Review of Reports via Extraction using Rule-based Substitutions
We found that errers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.