Skip to main content

A script for removing all of a given markup tag from a set of TeX files.

Project description

TeX Untag

A script for removing all of a given markup tag from a set of TeX files.

Description

This is a small script for removing markup tags of the form \tag{...} from a TeX file or set of TeX files. It can be imported using

import tex_untag

The user can specify the exact tag name string that they want removed, and all instances within the specified file or files will be removed. For example, executing the function

untag_file("report.tex", "textit")

would remove all italic text tags of the form \textit{...} from the document report.tex, while

untag_file("report.tex", "textcolor{red}")

would remove all red text tags of the form \textcolor{red}{...}. Comments are (optionally) ignored during this process.

Noe that, since this process involves ovewriting existing files, it is recommended that you back up your data before attempting to use it.

Functions

This module defines two main public functions:

  • tex_untag.untag_file(fname, tag[, comment]): Removes the given tag from a single file or a list of files called fname. The optional comment boolean specifies whether to remove tags from comments (default False). Returns the total number of removals made.
  • tex_untag.untag_folder(folder, tag[, ext][, comment]): Removes the given tag recursively from every file within the given folder and its subfolders. The optional ext argument is a string or list of strings specifying which file extensions to include (default tex), while the optional comment boolean specifies whether to remove tags from comments (default False). Returns the total number of removals made.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tex-untag-0.5.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

tex_untag-0.5.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page