summaryrefslogtreecommitdiff
path: root/tmac/s.tmac
Commit message (Collapse)AuthorAgeFilesLines
* Add `refer' support to -me.wl2011-01-281-151/+1
| | | | | | | | | | | | | * tmac/refer.tmac, tmac/refer-me.tmac, tmac/refer-ms.tmac, tmac/refer-mm.tmac: New files. The code in refer.tmac is based on the old code from `s.tmac'. * tmac/s.tmac: Remove direct refer support and include `refer-ms.tmac' instead. * tmac/e.tmac: Remove direct refer support and include `refer-me.tmac' instead. * NEWS: Updated.
* Fix `MC' macro of the ms package.wl2010-01-231-2/+2
| | | | | | | | | | | | | | | | | | | * tmac/s.tmac (@MC): Define `pg*col-top' after the paragraph has been initialized. Otherwise, using this example, .nh .nf .kern 0 .pl 6c .ll 70n .MC 30n Text for multiple columns. Text for multiple columns. Text for multiple columns. Text for multiple columns. Text for multiple columns. the columns start at different vertical positions.
* * tmac/s.tmac (@TS, TE, @EQ, @EN), tmac/an-old.tmac (TS, TE, EQ,wl2009-01-051-1/+14
| | | | | EN), tmac/e.tmac (TS, TE, EQ, EN): Set line length to a large value if processed with -Thtml.
* * */*: Update GPL2 to GPL3.wl2009-01-041-5/+4
|
* * src/roff/troff/input.cpp (do_suppress): Make \O[3], \O[4], andwl2008-10-041-1/+1
| | | | | \O[5] non-transparent w.r.t. beginning-of-line recognition (similar to the other \O variants).
* * doc/groff.texinfo: Document new .O register and add crosswl2007-09-191-36/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reference entries. * NEWS: Updated. * src/devices/grohtml/grohtml.man: Document new -V and -y options. * src/devices/grohtml/html-table.cpp: Add support for XHTML 1.1. (html_table:: emit_colspan, html_table::emit_td): New methods. (html_table::emit_col): Use html_table::emit_td. (html_table::emit_table_header): Use html_table::emit_colspan if dialect xhtml is specified. (html_table::finish_row): Updated. * src/devices/grohtml/html-table.h (html_table): Declare emit_colspan, emit_td. * src/devices/grohtml/html-text.cpp: Modified tags to comply with xhtml if this dialect was requested. * src/devices/grohtml/html-text.h (html_dialect): New enumeration. (html_text): Add new variable `dialect'. * src/devices/grohtml/post-html.cpp: Modify header tags to be XHTML compliant. (valid_flag, groff_sig, dialect): New global variables. (html_printer::handle_valid_flag, html_printer::do_math, html_printer::write_html_anchor, html_printer::write_xhtml_anchor, html_printer::do_math, html_printer::handle_valid_flag): New methods. (html_printer::emit_line, html_printer::emit_raw, html_printer::do_check_center, html_printer::write_title, write_rule, html_printer::writeHeadMetaStyle, generate_img_src, html_printer::begin_page): Altered to be XHTML compliant. (html_printer::write_header): Updated. (html_printer::troff_tag): Call do_math. (html_printer::insert_split_file, html_printer::do_file_components, html_printer::write_navigation): Create XHTML file components if necessary and also produces a groff signature if requested. (~html_printer): Call writeHeadMetaStyle at appropriate places depending upon html_dialect. (html_printer::special): Handle new tags `html<?p>' and `math<?p>'. (main): Added options -x, -V, and -y. (usage): Updated. * src/preproc/eqn/box.cpp: Create a distinction between the MathML device and the XHTML device. (do_text): Issue a newline at the end of the equation if XHTML was specified. (box::top_level): Prefix the output of an equation by the .MATHML macro. (output_string): Suppress \n if XHTML was specified. * src/preproc/eqn/main.cpp (xhtml): New global flag. (inline_equation): Skip leading spaces after inline equation for XHTML device. (main): Set `xhtml' flag if `-Tmathml:xhtml' is specified. * src/preproc/eqn/eqn.h (xhtml): New external flag. * src/preproc/eqn/text.cpp (entity_table): Fix typo. * src/preproc/html/pre-html.cpp (html_dialect): New enumeration. (dialect, eqn_flag): New global variables. (html_system): Improve debugging support. (alterDeviceTo): Test for -Txhtml when altering device to the image device and reset to -Txhtml. (addZ): Renamed to... (addArg): This. Introducea a general parameter. (print_args): New debugging function. (char_buffer::run_output_filter): Use print_args and addArg rather than addZ. (char_buffer::do_html, char_buffer::do_image): Add -rxhtml=1 command line parameter as an argument to the html generation of text when xhtml is needed. Include -e on the command line if mathml is required. (scanArguments): Allow -e, -V, -y and -x options. -V, -y are handled by the back end. -e sets `eqn_flag'. -x determines HTML dialect. * src/roff/groff/groff.cpp (possible_command): New method `clear_name'. (main): Set eflag if -e is present on command line. Set is_xhtml if -Txhtml is present. Pass `-x x' to the HTML pre and post processors. Pass `-e' to the HTML pre processor if required. Pass `-Tmathml:xhtml' to eqn if XHTML is requested. * src/roff/troff/input.cpp (init_input_requests): Introduce new number register `\n[.O]'. * tmac/s.tmac: (LP): Use .nop for semantic sugar. (cov*ab-init) reformat. (@EQ): Use EQN-HTML-IMAGE and friends rather than HTML-IMAGE. (CHECK-FOOTER-AND-KEEP): Define FS, FE such that they use <cite></cite> for the html device rather than generate images for footnotes. * tmac/troffrc-end: Define EQN-HTML-IMAGE, EQN-HTML-IMAGE-END, EQN-HTML-IMAGE-RIGHT, EQN-HTML-IMAGE-LEFT, EQN-HTML-IMAGE-INLINE, EQN-HTML-DO-IMAGE, EQN-HTML-IMAGE-END as null strings. * tmac/www.tmac: (HTML<?p>): New macro. (MATH<?p>): New macro. (IMG, PIMG, MPIMG, HR): Use XHTML compliant syntax. (www-emit-ltag): New macro. (www-push-li): Updated. (ULS): Ensure that tags are balanced in order by use of www-emit-ltag. (ULE): Likewise: Use www-emit-ltag and shut down paragraphs in order. (OLS, OLE, DLS, DLE): Ditto. <global>: Define EQ and EN to EQN-HTML-IMAGE and EQN-HTML-IMAGE-END respectively. (www-li-ul, www-li-ol, www-li-dl): Updated. (EQN-HTML-IMAGE, EQN-HTML-IMAGE-RIGHT, EQN-HTML-IMAGE-LEFT, EQN-HTML-IMAGE-INLINE, EQN-HTML-DO-IMAGE, EQN-HTML-IMAGE-END, MATHML): New macros.
* * tmac/s.tmac (cov*first-page-init): Remove invoking trap, to avoid possible ↵keithmarshall2007-07-151-0/+4
| | | | recursion.
* * tmac/s.tmac (cov*first-page-init): Emit error message if not inwl2007-07-021-0/+4
| | | | top-level environment.
* *** empty log message ***wl2007-07-011-1/+1
|
* * tmac/s.tmac (SN): Define unconditionally.keithmarshall2007-04-081-2/+11
| | | | | | (SN-STYLE): New string; define. * NEWS, tmac/groff_ms.man, doc/groff.texinfo (SN-STYLE): Document it.
* * tmac/s.tmac (MO, CH, pg*OH, pg*EH, pg*OF, pg*EF, *, [., .],wl2007-03-151-34/+36
| | | | | | | | | | par*define-font-macro, \[hooko]): Use \E to make it traceable. (ref*field): Add argument to control the space between previous and current argument. Update all callers. (ref*add-N): Fix handling of opening parenthesis. Problem reported by Jörg van den Hoff <j.van_den_hoff@fzd.de>.
* The other Bell Labs localisms are now enabled when you call .SC.esr2007-02-011-13/+19
| | | | It is no longer necessary to specift "-r bell=1" on the command line.
* Fix a documentation glitch, and test my commit ability.esr2007-02-011-1/+1
|
* Add some Bell labs extensions to the -ms macros.wl2007-02-011-0/+27
| | | | | | * tmac/s.tmac (.SC, .UC, .P1, .P2) [bell]: New macros. * tmac/groff_ms.man, doc/groff.texinfo, NEWS: Document `-r bell'.
* * tmac/an-ext.tmac: New file, containing extension macroswl2007-01-151-7/+7
| | | | | | | | for -man. See discussion on the groff mailing list for background information. * tmac/an-old.tmac: Load an-ext.tmac. Decorate .ds and as with comment escapes where appropriate. * tmac/Makefile.sub (NORMALFILES): Add an-ext.tmac.
* * All affected files: Update postal address of FSF.wl2005-05-261-1/+1
|
* * tmac/devtag.tmac: Protect against loading twice.wl2004-12-181-0/+1
| | | | | | | Protect agains compatibility mode. * tmac/www.tmac: Protect against loading twice. Load `devtag.tmac' before switching off compatibility mode. * tmac/an-old.tmac, tmac/s.tmac: Load `devtag.tmac'.
* Make `test-groff' work again -- previously, wrong paths have beenwl2004-12-161-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | used. Additionally, it can now be called from anywhere. * test-groff.in: Don't test for groff binary. This is no longer necessary since the proper paths are determined by `configure'. (EXEEXT): Removed. No longer used. (srcdir, builddir): Use values provided by the configure script. (XENVIRONMENT): Updated. * INSTALL: Updated. Make .tag and .taga work for all devices (but only grohtml actually handles them). * src/devices/grohtml/post-html.cpp: s/html-tag/devtag/. (text_glob::is_br, page::add_tag, html_printer::troff_tag, html_printer::handle_assertion): Don't use hard-coded string lengths. (html_printer::lookahead_for_table): Reset `tbl' properly if necessary. (html_printer::devtag): New function, handling `devtag'. (html_printer::special): Don't handle `html-tag'. * src/include/printer.h, src/libs/libdriver/printer.cpp (printer::devtag): New virtual function. * src/libs/libdriver/input.cpp (parse_x_command) <'X'>: Handle `devtag'. * src/roff/troff/env.cpp, src/roff/troff/mtsm.cpp, src/roff/troff/node.cpp: s/html-tag/devtag/. * src/roff/troff/input.cpp (tag, taga): Always call curenv->add_node. * tmac/an-old.tmac, tmac/s.tmac, tmac/troffrc-end: Use DEVTAG* macros instead of HTML-TAG*. * tmac/devtag.tmac: New file, defining the DEVTAG-* macros. * tmac/www.tmac: Load devtag.tmac. Replace HTML-TAG* macros with DEVTAG* macros. (HTML, HTML-NS): Changed definitions. (URL): Use HTML-NS. (HTML-TAG, HTML-TAG-NS, HTML-TAG-NEXT): Removed. * tmac/Makefile.sub (NORMALFILES): Add devtag.tmac.
* Fix a bug with title handling in HTML.wl2004-12-071-2/+4
| | | | | | | | | | | * src/devices/grohtml/post-html.cpp (text_glob::is_nf, text_glob::is_fi, text_glob::is_ce): Use strlen to compute string length. (html_printer::handle_tag_within_title): New function. (html_printer::do_title): Use it. * tmac/s.tmac (TL): Don't set `need_eo_tl'. (cov*tl-au-print): Emit `.eo.tl' tag.
* * tmac/s.tmac (ref*add-V, ref*add-N): New macros for handlingwl2004-11-231-0/+6
| | | | the volume and number refer entries.
* * doc/groff.css: New file.wl2004-10-131-38/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/webpage.ms: Use `groff.css'. Other small fixes. * tmac/an-old.tmac (need_eo_h): New number register. (TH): Emit `.eo.tl' tag after title. (SH): Set `need_eo_h'. (an-trap): Handle `need_eo_h'. (an-do-tag): s/HTML-TAG-NS/HTML-TAG-NEXT/. * tmac/s.tmac (need_eo_h, need_eo_tl): New number registers. (TL): Always start diversion. Updated. (@AI): Always call `par@reset'. (@AB): Update code for -Thtml. (cov*tl-au-print): Handle -Thtml. (par@reset): Handle `need_eo_tl', `need_eo_h'. (@IP): Simplified. (@IT-html): Removed. (@SH): Set `need_eo_h' for -Thtml. (par@TL): s/HTML-TAG/HTMl-TAG-NS/. Set `need_eo_tl'. (@NH): s/HTML-TAG/HTMl-TAG-NS/. Set `need_eo_h' for -Thtml. (@EQ, @EN): Don't handle -Thtml specially. (par@load-init): Don't handle -Thtml specially. * tmac/www.tmac (www:paraspace): New macro. (HTML-NS, HTML-TAG-NS): Use new `tag' request. (HTML</p>, HTML-TAG-NEXT): New macros. (HnE): Emit tag `.eo.h' instead of break. (HR): s/HTML-NS/HTML/. (www-end-nowhere): End diversion only if `www-html' not set. Emit `.eo.tl' tag. (ULS, ULE): s|HTML|HTML</p>|. (LI): Call `www:paraspace'. (HEAD): New macro.
* This change implements the following features:wl2004-09-201-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PORPHANS New numeric register: Defines number of lines following LP, PP, QP, IP or XP, which must be kept together, before any automatic page break. If insufficient space remains on the current page, a page break is forced before the new paragraph begins. HORPHANS New numeric register: Sets number of lines of following paragraph which must be kept with a heading, defined by NH or SH, before any automatic page break. If insufficient space remains on the current page, a page break is forced before the heading. GROWPS (Thanks to Joerg van den Hoff, for this idea). New numeric register: Sets the first level of heading (set with NH), which will keep the same point size as body text; e.g. if GROWPS is set to 3, .NH 3, .NH 4, ... will produce headings at the point size specified by \n[PS], but .NH 2 and .NH 1 will have progressively larger point sizes, determined by \n[PSINCR] (see below). PSINCR New numeric register: Sets the point size increment for each level of heading, (set with NH), below the threshold level set by GROWPS; e.g. if \n[PS] = 10, \n[GROWPS] = 3 and \n[PSINCR] = 2.0p, then .NH 1 will produce 14pt headings, .NH 2 will produce 12pt, and all other levels will remain at 10pt, (because \n[PS] = 10). SH Existing macro now accepts a numeric argument, to make heading size match that of NH with same argument value, when the GROWPS/PSINCR feature is enabled. SN-DOT New string, set by NH macro, replaces the existing (undocumented) use of SN, to represent the assigned section number. SN-NO-DOT New string, set by NH macro, represents the assigned section number, but omits the terminal period (periods at intermediate levels are retained). SN String set by NH macro, originally undocumented, now implemented as an alias for SN-DOT (which reproduces original behaviour). * tmac/s.tmac (PORPHANS): New register. (par*start): Use it. (HORPHANS, GROWPS, PSINCR): New registers. (SH-NO-TAG, @SH): Use them. (@NH): Improved. * NEWS, doc/groff.texinfo, tmac/groff_ms.man: Document the deletion of `Ds' and `De' macros.
* * doc/meref.me: Document `_M' register.wlemb2004-08-051-2/+0
| | | | | | | | | | | | | | | | | | Make hpftodit work correctly on big-endian systems. * src/utils/hpftodit/hpftodit.cpp (File): New method `get_uint32(char *)'. (entry): New member `orig_value'. (read_tags): Use new method. (output_font_name, read_and_output_pcltypeface, dump_ascii): Updated. * tmac/s.tmac: Undo change 2003-06-29. The proper macro definitions are already in X11's `macros.t' file. * src/utils/hpftodit/hfptodit.cpp (output_font_name, dump_ascii): Fix casting bug. (read_and_output_pcltypeface): Handle strings with length <= 4.
* * tmac/s.tmac (pg@top): Don't save PO register.wlemb2004-07-281-3/+2
| | | | | | | | | | | (pg*end-col, pg*end-page): Directly use PO register. * man/groff_tmac.man: Mention `trace' and `pic' macro packages. * src/preproc/refer/refer.cpp (output_references): Check for empty hash table. * src/preproc/refer/refer.man: Improve documentation of `bibliography' command.
* Add support for fractional point sizes in ms macros. A value forwlemb2004-07-251-14/+66
| | | | | | | | | | PS, VS, FPS, and FVS greater than or equal to 1000 is always divided by 1000. For example, `.nr PS 10250' sets the font size to 10.25p. * tmac/s.tmac (@AU, @AI, par@load-init, par@init, par@reset, NL, PX): Handle fractional point sizes for PS, VS, FPS, and FVS. * tmac/groff_ms.man, docs/groff.texinfo, NEWS: Document it.
* * tmac/s.tmac (@init, RP): Allow initialization of the PO registerwlemb2004-04-161-1/+2
| | | | before the first page.
* * src/devices/grolj4/lj4.cpp (main): Fix argument of getopt_long.wlemb2004-03-011-2/+2
| | | | | | | | | | | s/operand/argument/ in error message. * src/roff/groff/groff.cpp (main): Don't allow option -o if -Thtml is in use. * tmac/s.tmac (XE): Fix error message.
* Make grotty work on platforms which have unsigned char as thewlemb2003-07-071-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default for char. Based on a patch by Thomas Klausner <wiz@netbsd.org>. * src/devices/grotty/tty.cpp (schar): New typedef. Updated calls to declare_ptable and implement_ptable. (glyph): Use schar for back_color_idx and fore_color_idx. (tty_printer): Use schar for curr_fore_idx and curr_back_idx. (tty_printer::tty_color, tty_printer::tty_printer, tty_printer::color_to_idx, tty_printer::put_color): Updated. * src/roff/nroff/nroff.sh: Add option -d for completeness. * src/roff/nroff/nroff.man: Updated. * NEWS, tmac/groff_www.man: Updated. * doc/Makefile.sub: Updated. Implement support for multiple HTML output files. * src/preproc/html/pre-html.cpp (scanArguments): Dummy handling for -j command line option. * src/devices/grohtml/post-html.cpp (job_name, multiple_files): New global variables. (file): New fields `new_output_file', `require_links', `output_file_name'. (file::file): Updated. (files::set_file_name, files::set_links_required, files::are_links_required, files::is_new_output_file, files::file_name, files::next_file_name): New functions. (header_desc): New fields `no_of_level_one_headings', `header_filename'. (header_desc::header_desc): Updated. (header_desc::write_headings): Handle multiple files. (html_printer::write_header): Save file name in which header occurs. (html_printer::determine_header_level): Possibly split files on level one headings. (html_printer::do_links, html_printer::troff_tag): Updated. (html_printer::insert_split_file, html_printer::do_job_name, html_printer::emit_link, html_printer::write_navigation, html_printer::do_file_components): New functions. (html_printer::~html_printer): Handle multiple files. (main): Handle command line option `-j'. * src/devices/grohtml/grohtml.man: Updated. * doc/Makefile.sub (pic.html), doc/Makefile.in (pic.html): New rule which splits file. * tmac/www.tmac (JOBNAME): New macro. * tmac/s.tmac (SH-NO-TAG): New macro. (@SH): Call SH-NO-TAG. (@NH): Updated.
* * tmac/s.tmac (De, Ds): New aliases for .DE and .DS, respectively.wlemb2003-07-011-0/+2
| | | | | The X11 documentation files use them. * tmac/groff_ms.man, doc/groff.texinfo: Document them.
* * font/devhtml/R.proto: Updated to HTML 4, adding many glyphs.wlemb2002-07-191-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * font/devutf8/R.proto: Adding some missing glyphs. * font/devutf8/NOTES: Updated. * tmac/dvi.tmac: Add more composite glyphs. * tmac/html.tmac: Updated. * man/groff_char.man: Add `sum' and `product' entities. * NEWS: Updated. Improved table, tab, and indenting support. * src/roff/troff/input.cc (file_iterator::suppress_newline_flag, string_iterator::suppress_newline_flag): Removed. Updated all function which have used it. * src/roff/troff/env.cc: Include `input.h'. (environment::add_node): Accept 0 as parameter. (environment::add_html_tag): Add `force' parameter. Updated all callers. (environment::add_html_tag_tabs): Ditto. For the moment, support left-aligned tabs only. (environment::make_html_tag): New function. (fill, no_fill): Set .br html tag additionally. (environment::newline): Emit `eol.ce' or `eol' tag for html. (environment::add_html_tag_eol): Removed. (tab_stops::distance_to_next_tab): Add variant for handling nextpos'. (environment::distance_to_next_tab): Ditto. Updated all callers. (environment::handle_tab): Handle tabs for html. * src/roff/troff/env.h: Updated. * src/roff/troff/div.cc: Updated all callers of `environment::add_html_tag'. * src/devices/grohtml/html-table.cc, src/devices/grohtml/html-table.h: New files. * src/devices/grohtml/html-text.cc (html_text): New members `blank_para' and `start_space'. (html_text::issue_tag): Don't emit TABLE_TAG. Handle indentation for PRE_TAG and P_TAG. (html_text::end_tag): Updated. (html_text::table_is_void, html_text::issue_table_begin, html_text::issue_table_end): Removed. (html_text::do_push): Simplified. [DEBUGGING]: Small fix. (html_text::push_para): Add new parameter for indentation; updated all callers. Handle PRE_TAG. (html_text::do_indent, html_text::do_table, html_text::done_table, html_text::is_in_table): Removed. (html_text::do_pre): Handle P_TAG also. (html_text::shutdown): Handle p->indent. (html_text::check_emit_text): Simplified. (html_text::do_emittext): Reset `blank_para'. (html_text::do_para): Add new parameter for indentation; updated all callers. (html_text::remove_indent): New function. (html_text::do_space): Handle verbatim text properly. (html_text::ever_emitted_text, html_text::starts_with_space, html_text::remove_para_align): New functions. (html_text::dump_stack_element, html_text::dump_stack): Updated. * src/devices/grohtml/html_text.h (HTML_TAG): Remove TABLE_TAG. Updated. * src/devices/grohtml/post-html.cc: Include html-table.h. (INDENTATION): Removed. (text_glob): Added many `is_<foo>' functions. Added table description `tab'. Added `get_arg',`get_tab_args', `remember_table', and `get_table' member functions. (list): Add `insert' and `move_to' member functions. (page): Add `insert_tag' member function. (page::dump_page) [DEBUG_TABLES]: Improved. (html_printer): Add `table' and `max_linelength' elements. Add many `do_<foo>', `insert_<foo>', `next_horiz_pos', `lookahead_for_tables', `shutdown_table', `calc_nf', `calc_po_in', `remove_tabs', `remove_courier_tabs'. (html_printer::emit_raw): Handle indentation. (html_printer::do_center, html_printer::write_header): Updated. (html_printer::is_courier_until_eol): Check for tag. (html_printer::do_linelength): Handle max_linelength. (html_printer::do_page_offset, html_printer::do_indentation): Handle fill_on. (html_printer::do_tempindent): Updated. (html_printer::do_indentedparagraph): Removed. (html_printer::do_indent): Simplified. (html_printer::do_eol): Use `ever_emitted_text'. (html_printer::do_flush, html_printer::do_links): Don't call done_table. (html_printer::do_break): Handle end_tempindent. (html_printer::troff_tag): Get argument. Don't handle `.ip'. Handle `.tab-ts', `.tab-te', `.col', `tab', and `tab0' tags. (html_printer::flush_page): Call `lookahead_for_tables'. Don't call `done_table'. (html_printer::add_to_sbuf): Always call do_indent. * src/devices/grohtml/Makefile.sub: Updated. * tmac/an-old.tmac (TP): Don't handle html device specially. (an-do-tag-html): New function which will be used instead of `an-do-tag' if html device is used. * tmac/html.tmac: Call .po to pass default page offset to grohtml. * tmac/s.tmac (@IP): Don't handle html device specially. (@IP-html): New function which will be used instead of `@IP' if html device is used. * tmac/www.tmac (HTML-NS, HTML-TAG-NS): New auxiliary macros -- this is a hack which will eventually vanish again. (PIMG): Handle `-C' option correctly if not html. (HR): Use HTML-NS.
* Change syntax of \O: \O[0] suppresses output, \O[1] enables outputwlemb2002-05-221-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if at outer level; at start-up we are at outer level. * src/roff/troff/input.cc (do_suppress): Implement it. Simplify \O[3]. Add option -p to show progress information. pre-grohtml will now render only one page at a time, reducing the size of needed disk resources enormously. * src/preproc/html/pre-html.cc (imagePageStem): Replaced with... (imagePageName): New global variable. (psPageName, show_progress, currentPageNo): New global variables. (html_system): Close saved stderr and stdout handles. (write_end_image): Accept a parameter to control \O escape. (write_start_image): Adapted to new \O meaning. (char_buffer::write_upto_newline): Updated. (createAllPages): Replaced with... (createPage): This new function to create a single page for images. It uses `psselect' from the psutils package. (removeAllPages): Removed. (createImage): Updated. Handle progress display. (char_buffer::do_html, char_buffer::do_image) [DEBUGGING]: Removed. (scanArguments): Add option -p. (makeTempFiles): Updated to create temp files for psPageName and imagePageName. (removeTempFiles): Removed. (main): Updated. * src/devices/grohtml/post-html.cc (header_desc::write_headings, html_printer::write_header): Append `\0' to `buffer'. (html_printer::do_eol): Depend on `current_paragraph->emitted_text'. (main): Handle -p. * src/devices/grohtml/html-text.cc (html_text::dump_stack_element): Handle `text_emitted'. (html_text::table_is_void): Slightly rewritten. (stop): New external symbol. (html_text::do_push) [DEBUGGING]: Use it and simplify. (html_text::shutdown): Call `dump_stack'. (html_text::do_space): Rewritten. * src/devices/grohtml/grohtml.man: Document -p and the need of `psselect'. * tmac/www.tmac (DC, HTML-DO-IMAGE, HTML-IMAGE-END): Updated to new \O syntax. Call \O[0] if `ps4html' is active. * tmac/s.tmac (@EQ, @EN): Handle html better. (@TS, TE): Ditto. * tmac/html.tmac: Don't use black for background colour. * src/roff/troff/node.cc: Include `div.h'. (troff_output_file::really_print_line): Don't use `is_on'. (troff_output_file::word_marker, troff_output_file::flush_tbuf troff_output_file::check_charinfo, troff_output_file::put_char_width, troff_output_file::put_char, troff_output_file::determine_line_limits, troff_output_file::draw, real_output_file::begin_page, glyph_color_node::tprintf, fill_color_node::tprint, hline_node::tprint, vline_node::tprint): Use `is_on'. (troff_output_file::really_on): Call `do_motion'. (suppress_node::tprint): Use `get_page_number' instead of `%' register. Call `reset_output_registers' conditionally on `is_on'. * doc/groff.texinfo: Document new syntax of \O. * NEWS, man/groff_diff.man: Updated.
* * doc/Makefile (clean): Add *.eps.wlemb2002-02-171-22/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (MEMACROS): Removed. (TFLAG): New variable. (TROFF): Use it. Add -ww. (GROFF): Use TFLAG, FFLAG, -U, -p, -e, -t, and -ww. (.me.dit): Fixed. (.ms.html, .ms.ascii, .ms.ps, homepage.html): Simplify. * tmac/www.tmac: Use dummy diversion while resetting and disabling `.tl'. * tmac/e.tmac: Inserted some more `\"' to remove warnings if used unstripped. * src/roff/troff/troff.man: Fix order of parameter description. * NEWS: Updated. Simplify image handling for grohtml. Fix <p> bug. * src/devices/grohtml/html-text.cc (DEBUGGING): Don't undefine but comment out. (html_text::dump_stack): Don't emit newline while debugging. (html_text::do_push) [DEBUGGING]: Print more info. (html_text::check_emit_text): Fix handling of <p>. * src/devices/grohtml/html.h: Updated. * src/devices/grohtml/output.cc (FPUTC, FPUTS, PUTC): New macros, replacing `fputc', `fputs', `putc'. If DEBUGGING is defined, they send its data to stderr also. Update all callers. (simple_output::space_or_newline) [DEBUGGING]: Removed. * src/devices/grohtml/post-html.cc (html_printer::do_links, html_printer::html_printer): Remove `DEBUGGING' conditionals. * src/include/html-strings.h (HTML_IMAGE_{CENTERED,LEFT,RIGHT,END}): Removed. * src/libs/libgroff/htmlhint.cc (is_in_graphic_start, is_inline_image): Removed. (html_begin_suppress, html_end_suppress): Don't take a parameter. (graphic_start, graphic_end): Removed. * src/include/htmlindicate.h: Updated. * src/preproc/html/pre-html.cc (DEBUG_HTML): Removed. (macroset_template): New global variable. (makeFileName): Use `macroset_template'. (write_end_image): Don't take a parameter. Don't emit newline. (write_start_image: Don't emit newline. (char_buffer::write_upto_newline): Updated. (char_buffer::skip_to_newline): Renamed to ... (char_buffer::skip_until_newline): This. Fix code. (char_buffer::write_file_troff, char_buffer::write_file_html): Simplified. (createAllPages, createImage) [DEBUGGING]: Handle `debug' flag. (removeAllPages): Remove `DEBUGGING' conditionals. (addRegDef, dump_args): New functions. (char_buffer::do_html, char_buffer::do_image): Handle `www-image-template' command line variable. Add more debugging code. (addps4html): Removed. (removeTempFiles) [DEBUGGING]: Handle `debug' flag. * src/preproc/eqn/main.cc: Include `ctype.h'. (suppress_html): Removed. (do_file): Updated. (inline_equation): Use `html_begin_suppress' and `html_end_suppress'. * src/preproc/pic/troff.cc: Don't include `htmlindicate.h'. (troff_output::start_picture, troff_output::finish_picture): Updated. * src/preproc/tbl/main.cc: Don't include `htmlindicate.h'. (process_input_file): Updated. * src/roff/troff/div.cc (page_number): Set page number only if the `ps4html' register isn't defined. * src/roff/troff/input.cc (image_no): New external variable. (do_suppress): Use it. * src/roff/troff/node.h (suppress_node::image_id): New member. * src/roff/troff/node.cc (image_no): Remove `static' keyword. (suppress_node::suppress_node): Initialize `image_id' member. (suppress_node::same): Handle `image_id' also. (suppress_node::copy): Updated. (last_image_id): New global variable. (suppress_node::tprint): Use it. * tmac/an-old.tmac (TS, TE, EQ, EN): Use HTML-IMAGE and HTML-IMAGE-END. * tmac/pspic.mac (PSPIC): Fix html support. * tmac/s.tmac (@EQ, @EN, @TS, TE, PS, PE): Ditto. * tmac/www.tmac (www-image-template): Set up. (HTMLINDEX): Renamed to... (HX): This. (BODYCOLOR): Renamed to... (BCL): This. (BACKGROUND): Renamed to... (BGIMG): This. (URL): Change order of parameters for consistency. (MAILTO): Renamed to... (MTO): This. (IMAGE, PNG-IMAGE, MARGIN-PNG-IMAGE): Renamed to... (IMG, PIMG, MPIMG): This. (HTML-H-BEGIN, HTML-H-END): Renamed to... (HnS, HnE): This. (LINKS): Renamed to... (LK): This. (LINE): Renamed to... (HR): This. (NO-AUTO-RULE): Renamed to... (NHR): This. (HTML-TL): Renamed to... (HTL): This. (UL-BEGIN, UL-END): Renamed to... (ULS, ULE): This. (DROPCAP): Renamed to... (DC): This. (TS, TE, EQ, EN): Provide default definitions. (www-make-unique-name): Updated. (HTML-IMAGE-INLINE): Fix typo. * tmac/groff_www.man: Updated. * doc/Makefile (homepage.html): Add option -r to grohtml. Use shortened image name. * doc/groff.texinfo: Updated info on grohtml strings and macros. * doc/homepage.ms: Updated and extended.
* * src/roff/troff/troff.man: Remove superfluous line.wlemb2001-09-051-2/+3
| | | | | | * tmac/s.tmac, contrib/mm/m.tmac: Enable all warnings only if no -W or -w option is given on the command line (or rather, if only the default warnings are set).
* * src/libs/libgroff/tmpname.cc: New file, defining get_tempname().wlemb2001-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * src/libs/libgroff/mkstemp.cc: New file. * src/libs/libgroff/mksdir.cc: New file. * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. (xtmpfile) [!HAVE_MKSTEMP]: Removed. * src/libs/libgroff/Makefile.sub: Updated. * src/include/lib.h: Add mksdir() prototype. * src/include/posix.h: Define S_IXUSR if not yet defined. * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. (createAllPages): Use mksdir() instead of current code. * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. (main): [!HAVE_MKSTEMP]: Removed. * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New macros. * configure.ac: Add tests for stdint.h, sys/time.h, and gettimeofday(). Call new GROFF_xxx macros. * configure: Regenerated. * Makefile.in: Comments updated.
* * src/devices/grohtml/grohtml.man: Updated manual page regardingwlemb2001-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simple anchor. * src/preproc/html/pre-html.cc (createImage): Fixed right hand cropping of images. (removeTempFiles): New function to tidy up temporary files. * src/preproc/html/pre-html.cc (main): Calls `removeTempFiles()'. Many fixes to do with the new inline suppress node and image regions are much tighter. * src/devices/grohtml/post-html.cc: New method `is_auto_img'. (generate_img_src): New function. (html_printer::do_auto_image): Utilizes it. (do_heading, do_title): Include inline images within their contents. (html_printer::begin_page): Tidied up comments that are issued to the html output file. (html_printer::do_fill): Fixed so that `.nf' works with fonts other than courier. (text_glob::is_br): New method used by do_heading. * tmac/s.tmac: If -Thtml then emit $1 in .IP rather than its equivalent diversion. * src/include/html-strings.h: Altered image tags to reflect the inline image node. * src/include/htmlindicate.h (html_end_suppress): Added `is_inline' parameter. * src/preproc/eqn/main.cc: Will suppress generation of image tags if it is already inside a pic image. Only emit tags if the argument `-Tps:html' is present. * src/preproc/tbl/main.cc: Changes to reflect additional `html_end_suppress' parameter. * src/roff/troff/env.cc: Only emit eol tag if a node has been emitted since the last eol tag was written. * src/roff/troff/env.h: New boolean `emitted_node'. * src/roff/troff/input.cc (do_suppress): Handles extra suppress nodes O3, O4, O5. No longer use `output_low_mark_miny'. * src/roff/troff/node.cc (check_charinfo): New method. (troff_output_file::determine_line_limits): Alterations to limit checking. * tmac/www.tmac: Changes to reflect new suppress nodes. * src/devices/grohtml/post-html.cc (html_printer::add_to_sbuf): Escape the html_glyph in the buffer. (str_translate_to_html): Output the unescaped escaped_char. * src/devices/grohtml/html-text.cc (issue_table_begin): Set `frame=void', not `frame=none'. Add `border=0'. * contrib/mm/groff_mm.man: Fixing some typos. * PROBLEMS: Add some words on how to avoid wrapper macros. * doc/groff.texinfo: Improve documentation of troff's -a option. Documentation for pic added (doc/pic.ms).
* * man/groff_font.man: Document `prepro', `postpro', and `print'.wlemb2001-03-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/roff/groff/groff.man: Improve documentation of `-l' and `-L'. * src/devices/grohtml/grohtml.man: Fixing typos. * tmac/s.tmac (@IP): Pass `.ip' html tag. * tmac/groff_mwww.man: Remove .LINE macro * tmac/www.tmac (LINE): Add `.ti'. * src/devices/grohtml/post-html.cc (html_printer): New member `indent'. (html_printer::emit_raw): Use it. (html_printer::do_linelength): Ditto. (html_printer::do_pageoffset): Ditto. (html_printer::do_indentation): Ditto. (html_printer::do_tempindent): Ditto. (html_printer::do_break): Ditto. (html_printer::begin_page): Ditto. (html_printer::do_indentedparagraph): New function. (html_printer::troff_tag): Handle `.ip'. * src/devices/grohtml/html-text.cc (html_text::issue_table_begin): Add `<td width=...>' handling. (html_text::do_table): Add parameter. (html_text::do_indent): Updated. * src/devices/groohtml/html-text.h: Updated.
* Introduced simple html tables to implement indentation.wlemb2001-03-161-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/devices/grohtml/html.h (word, word_list): New structures. (simple_output): Use it. * src/devices/grohtml/post-html.cc: Add `INDENTATION'. (html_printer): Improve indentation handling. (html_printer::emit_raw): Set `in_table' element. Handle indentation if set. (html_printer::write_header): Move conditional downwards. Don't allow whitespace in tags. (html_printer::do_linelength): Handle line length and indentation conditionally. (html_printer::do_pageoffset): Handle indentation conditionally. (html_printer::do_indentation): Ditto. (html_printer::do_tempindent): New function member. (html_printer::do_fill): Take care of indentation. (html_printer::do_flush): Finish table. (html_printer::do_links): Ditto. (html_printer::do_break): New function for handling `.br' and `.ti'. (html_printer::troff_tag): Use it. Handle `.ti'. (html_printer::flush_globs): Fix. (html_printer::flush_page): Finish table. (html_printer::html_printer): Fix error message. Set up `linelength'. (html_printer::add_to_sbuf): Remove special handling of character code 255. (to_unicode): Remove `stop()'. (html_printer::write_title): Cleanup. (html_printer::begin_page): Use `put_string()'. Handle indentation. (html_printer::~html_printer): Flush text and end the line. Use `put_string()'. * src/devices/grohtml/html_text.h: Add more *_TAG enum values. * src/devices/grohtml/html_text.cc (html_text::end_tag): Fix emission of tags. (html_text::start_tag): Disable newlines. (html_text::table_is_void): New function. (html_text::issue_table_begin): Ditto. (html_text::issue_table_end): Ditto. (html_text::push_para): Better table handling. (html_text::do_indent): New function. (html_text::do_table): Ditto. (html_text::done_table): Ditto. (html_text::do_tt): Handle PRE_TAG. (html_text::is_in_table): New function. (html_text::check_emit_text): Handle tables. (html_text::do_emittext): Use `nl()'. (html_text::do_para): Handle table. (html_text::remove_def): New function. * src/devices/grohtml/output.cc (word, word_list): Implement methods. (simple_output::end_line): Flush last word. (simple_output::simple_comment): Ditto. (simple_output::begin_comment): Recoded. (simple_output::end_comment): Ditto. (simple_output::comment_arg): Removed. (simple_output::check_newline): Improve test and flush last word. (simple_output::space_or_newline): Improved. (simple_output::write_newline): Replaced with... (simple_output::nl): This. (simple_output::put_raw_char): Flush last word. (simple_output::check_space): Removed. (simple_output::put_translated_string): Ditto. (simple_output::put_string): Simplified. (simple_output::put_number): Updated. (simple_output::put_float): Ditto. (simple_output::put_symbol): Removed. (simple_output::enable_newlines): Add `check_newline()'. (simple_output::flush_last_word): New function. * src/roff/troff/enc.cc (no_fill): Remove call to add_html_tag(). * src/roff/troff/div.cc (page_offset): Add call to add_html_tag(). * tmac/s.tmac (@PP, @IP): Add html conditional code. * tmac/an-old.tmac (TP): Ditto. * mdate.sh: Make it POSIX compliant.
* First cut of the new html device driver. Changes to pre-html andwlemb2001-01-171-7/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the new grohtml are too numerous to be documented here. Stuff related to `html' has been renamed to `html-old' and `html2' stuff has been renamed to `html' (including directories). The new html device driver is therefore invoked as `-Thtml'. Added new `O' escape to suppress output (needed by html driver). Added functions and code to pass info about input-level commands (`.in', `.fl', etc.) to html driver. Three new functions (.html-begin, .html-end, and .html-image) for better html handling: `html-begin' will execute the remaining line if at the outermost nesting level, increasing an internal counter. `html-end' does the same but decreases the internal counter. `html_image' puts its arguments into a special node (suppress_node) to define an image region. The `output' request has been removed. * tmac/html-tags.tmac: Removed. * tmac/arkup.tmac: Updated and renamed to ... * tmac/www.tmac: New file. * tmac/markup.tmac Updated and renamed to ... * tmac/mwww.tmac: New file. * tmac/Makefile.sub: Updated. * tmac/an-old.tmac: Updated. * tmac/eqnrc: Updated. * tmac/groff_man.man * tmac/groff_markup.man: Updated and renamed to ... * tmac/groff_mwww.man: New file. * tmac/groff_tmac.man: Updated. * tmac/html-old.tmac: Updated and Renamed from html.tmac. * tmac/html.tmac: Updated and renamed from html2.tmac. * tmac/pspic.tmac: Updated html support. * tmac/s.tmac: Added html output support. * tmac/troffrc, tmac/troffrc-end: Updated. * Makefile.in, doc/Makefile: Updated. * doc/groff.texinfo: Added info about new `O' escape. * doc/homepage.ms: Use `MAILTO' macro. * font/devhtml/DESC.proto: Add `C' font. * font/devhtml/Makefile.sub: Updated. * font/devhtml/R.proto: Minor fixes. * font/devhtml-old/Makefile.sub: Updated. * src/devices/grohtml-old/Makefile.sub: Updated. * src/libs/libdriver/printer.cc (printer::get_font_from_index): New method. * src/libs/libgroff/htmlindicate.cc (html_begin_suppress, graphic_start): Add `inline' parameter. Update. (html_end_suppress, graphic_end): Update. * src/include/html-strings.h: New file. * src/include/htmlindicate.h: Comments updated. * src/include/printer.h: Updated. * src/preproc/eqn/main.cc (do_file, main): Updated. * src/preproc/pic/troff.cc (troff_output::start_picture, troff_output::finish_picture): Updated. * src/preproc/tbl/main.cc (process_input_file): Updated. * src/roff/groff/groff.cc (main): Updated. Pass device arguments to predrivers also. Use `ps' device for `eqn' preprocessor if `-Thtml' is given. * src/roff/troff/env.h (environment): Updated. New elements `need_eol' and `ignore_next_eol' (for html output). * src/roff/troff/env.cc (environment::environment): Add initializers for `need_eol' and `ignore_next_eol'. (environment::add_html_tag_eol, environment::add_html_tag_tabs): New functions. (point_size, fill, no_fill, center, right_justify, line_length, indent, temporary_indent, break_request, handle_tab): Use `add_html_tag()'. (set_tabs): Use `add_html_tag_tabs()'. (environment::add_html_tag): Updated. (environment::do_break): Updated. * src/roff/troff/div.cc (space_request, flush_output): Use `environment::add_html_tag()'. * src/roff/troff/input.cc: Updated. New variable `html_level' to indicate nested `html-begin' requests. (file_iterator::fill): Use `environment::add_html_tag_eol()'. (non_interpreted_char_node, token_node, non_interpreted_node): Add `force_tprint()' method. (token::next): Handle `O'. (do_suppress): Implement it. (html_begin, html_end, html_image): New functions. (init_output_requests): Renamed to ... (init_html_requests): this. (main): Use it. (macro::append_str, macro::append_unsigned, macro::append_int): New methods. New variable `output_low_mark_miny' to limit minimal value of y. (reset_output_registers): Use it. (output_request): Removed. (get_output_registers): New function. * src/roff/troff/node.h (node): Make `force_tprint()' virtual. (*_node): Added `force_tprint()' if necessary. (special_node): New elements `tf' and `get_tfont()'. (suppress_node): New class. * src/roff/troff/node.cc: New global variables `image_no' and `suppress_start_page'. (real_output_file): New method `is_on()'. (troff_output_file): New method `start_special(tfont)'. (troff_output_file::really_print_line): Use `tprint' conditionally. (real_output_file::print_line): Updated. (real_output_file::on): Updated. (*_node): Added `force_tprint()'. (special_node::special_node): Initializer updated. (special_node::same, special_node::copy, special_node::tprint_start): Updated. (get_reg_int, get_reg_str): New functions. (suppress_node::*): New methods. New global variables last_position, last_image_filename; (min): New inline function. * src/roff/troff/reg.h, src/roff/troff/request.h, src/roff/troff/troff.h: Updated.
* * src/preproc/eqn/Makefile.sub (MAN1): Added neqn.man.wlemb2000-12-131-2/+2
| | | | | | | | | | | | | | | | | * src/preproc/eqn/neqn.man: Small fixes and additions. * src/utils/addftinfo/addftinfo.man, src/devices/grops/grops.man: Fixing typo. * src/preproc/eqn/neqn.man: New file. * src/preproc/tbl/table.cc (table::print): Fix `indent cannot be negative' warning. * tmac/e.tmac: Add `.T&' macro. Fix `indent cannot be negative' warning. * tmac/s.tmac: Fix `indent cannot be negative' warning.
* Convert macros `tmac.XXX' to `XXX.tmac'. Special cases:wlemb2000-10-261-0/+1872
tmac.doc.old -> doc-old.tmac tmac.an.old -> an-old.tmac * tmac/tmac.*: Moved to ... * tmac/*.tmac: this. * tmac/man.local: Fix comment. * tmac/groff_man.man, tmac/groff_markup.man, tmac/groff_mdoc.man, tmac/groff_me.man, tmac/groff_ms.man, tmac/groff_tmac.man: Updated. Added some `FILES' sections. More use of @...@ directives. Other minor updates. * arch/djgpp/README, font/devutf8/NOTES: Updated. * doc/homepage.ms, doc/groff.texinfo: Updated. * man/groff.man, man/roff.man: Updated. * src/devices/grodvi/grodvi.man, src/devices/grolbp/grolbp.man, src/devices/grolj4/grolj4.man, src/devices/grops/grops.man, src/devices/grotty/grotty.man: Updated. * src/preproc/pic/pic.man: Updated. * src/roff/grog/grog.pl, src/roff/grog/grog.sh: Use -mdoc-old instead of -mdoc.old. * src/roff/grog/grog.man: Document -mdoc and -mdoc-old. * src/roff/nroff/nroff.man: Updated. * NEWS: Updated. * tmac/fixmacros.sed, tmac/strip.sed: Add explanatory comment. * tmac/mm.diff: Removed -- it has no use now since the mm package is part of groff. * tmac/*: Removed trailing spaces. * arch/djgpp/t-groff.bat: Fix GROFF_TMAC_PATH (hyphen.us is now in the tmac subdirectory also).