Package: tex-untag
TeX UntagA script for removing all of a given markup tag from a set of TeX files.DescriptionThis is a small script for removing markup tags of the form\tag{...}from aTeX fileor set of TeX files. It can be imported usingimporttex_untagThe 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 functionuntag_file("report.tex","textit")would remove all italic text tags of the form\textit{...}from the documentreport.tex, whileuntag_file("report.tex","textcolor{red}")would remove all red text tags of the form\textcolor{red}{...}. Comments are (optionally) ignored during this process.Note that, since this process involves overwriting existing files, it is recommended that you back up your data before attempting to use it.FunctionsThis module defines two main public functions:tex_untag.untag_file(fname, tag[, comment]): Removes the giventagfrom a single file or a list of files calledfname. The optionalcommentboolean specifies whether to remove tags from comments (defaultFalse). Returns the total number of tag removals made.tex_untag.untag_folder(folder, tag[, ext][, comment]): Removes the giventagrecursively from every file within the givenfolderand its subfolders. The optionalextargument is a string or list of strings specifying which file extensions to include (defaulttex), while the optionalcommentboolean specifies whether to remove tags from comments (defaultFalse). Returns the total number of tag removals made and the total number of files processed.Command Line UsageThis package defines a console scripttex-untagwhich can be used as follows:usage: tex-untag [-h] [-v] [-f [FILES ...]] -t TAG [-e [EXTENSIONS ...]] [-q] [-r] [-c]

A script for removing markup tags from a set of TeX files.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -f [FILES ...], --file [FILES ...]
                        file, list of files, or directory to process (if blank and
                        --recursive, uses current working directory)
  -t TAG, --tag TAG     tag to remove from files
  -e [EXTENSIONS ...], --extension [EXTENSIONS ...]
                        file extensions to process (default only tex)
  -q, --quiet           silence result message
  -r, --recursive       recursively process all files in the given directory
  -c, --comments        removes tags even in comments

This script removes a given TeX markup tag from a given file or set of files. The tag is
assumed to use the form "\tag{...}". The given tag should include the full text that falls
between the '\' and '{' characters.

The file (-f) argument can include a single file, a list of files, or a directory, in which
case the recursive (-r) flag should be used.

The extension (-e) argument is optional, and if absent only 'tex' files will be processed.
Otherwise it can include either a list of file extensions or the '*' character, in which
case all files will be included.For example,$ tex-untag -f introduction.tex results.tex conclusion.tex -t textit -cwould remove all italic\textit{...}tags from the three local filesintroduction.tex,results.tex, andconclusion.tex, including those located inside comments, while$ tex-untag -f report -t textcolor{red} -e tex bbl --recursivewould remove all red text\textcolor{red}{...}tags from every.texor.bblfile within the local directoryreport/.