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 giventag
from a single file or a list of files calledfname
. The optionalcomment
boolean specifies whether to remove tags from comments (defaultFalse
). Returns the total number of removals made.tex_untag.untag_folder(folder, tag[, ext][, comment])
: Removes the giventag
recursively from every file within the givenfolder
and its subfolders. The optionalext
argument is a string or list of strings specifying which file extensions to include (defaulttex
), while the optionalcomment
boolean specifies whether to remove tags from comments (defaultFalse
). 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
Built Distribution
Hashes for tex_untag-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5d1064019b734ad1a356a429f574d4fea1c2016443550d5d5f7c5e6a04153e |
|
MD5 | a6d91347b6fe270ca7aa46310149c2a2 |
|
BLAKE2b-256 | 9d50351d11e0e9d42f58de768ce25629a3d9b10f681d12011b06d48568b874a6 |