{
    "content": [
        {
            "type": "text",
            "text": "# cweb (man)\n\n## NAME\n\nctangle, cweave - translate CWEB to C/C++ and/or TeX\n\n## SYNOPSIS\n\nctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\ncweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n\n## DESCRIPTION\n\nThe ctangle program converts a CWEB source document into a C/C++ program that may be compiled\nin the usual way.  The output file includes #line specifications so  that  debugging  can  be\ndone in terms of the CWEB source file.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **USAGE**\n- **DIFFERENCES TO ORIGINAL CWEB**\n- **OPTIONS**\n- **ENVIRONMENT**\n- **FILES**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "cweb",
        "section": "",
        "mode": "man",
        "summary": "ctangle, cweave - translate CWEB to C/C++ and/or TeX",
        "synopsis": "ctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\ncweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "tex",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/tex/1/json"
            },
            {
                "name": "cc",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/cc/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DIFFERENCES TO ORIGINAL CWEB",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 45,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 9,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ctangle, cweave - translate CWEB to C/C++ and/or TeX\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "ctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\ncweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The ctangle program converts a CWEB source document into a C/C++ program that may be compiled\nin the usual way.  The output file includes #line specifications so  that  debugging  can  be\ndone in terms of the CWEB source file.\n\nThe  cweave  program  converts  the  same CWEB file into a TeX file that may be formatted and\nprinted in the usual way.  It takes appropriate care of typographic details like page  layout\nand  the  use  of indentation, italics, boldface, etc., and it supplies extensive cross-index\ninformation that it gathers automatically.\n\nCWEB allows you to prepare a single document containing all the information  that  is  needed\nboth  to produce a compilable C/C++ program and to produce a well-formatted document describ‐\ning the program in as much detail as the writer may desire.  The user of CWEB ought to be fa‐\nmiliar with TeX as well as C/C++.\n",
                "subsections": []
            },
            "USAGE": {
                "content": "The  command line should have one, two, or three names on it.  The first is taken as the CWEB\ninput file (and .w is added if there is no extension).  If there is a second name,  it  is  a\nchange  file (and .ch is added if there is no extension).  The change file overrides parts of\nthe CWEB file, as described in the documentation.  If there is a third name, it overrides the\ndefault  name  of the output file, which is ordinarily the same as the name of the input file\n(but on the current directory) with the extension .tex.  If you just want to change the  out‐\nput file name, but don’t have a change file to apply, you can use `-' as the second argument.\n",
                "subsections": []
            },
            "DIFFERENCES TO ORIGINAL CWEB": {
                "content": "CWEBbin  tries hard to be a drop-in replacement for CWEB, so in general you should not notice\nany differences in invoking the programs nor in the resulting output.  There are, however,  a\nfew differences worth noting:\n\n• Options  --help,  --quiet,  --verbose,  --version, and flags -c, -i, -o, and +lX are new in\nCWEBbin and TeX Live.\n\n• Option +lX is accompanied by several wrapper files for cwebmac.tex with translated captions\nfor German (+ld), French (+lf), and Italian (+li).\n\n• CWEB in TeX Live operates silently by default (as of 2019); use the --verbose option to get\nthe original behavior.\n\n• File lookup with the environment variable CWEBINPUTS is extended to permit several,  colon-\nseparated, paths; see ENVIRONMENT below.\n\n• If  properly  configured,  the main programs ctangle and cweave are localized with the “GNU\ngettext utilities”.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Options on the command line may be either turned off with `-' (if they are on by default)  or\nturned  on  with  `+'  (if they are off by default).  In fact, the options are processed from\nleft to right, so a sequence like --verbose -h will only show the banner line  (+b)  and  the\nprogress report (+p), but leave out the happy message (-h).\n\nThe first batch of options are common to both ctangle and cweave:\n\n• +b: print banner line on terminal\n\n• +h: print success message on completion\n\n• +p: print progress report messages\n\n• +q/-q: shortcut for -bhp; also --quiet (default)\n\n• +v/-v: shortcut for +bhp; also --verbose\n\n• -c: ignore temporary output irrespective of changes\n\n• +s: print usage statistics\n\n• --help: display help message and exit\n\n• --version: output version information and exit\n\nThere is one other option applicable to ctangle only:\n\n• +k: keep separators in numeric literals in the output\n\nThere are seven other options applicable to cweave only:\n\n• -e: do not enclose C/C++ material in \\PB{...}\n\n• -f: do not force a newline after every C/C++ statement in output\n\n• -i: suppress indentation of parameter declarations\n\n• -o: suppress separation of declarations and statements\n\n• -x: omit indices, section names, table of contents\n\n• +lX/-lX: use macros for language X as of Xcwebmac.tex\n\n• +t: treat typename in a template like typedef\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "The  environment variable CWEBINPUTS is used to search for the input files, or the system de‐\nfault if CWEBINPUTS is not set.  See tex(1) for the details of the searching.  To avoid  con‐\nflicts with other programs that also use the CWEBINPUTS environment, you can be more specific\nand use CWEBINPUTScweb for special requirements in CWEB.\n\nIf prepared for NLS support, ctangle and cweave use the environment  variable  TEXMFLOCALEDIR\nto  configure  the  parent directory where the “GNU gettext utilities” search for translation\ncatalogs.\n\nThese variables are preconfigured in TeX Live’s texmf.cnf.\n",
                "subsections": []
            },
            "FILES": {
                "content": "The location of the files mentioned below varies from system to system.   Use  the  kpsewhich\nutility to find their locations.\n\n• cwebmac.tex: The default TeX macros \\input in the first line of the cweave output file.\n\n• cwebman.tex: The CWEB user manual, available in PDF from CTAN (https://ctan.org/pkg/cweb).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "• The  CWEB  System of Structured Documentation: by Donald E. Knuth and Silvio Levy (hardcopy\nversion of cwebman.tex and the source code listings of common.w, ctangle.w, and cweave.w).\n\n• Literate Programming: by D. E. Knuth.\n\n• Weaving a Program: by Wayne Sewell.\n\ncweb(1), tex(1), cc(1)\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Don Knuth wrote WEB for TeX and Pascal.\nSilvio Levy designed and developed CWEB by adapting the WEB conventions to C and by  recoding\neverything in CWEB.  Knuth began using CWEB and made further refinements.\nMany other helpers are acknowledged in the CWEB manual.\nContemporary development on https://github.com/ascherer/cweb.\n\n\n\nWeb2c 2022/dev                              June 6, 2021                                     CWEB(1)",
                "subsections": []
            }
        }
    }
}