summaryrefslogtreecommitdiff
path: root/Build/source/utils/texi2html/doc/texi2html.info-2
blob: 7ca7887deb8ea1512a6a97adf2f88ea5af04df3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
This is texi2html.info, produced by makeinfo version 4.5 from
texi2html.texi.

Copyright (C) 1999, 2000, 2001, 2002, 2003                        Free
Software Foundation, Inc.

Portions  
of        
`texi2html'
          Copyright (C) 1999, 2000 Lionel Cons
          Copyright (C) 1999, 2000 Karl Berry
          Copyright (C) 1999, 2000 Olaf Bachmann
          Copyright (C) 2002, 2003 Patrice Dumas
          Copyright (C) 2001, 2002, 2003 Derek Price
          Copyright (C) many others.


Portions  
of this   
manual    
          Copyright (C) 1999, 2000 Karl Heinz Marbaise (manual)
          Copyright (C) 2003 Patrice Dumas (manual)
          Copyright (C) 2003 Derek Price (manual)
   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Free Software Foundation.
INFO-DIR-SECTION Texinfo documentation system
START-INFO-DIR-ENTRY
* Texi2HTML: (texi2html).  Texinfo to HTML Converter.
END-INFO-DIR-ENTRY

   This file, last updated 1 February 2005, documents the `texi2html'
script which converts Texinfo (http://www.texinfo.org) into HTML
(http://w3c.org).  This edition is for `texi2html' version 1.76.

Copyright (C) 1999, 2000, 2001, 2002, 2003                        Free
Software Foundation, Inc.

Portions  
of        
`texi2html'
          Copyright (C) 1999, 2000 Lionel Cons
          Copyright (C) 1999, 2000 Karl Berry
          Copyright (C) 1999, 2000 Olaf Bachmann
          Copyright (C) 2002, 2003 Patrice Dumas
          Copyright (C) 2001, 2002, 2003 Derek Price
          Copyright (C) many others.


Portions  
of this   
manual    
          Copyright (C) 1999, 2000 Karl Heinz Marbaise (manual)
          Copyright (C) 2003 Patrice Dumas (manual)
          Copyright (C) 2003 Derek Price (manual)
   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Free Software Foundation.

File: texi2html.info,  Node: Customizing header,  Next: Customizing section,  Prev: css,  Up: Changing the page layout

Customizing the page header
===========================

   It is possible to add lines to the text within the `<head>' HTML
elements, by defining the variable `$EXTRA_HEAD'.  Similarly it is
possible to add text just after the `<body>' element with the variable
`$AFTER_BODY_OPEN'.  These variables are empty by default.

   The encoding of the texinfo file is defined by `$DOCUMENT_ENCODING'
if no `@documentencoding' appears in the document.  The default is a
`en-ascii' encoding.  The encoding of the resulting document is defined
by `$ENCODING'. The default is the `$DOCUMENT_ENCODING'.

   The description of the document may be specified in
`$DOCUMENT_DESCRIPTION'. If this variable is undef, the text associated
with `@documentdescription' is used, and if there isn't such test a
default description is constructed using the document title and the
name of the first section of the file.

   The `<body>' element attributes may be set by defining the variable
`$BODYTEXT'. If you want to define that variable dynamically, you
should use the `init_out' function reference (*note Output
initialization::).

   The default functions call the function associated with
`$print_head_navigation' to format the navigation panel for the page
header. Thus you can control parts of the formatting by redefining the
function reference.

 - Function Reference: print_head_navigation $filehandle \@buttons
     $FILEHANDLE is the opened filehandle the function should write to.
     \@BUTTONS is an array reference which should hold the
     specification of the buttons for the navigation panel.

   If you want even more control, you can have full control over the
page header formatting by redefining three function references. The
function associated with `$print_page_head' is called for all the
pages, and after that, the function associated with
`$print_chapter_header' is called if the document is split at chapters,
or the function associated with `$print_section_header' is called if
the document is split at sections.

 - Function Reference: print_page_head $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function should print the page head, including the `<body>'
     element.

 - Function Reference: print_chapter_header $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function is called if the document is split at chapters, after
     `print_page_head'.

 - Function Reference: print_section_header $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function is called if the document is split at sections, after
     `print_page_head'.


File: texi2html.info,  Node: Customizing section,  Next: Customizing footer,  Prev: Customizing header,  Up: Changing the page layout

Customizing the sections
========================

   The functions associated with the following function references are
used for the formatting of sections:

 - Function Reference: print_section $filehandle $first_in_page
          $previous_is_top
     $FILEHANDLE is the opened filehandle the function should write to.
     $FIRST_IN_PAGE is true if this section is the first section in the
     page.  $PREVIOUS_IS_TOP is true if this section is the section
     following the Top section.  This function should print the current
     section.

 - Function Reference: end_section $filehandle
          $last_element_or_before_top
     $FILEHANDLE is the opened filehandle the function should write to.
     $LAST_ELEMENT_OR_BEFORE_TOP is true if this section precedes the
     top element or is the last one in page, or before the special
     elements.


File: texi2html.info,  Node: Customizing footer,  Next: Special pages,  Prev: Customizing section,  Up: Changing the page layout

Customizing the page footer
===========================

   It is possible to add text just before the `</body>' element with
the variable `$PRE_BODY_CLOSE'. Nothing is added by default.

   The default functions call the function associated with
`$print_foot_navigation' to format the navigation panel for the page
footer. Thus you can control parts of the formatting by redefining the
function reference.

 - Function Reference: print_foot_navigation $filehandle \@buttons
     $FILEHANDLE is the opened filehandle the function should write to.
     \@BUTTONS is an array reference which should hold the
     specification of the buttons for the navigation panel.

   If you want even more control, you can have full control the page
footer formatting by redefining three function references.  The
function associated with `$print_chapter_footer' is called if the
document is split at chapters, or the function associated with
`$print_section_footer' is called if the document is split at sections.
After that the function associated with `$print_page_foot' is called.

 - Function Reference: print_page_foot $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function should print the page foot, including the `</body>'
     element.

 - Function Reference: print_chapter_footer $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function is called if the document is split at chapters,
     before `print_page_foot'.

 - Function Reference: print_section_footer $filehandle
     $FILEHANDLE is the opened filehandle the function should write to.
     This function is called if the document is split at sections,
     before `print_page_foot'.


File: texi2html.info,  Node: Special pages,  Next: File names,  Prev: Customizing footer,  Up: Changing the page layout

Special pages formatting
========================

   For the special elements, two things must be formatted: the content
and the page layout

* Menu:

* Special pages content::
* Special pages layout::


File: texi2html.info,  Node: Special pages content,  Next: Special pages layout,  Up: Special pages

Customizing the content of the special pages
--------------------------------------------

* Menu:

* Top element text::
* Contents and Overview text::
* Footnotes text::
* About text::


File: texi2html.info,  Node: Top element text,  Next: Contents and Overview text,  Up: Special pages content

Top element text formatting
...........................

   The top element formatting is controlled by three function which also
controls the layout of the top element page or section. The associated
function references are:

 - Function Reference: print_Top_header $filehandle $begin_page
     $FILEHANDLE is the opened filehandle the function should write to.
     $BEGIN_PAGE is true if the element is the first in a page.  This
     function should begin the Top element. At the time this function
     is called the top element text hasn't been parsed.

 - Function Reference: print_Top $filehandle $has_top_heading
     $FILEHANDLE is the opened filehandle the function should write to.
     $HAS_TOP_HEADING is true if there is a `@heading' command or
     `@titlefont' command appearing in the Top element text.  This
     function should be used to format the Top element text and
     navigation panel.

 - Function Reference: print_Top_footer $filehandle $end_page
     $FILEHANDLE is the opened filehandle the function should write to.
     $END_PAGE is true if the element is the last in a page.  This
     function should end the Top element.


File: texi2html.info,  Node: Contents and Overview text,  Next: Footnotes text,  Prev: Top element text,  Up: Special pages content

Table of contents and Short table of contents
.............................................

   Several variables may be used to control the formatting of table of
contents and short table of contents:

`$DO_CONTENTS'
     If the variable is true a table of contents is done even if there
     is no `@contents' command.

`$DO_SCONTENTS'
     If the variable is true a short table of contents is done even if
     there is no `@summarycontents' command.

`$BEFORE_OVERVIEW'
     The variable value is inserted before the short table of contents
     text.

`$AFTER_OVERVIEW'
     The variable value is inserted after the short table of contents
     text.

`$BEFORE_TOC_LINES'
     The variable value is inserted before the table of contents text.

`$AFTER_TOC_LINES'
     The variable value is inserted after the table of contents text.

`$TOC_LIST_STYLE'
     This should contain a css style used for the list style if the
     tables of content are formatted with a list.

`$TOC_LIST_ATTRIBUTE'
     This should contain an attribute text used for the list element if
     the tables of content are formatted with a list.

   More control on the table of contents and short table of contents
formatting may be achieved by redefining a function with the following
associated function reference:

 - Function Reference: toc_body \@elements
     \@ELEMENTS is an array reference contining informations about all
     the elements of the document. Each of the entry of this array is
     an hash reference which entries correspond with different
     informations about the element. Interesting keys have the
     following meaning:

    `top'
          true if the element is the top element,

    `index_page'
          true if the element is an index page added because of index
          splitting,

    `toc_level'
          level of the element in the table of content. Highest level
          is 1 for the top element and for chapters, appendix and so on,
          2 for section, unnumberedsec and so on...

    `tocid'
          label used for reference linking to the element in table of
          contents,

    `file'
          the file containing the element, usefull to do href to that
          file in case the document is split,

    `text'
          text of the element, with section number,

    `name'
          text of the element, without section number.

     This function doesn't return anything but should fill the array
     corresponding with the `$Texi2HTML::TOC_LINES' and
     `$Texi2HTML::OVERVIEW' references with the table of contents and
     short table of contents.



File: texi2html.info,  Node: Footnotes text,  Next: About text,  Prev: Contents and Overview text,  Up: Special pages content

Formatting of footnotes text
............................

   The footnotes text is allready formatting when `@footnote' commands
are expanded. *Note Footnotes::.


File: texi2html.info,  Node: About text,  Prev: Footnotes text,  Up: Special pages content

Formatting of about text
........................

   The default about element contains an explaination of the buttons
used in the document (`@SECTION_BUTTONS', *Note Button
specifications::) and an example locating the buttons targets in an
example.  The formatting of this text may be influenced by the following
hashes and variables:

`$PRE_ABOUT'
`$AFTER_ABOUT'
     This variable may be a scalar or a function reference.  If it is a
     scalar, the value is used.  If this is a function reference it is
     expanded and the returned text is used. The text is added before
     or after the main about text.

`%BUTTONS_GOTO'
     The keys of this hash are element labels (*note Element labels::).
     The value is the text associated with the element label in the
     about text.  The element of the hash are defined dynamically, you
     should in the `init_out' function reference (*note Output
     initialization::).

`%BUTTONS_EXAMPLE'
     The keys of this hash are  element labels (*note Element
     labels::). The value is the text associated with the element label
     in the about example, typically a section number.


   If this is not enough and you want to control exactly the formatting
of the about text, you can redefine the function associated with the
following function reference:

 - Function Reference: $about_text print_about
     This function should return the about text.


File: texi2html.info,  Node: Special pages layout,  Prev: Special pages content,  Up: Special pages

Customizing the layout of the special pages
-------------------------------------------

   The formatting of each of the special pages, or section in case the
document is not split, is controlled by a function.  The associated
function reference is called accordingly:

`print_Top'

`print_Top_header'

`print_Top_footer'
     Formatting of top element page or section. It is also used for the
     formatting of the top element text (*note Top element text::).

`print_Toc'
     Formatting of table of contents page or section

`print_Overview'
     Formatting of short table of contents page or section

`print_About'
     Formatting of about (help) page or section

`print_Footnotes'
     Formatting of footnotes section or page in case footnotes are on a
     separated page or the document isn't split.

   In the default case, `$print_Top' calls `$print_Top_header' for the
header and `$print_Top_footer' for the footer of top element.  All the
other function call `$print_misc' which in turn calls
`$print_misc_header' for the headers and  `$print_misc_footer' for the
footers.


File: texi2html.info,  Node: File names,  Next: External index files,  Prev: Special pages,  Up: Changing the page layout

Customizing the file names
==========================

   It is possible to specify the file names with more control than with
the command line options (*note Output files::).  First the extension
may be overrided by the variable `$EXTENSION' value.  Two function
references enable further customization. One is usefull in case
`$NODE_FILES' is true and it is used to customize the node file name
itself and is also used to produce a file name with a redirection
leading to the node file.

 - Function Reference: ($node_file $redirection_node_file)
node_file_name $node
     $NODE is a hash reference with the following interesting keys
     (there are much more keys):
    `texi'
          The texinfo node name.

    `with_section'
          True if associated with a section.
     The result is the node file name $NODE_FILE, and the file
     containing a redirection to the node $REDIRECTION_NODE_FILE.

   The other is usefull if `$NODE_FILES' isn't true. It is used to
customize the file associated with each element.

 - Function Reference: $file element_file_name $element $is_top
          $docu_name
     $ELEMENT is a hash reference with the following interesting keys
     (there are much more keys):
    `texi'
          The texinfo element name.

    `number'
          The number associated with a section.

    `doc_nr'
          A number incremented whenever a new file should begin, based
          on how the document is split (*note Splitting output::).

    `text'
          The element text.

    `name'
          The element text without section number.
     $IS_TOP is true if the element is considered as the top element.
     $DOCU_NAME is the basename of the texinfo manual.  The result is
     the element file name.


File: texi2html.info,  Node: External index files,  Prev: File names,  Up: Changing the page layout

Generation of external files for index entries
==============================================

   Within the document, `@printindex' commands are expanded as explained
in *Note Index list::. In case you want to do something special with
index entries, outside of the document, you should first set the
variable `$IDX_SUMMARY' true. After that some function reference will
be called for each non empty index. For each index there are 3 function
references, one called for initialization, one called for each index
entry and the last one called for finalazation.

 - Function Reference: index_summary_file_begin $index_name $is_printed
     $INDEX_NAME is the two letters name for the index.  This function
     is called for each index appearing in the document, before
     `index_summary_file_entry'.  $IS_PRINTED is true if there is a
     `@printindex' for that index.

 - Function Reference: index_summary_file_entry $index_name $entry_text
          $entry_reference $formatted_entry $texi_entry
          $entry_element_reference $entry_element_header $is_printed
     This function is called for each entry of an index. INDEX_NAME is
     the name of the index. $ENTRY_TEXT is the entry in plain text,
     $FORMATTED_ENTRY is the index entry formatted, $TEXI_ENTRY is the
     entry with texinfo commands. $ENTRY_REFERENCE is the reference
     placed at the index entry place, in the form `file#id'.
     $ENTRY_ELEMENT_HEADER is the formatted header of the element
     containing the index entry. ENTRY_ELEMENT_HEADER is the reference
     to the beginning of the element containing the index entry, in the
     form `file#id'.  $IS_PRINTED is true if there is a `@printindex'
     for that index.

 - Function Reference: index_summary_file_end $index_name $is_printed
     $INDEX_NAME is the two letters name for the index. This function
     is called for each index appearing in the document, after
     `index_summary_file_entry'.  $IS_PRINTED is true if there is a
     `@printindex' for that index.


File: texi2html.info,  Node: Customizing HTML,  Next: Internationalization,  Prev: Changing the page layout,  Up: Top

Customizing HTML and text style in init files
*********************************************

   Some simple customization may be achieved with the redefinition of
the variables associated with the command line options. For the
description and an explanation of the meaning of these variables, *Note
Style options::.

   Other variables and hash entries can be modified in initialization
file to achieve more customization.  Lastly, functions references
corresponding with functions called from the main program and
initialization files may be redefined.

* Menu:

* Three contexts::               there are three different contexts for command
                                 expansion: normal text, preformatted text and
                                 strings.
* Commands without argument::
* Style and accent commands::
* Anchors images and spaces::    Formatting of `@anchor', `@image', `@sp', `@acronym', `@abbr'
* Text::                         Some characters are processed specially
* Strings::                      `texi2html' write some strings in the output
                                 different for each languages
* References::
* Alignement commands::           `@center', `@flushleft'...
* Paragraph and preformatted region::
* Complex formats::              `@example', `@display'...
* Lists tables::
* Definitions::
* Headings::
* Special regions::              `@verbatim', `@cartouche', `@quotation'
* Menus::
* Indices::
* Floats and lists of floats::   `@float' and `@listoffloats'
* Footnotes::
* Other and unknown commands::   You can handle specifically other commands


File: texi2html.info,  Node: Three contexts,  Next: Commands without argument,  Up: Customizing HTML

Three contexts for expansions: preformatted, normal and string
==============================================================

   There are three contexts of interest, one is the normal context, the
other is a special context, called the "preformatted" context and the
last is the string context. The preformatted context occurs when the
spacing between words is kept. This is the case, for example, in
`@display' or `@example' regions, and in menu comments (*note Menus::).
The preformatted regions are usually rendered in `<pre>' elements in
HTML.  The string context occurs when rendering strings without
formatting elements, in comments or titles for example.


File: texi2html.info,  Node: Commands without argument,  Next: Style and accent commands,  Prev: Three contexts,  Up: Customizing HTML

Customizing the formatting of commands without argument
=======================================================

   This includes the commands whose name is a nonletter character like
`@@', the commands with lettered characters and braces but whose braces
should be empty, like `@TeX{}', or some commands associated with
accentted letters like `@AA{}'. If there happens to be something within
the braces, it is put after the command, thus
     @TeX{something}
   leads to the same than
     @TeX{} something

   Each of these categories of commands have three associated hashes,
one for normal context, the other for preformatted context and the last
in strings. The keys of the hashes are the command names, the
associated value is the text replacing the command.

   The hashes are:
command type                normal text   preformatted text   string
one nonlettered character   `%simple_map' `%simple_map_pre'   `%simple_map_texi'
nothing in braces           `%things_map' `%pre_map'          `%texi_map'

   To change the HTML resulting from these constructs, just change the
value. For example, if you want `&shy;' to be outputted for `@-' in
normal and preformatted context, write in your init file:

     $simple_map{'-'} = '&shy;';
     $simple_map_pre{'-'} = '&shy;';


File: texi2html.info,  Node: Style and accent commands,  Next: Anchors images and spaces,  Prev: Commands without argument,  Up: Customizing HTML

Customizing accent, style and other simple commands
===================================================

   The formatting of the HTML produced by style and indicatric commands
(`@tt', `@code', `@email', `@titlefont'), the accentuation related
commands taking argument (`@'', `@udotaccent', `@dotless') and
miscalleneous commands (`@email', `@verb', `@w', `@uref', `@math',
`@asis') is controlled by two hash in the default case, `%style_map'
for normal context, `%style_map_pre' for preformatted context and
`%style_map_texi' in string context.

   The key of the hashes are the command names. There are two
possibilities for the values corresponding with two interfaces. The
values may be strings or hash references, and you can chose the
interface depending on the one you prefer. The interface with hash
reference is a bit more flexible but might also be regarded as more
complex. If you don't like either of these interfaces you can define
your own.

   Some remarks are in order:

   * The nonlettered accent commands which following character is
     considered to be the argument (like in `@`a') should be keys of the
     hash `%accent_map' hash, even if no value is associated.

   * `@math' is handled differently if LaTeX2HTML is used.

* Menu:

* Hash reference interface::
* String interface::
* Define your own interface::


File: texi2html.info,  Node: Hash reference interface,  Next: String interface,  Up: Style and accent commands

An interface for commands formatting with a hash reference
----------------------------------------------------------

   The key of the hashes are the command names. The value determine how
the command argument is formatted. This value is a reference on a hash.
In this hash each key corresponds with a type of information for the
formatting, and the value is the corresponding information. For
example, in

     $style_map{'command'} = { 'args' => ['code'], 'attribute' => 'code'};

   the arguments for `@command' are interpreted as specified by the
values associated with the `args' key while the attribute associated
with that command is `code'.

   The following keys in the hashes associated with each command have
the following meaning:

`args'
     The value associated is a reference on an array. Each element of
     the array defines how the arguments (separated by `,' in the
     texinfo code) for the @-command should be formatted. The
     possibilities are
    `normal'
          for normal text,

    `code'
          for text with `---', `--', `''' and  ```' kept as is,

    `keep'
          if the texinfo should be kept as is, without interpretation
          of the @-commands.

     For example, we have
          $style_map{'email'}->{'args'} = ['code', 'normal'];

     because `---', `--', `''' and  ```' should be kept as is in the
     first argument of `@email'.

     The default is `['normal']'.

`attribute'
     If the associated value is a word, it is considered to be an HTML
     element name, and the argument is enclosed between the element
     opening and the element closing. For example, if the value is
     `elem', the resulting HTML is `<elem>ARG</elem>'.

     If the text is a word followed by some text, the word and is
     interpreted as above, and the text is considered to be the
     attributes text of the element.  Thus `elem class="elem"' leads to
     `<elem class="elem">ARG</elem>'.

     This works only if there is only one argument.

`begin'
     The associated value is added in front of the text.

`begin'
     The associated value is added after the text.

`quotes'
     If the corresponding value is true, the result is enclosed in
     quotes `$OPEN_QUOTE_SYMBOL' and `$CLOSE_QUOTE_SYMBOL', with
     defaults ``' and `''.

`function'
     The corresponding value should be a function reference. The
     corresponding function is called with the following arguments:

    `$command'
          The @-command name

    `$args'
          A reference on an array containing the arguments of the
          @-command.

    `$style_stack'
          A reference on an array containing the name of the @-commands
          containing the @-command being formatted.

    `$state'
          A reference on a hash containing a lot of informations about
          the context of the @-command.

    `$line_nr'
          An opaque structure containing the information about the line
          number of the @-command. It can be used to call
          `main::echo_error' or `main::echo_warning' with first
          argument a message, and second argument `$line_nr'.


File: texi2html.info,  Node: String interface,  Next: Define your own interface,  Prev: Hash reference interface,  Up: Style and accent commands

An interface for commands formatting with a string
--------------------------------------------------

   The keys of the hashes are the command names. The value determine
how the command argument is formatted. If the value begins with `"',
the result is enclosed in quotes `$OPEN_QUOTE_SYMBOL' and
`$CLOSE_QUOTE_SYMBOL', with defaults ``' and `''.

   The command argument is allready formatted as HTML.  The remaining
of the value text (or the value text if there were no `"') is
interpreted as follow:

   * If the text is empty the argument of the command is left as is.

   * If the text is a `&' followed by a name, like `&function', the
     name is considered to be a function name, and this function is
     called to format the argument of the command. The first argument
     of the function is the command name, the second is the command
     argument. For example, if the value associated with the
     (fictituous) command `@foo' is `&my_func' and we have:

          sub my_func
          {
              my @args = split /,\s*/ $_[1];
              return "$_[0]: $args[0]" if ($args[1] = 1);
              return "$args[0]";
          }

     The result of
          @foo{truc, 1}
          @foo{truc, bidule}
     will be
          foo: truc
          truc

   * If the text is a word, it is considered to be an HTML element
     name, and the argument is enclosed between the element opening and
     the element closing. For example, if the value is `elem', the
     resulting HTML is `<elem>ARG</elem>'.  Similarly `"quoted' leads to
     ``<quoted>ARG</quoted>''.

   * If the text is a word followed by some text, the word and is
     interpreted as above, and the text is considered to be the
     attributes text of the element.  Thus `elem class="elem"' leads to
     `<elem class="elem">ARG</elem>'.


File: texi2html.info,  Node: Define your own interface,  Prev: String interface,  Up: Style and accent commands

Defining the style and indicatric commands interface
----------------------------------------------------

   If you don't like this scheme, it is possible to change how those
commands are processed by redefining the following function reference:

 - Function Reference: $resulting_text style $style $command $text
          $args $no_close $no_open $line_nr $state $style_stack
     $COMMAND is the @-command, $STYLE is the value associated with the
     $COMMAND in the `%style_map', `%style_map_pre' or
     `%style_map_texi' hashes.  The $TEXT is the text appearing within
     the @-command braces.  ARGS is a reference on an array contening
     the command arguments formatted according to the same conventions
     than with the reference hash style (provided the value associated
     with the @-command is a hash reference with a $ARG key as
     described in *Note Reference hash args::).  If $TEXT is split in
     paragraphs each paragraph is passed through the function, and
     $NO_CLOSE is true if it is not the last paragraph, while $NO_OPEN
     is true if it is not the first paragraph.  $LINE_NR is an opaque
     structure containing the information about the line number of the
     @-command. It can be used to call `main::echo_error' or
     `main::echo_warning' with first argument a message, and second
     argument `$line_nr'.  $STATE is a reference on a hash containing a
     lot of informations about the context of the @-command.
     $STYLE_STACK is a reference on an array containing the name of the
     @-commands containing the @-command being formatted.



File: texi2html.info,  Node: Anchors images and spaces,  Next: Text,  Prev: Style and accent commands,  Up: Customizing HTML

Formatting of special simple commands
=====================================

   The formatting of special simple commands is controlled by
functions. To customize the output, the corresponding function
references should be redefined. All these functions return a formatted
text.

   The formatting of anchors is controlled by `$anchor', but the
function associated with the function reference does more, it is usefull
to produce a reference target or link.

 - Function Reference: $anchor anchor $identifier $href $text
          $attributes
     If $IDENTIFIER is not empty, this value should be used to create a
     target for links (typically associated with a name or id attribute
     in HTML).  The $HREF argument specifies a hpertextual reference
     which should be used to link to a target.  In case both
     $IDENTIFIER and  $HREF are given the text produced should be both
     a target for $IDENTIFIER and a link to $HREF.  $TEXT is the text
     to be displayed.  $ATTRIBUTES are additional attributes.  It
     should be reasonable to assume that the attributes are for a `<a>'
     HTML element.

   The formatting of `@image' is controlled by:

 - Function Reference: $image image $file_path $basename $preformatted
          $file_name
     $FILE_PATH is the image file name with the path, $BASENAME is the
     alternate text or the file name without extension if no alternate
     text is given. $PREFORMATTED is true if the image appears in
     preformatted text. $FILE_NAME is the file name without path but
     with extension.

   The formatting of `@sp' is controlled by:

 - Function Reference: $sp sp $number $preformatted
     $NUMBER is the numeric argument of `@sp'.  $PREFORMATTED is true
     if the `@sp' appears in preformatted text.

   The formatting of `@acronym' and `@abbr' is controlled by:

 - Function Reference: $acronym acronym_like $acronym_texi
          $acronym_text $with_explanation \@explanation_lines
          $explanation_text $explanation_simply_formatted
     $ACRONYM_TEXI is the acronym argument with texinfo @-commands,
     $ACRONYM_TEXT is formatted.

     The other arguments are related with the explanation, the second
     arg of the acronym. $WITH_EXPLANATION is true if the second
     argument of the acronym command is present. If an explanation
     exists, coming from previous `@acronym' or as an arg of this
     command, the other args are defined: \@EXPLANATION_LINES is a
     reference on an array containing the unformatted explanation lines,
     $EXPLANATION_TEXT is the explanation text formatted,
     $EXPLANATION_SIMPLY_FORMATTED is the explanation with a light
     formatting, unabling in HTML (or XML) the explanation to be in an
     attribute.


File: texi2html.info,  Node: Text,  Next: Strings,  Prev: Anchors images and spaces,  Up: Customizing HTML

Processing special characters in text
=====================================

   Some characters are processed especially in text: `---', `--', ```'
and `'''. This is done only if in normal text and not in some commands
(`@code', `@env'...). A function reference is called to process those
characters in text

 - Function Reference: $processed_text normal_text $text
     The function processes `---', `--', ```' and `''' in $TEXT and
     returns $PROCESSED_TEXT. The default is to change `---' to `--',
     `--' to `-', and ```' and `''' to `"'.

   Some characters are special in HTML (`&', `"', `<' and `>') and
should be protected.  This is done by the function associated with the
function reference

 - Function Reference: $protected_text protect_text $text
     The function processes the unprotected text $TEXT and returns the
     resulting protected text $PROTECTED_TEXT.

   Empty lines are processed by the following function reference, which
could be usefull if empty lines are to be removed for example

 - Function Reference: $resulting_text empty_line $empty_line
     This function processes an $EMPTY_LINE and returns the resulting
     text $RESULTING_TEXT. Empty lines are left as is by default.


File: texi2html.info,  Node: Strings,  Next: References,  Prev: Text,  Up: Customizing HTML

Customizing strings written by `texi2html'
==========================================

   `texi2html' writes some strings in the generated document at various
places, at the page footers, on the help page, for special section
headings, buttons alt text and so on. These strings are customizable.
The string chosen depends on the language of the document (set by
`--lang', `$LANG' or `@documentlanguage'). This is the basis for
internationalization as it allows for strings translations.

   The strings are found in a hash reference, `$LANGUAGES'.  Each key
is a language code. The associated value is also a hash reference. The
key is an english string and the associated value is the string
replacing the english string, if present. For example, we have

     $LANGUAGES->{'fr'} = {
                   ' Up ' => 'Plus haut',
     };

   It means that whenever the string ` Up ' is to be written and the
language is `fr', `Plus haut' is written. It is possible to customize
the english strings by redefining the `en' language hash.

   When a string contains a `%' followed by `{' NAME `}' it means that
the string will be expanded by `texi2html'. For example, if we have

     $LANGUAGES->{'fr'} = {
                   'See %{node_file_href}' => 'Voir %{node_file_href}',
     };

   `%{node_file_href}' will be expanded to an href for a node in a file
by `texi2html' in the string. A `%%' will be expanded as `%'.

   For more on internationalization, see *Note Internationalization::.


File: texi2html.info,  Node: References,  Next: Alignement commands,  Prev: Strings,  Up: Customizing HTML

References
==========

* Menu:

* Reference to external manual::
* Internal reference::


File: texi2html.info,  Node: Reference to external manual,  Next: Internal reference,  Up: References

Reference to external manual
----------------------------

   The references are produced with two function references, one for the
hypertextual reference construction, the other for the full reference to
external manual.

 - Function Reference: $href external_href $node $node_identifier
          $xml_node_identifier $manual_file_name
     $NODE is the node name, with @-commands. $NODE_IDENTIFER is the
     node name mapped to an identifier acceptable as a file name.
     $XML_NODE_IDENTIFIER is the node name mapped to an identifier
     acceptable as an XML identifier.  Those identifiers are built as
     explained in *Note HTML Xref: (texinfo)HTML Xref, thus allowing
     for cross references to external manuals. $FILE is the manual or
     file name of the external reference. This function should return an
     href leading to the external manual.

     The default for this function is to make a reference compatible
     with `makeinfo'  (*note HTML Xref: (texinfo)HTML Xref.).

 - Function Reference: $text external_ref $command $section $book
          $node_and_file $href $cross_ref_name
     This function formats a reference to an external texinfo manual.
     The $COMMAND is the ref command (`ref', `xref' or `pxref', in
     text, at sentence beginning or in parenthesis).  The optionnal
     $SECTION argument is the section in the book and  BOOK is the book
     title.  $NODE_AND_FILE is the node and file name formatted
     according to the convention used in info: `(file)node'. $HREF it
     an hypertextual reference to the distant manual constructed using
     the above function.  $CROSS_REF_NAME is an optionnal cross
     reference name appearing in the reference command. This function
     returns the text corresponding with the external html manual
     reference.  This function returns the full formatted text of the
     external reference.


File: texi2html.info,  Node: Internal reference,  Prev: Reference to external manual,  Up: References

Reference to an internal node
-----------------------------

   A function reference is available for internal references.

 - Function Reference: $text internal_ref $command $href $short_name
          $name $is_section
     This function formats a reference to a node in the current manual.
     The $COMMAND is the ref command (`ref', `xref' or `pxref', in
     text, at sentence beginning or in parenthesis).  $HREF it an
     hypertextual reference linking to the corresponding node or
     section. $SHORT_NAME and $NAME hold the text for the reference but
     $SHORT_NAME can be the node name which is assumed to be shorter
     than the section name.  $IS_SECTION is a boolean true if the
     reference is a reference to a section. This function returns the
     full formatted text of the internal reference.


File: texi2html.info,  Node: Alignement commands,  Next: Paragraph and preformatted region,  Prev: References,  Up: Customizing HTML

Commands used for centering and flushing of text
================================================

   When a command controlling the alignement of text is used (`@center',
`@flushleft' and `@flushright'), the main program takes care of opening
and closing paragraphs. The alignement commands are the key of the
`%paragraph_style' hash.  The value is used in the function doing the
formatting of the paragraphs.  *Note Paragraph and preformatted
region::.

   A function references allows for a customization of the formatting
of the text appearing in the command block.

 - Function Reference: $result paragraph_style_command $command $text
     $COMMAND is the command name, $TEXT is the text appearing within
     the command. This function returns a formatted text.  The default
     is to return the text unmodified.


File: texi2html.info,  Node: Paragraph and preformatted region,  Next: Complex formats,  Prev: Alignement commands,  Up: Customizing HTML

Formatting or not a paragraph or a preformatted region
======================================================

* Menu:

* Paragraph and preformatted formatting::
* Avoiding paragraphs::


File: texi2html.info,  Node: Paragraph and preformatted formatting,  Next: Avoiding paragraphs,  Up: Paragraph and preformatted region

Paragraph and preformatted region formatting
--------------------------------------------

   The formatting of a paragraph region or a preformatted region, is
controlled by function references:

 - Function Reference: $paragraph_text paragraph $text $alignement
          $formatting_command $formatting_command_formatted
          \$paragraph_number $format $item_number $enumerate_style
          $number
     This function formats a paragraph. $TEXT is the text of the
     paragraph, $ALIGNEMENT is the empty string when no alignement
     command has been seen, otherwise it is the current alignement
     command name.  *Note Alignement commands::.

     The remaining arguments are usefull when the paragraph appears
     within a list or table. It is usefull whenever the paragraph has
     to be formatted differently when appearing in such environments.
     Moreover in that case the format command (`@itemize'...)  may have
     an associated formatting command.  $FORMATTING_COMMAND is this
     formatting command (like `@minus').  $FORMATTING_COMMAND_FORMATTED
     is the command formatted in html in case the formatting command is
     a leading command (like `@minus') which should be leading the
     first paragraph.  \$PARAGRAPH_NUMBER is a reference on the number
     of paragraphs in that format command. The corresponding variable
     should be increased when a paragraph is added. $FORMAT is the
     format command.  *Note Table and list items::.

     If the $FORMAT is an enumerate, $ITEM_NUMBER is the number of the
     item in the list, $ENUMERATE_STYLE is the argument of the
     enumerate, $NUMBER is the number or letter corresponding with this
     item.

 - Function Reference: $preformatted_text preformatted $text $style
          $region_name $formatting_command
          $formatting_command_formatted \$preformatted_number $format
          $item_number $enumerate_style $number
     This function formats a preformatted region. $TEXT is the text of
     the preformatted region, $STYLE is the css style associated with
     that preformatted region (*Note css::). $REGION_NAME is the name
     of the command opening the preformatted region (`example'..., see
     *Note Complex formats::) or a identifier for the preformatted
     context (for example `menu-comment', see *Note Menus::).  The
     alignment commands are not taken into account, as the spaces are
     preserved in preformatted regions, you should flush and center by
     hand.

     The remaining arguments are usefull when the preformatted region
     appears within a list or table. It is usefull whenever the
     preformatted region has to be formatted differently when appearing
     in such environments.  Moreover in that case the format command
     (`@itemize'...)  may have an associated formatting command.
     $FORMATTING_COMMAND is this  formatting command (like `@minus').
     $FORMATTING_COMMAND_FORMATTED is the command formatted in html in
     case the formatting command is a leading command (like `@minus')
     which should be leading the first preformatted region.
     \$PREFORMATTED_NUMBER is a reference on the number of preformatted
     regions in that format command. The corresponding variable should
     be increased when a preformatted region is added. $FORMAT is the
     format command.  *Note Table and list items::.

     If the $FORMAT is an enumerate, $ITEM_NUMBER is the number of the
     item in the list, $ENUMERATE_STYLE is the argument of the
     enumerate, $NUMBER is the number or letter corresponding with this
     item.


File: texi2html.info,  Node: Avoiding paragraphs,  Prev: Paragraph and preformatted formatting,  Up: Paragraph and preformatted region

Avoiding paragraphs in formats
------------------------------

   It is possible to avoid that a format closes the previous paragraph
or preformatted region and reopens one, by putting the format command
in a hash, `%format_in_paragraph' with a true value.


File: texi2html.info,  Node: Complex formats,  Next: Lists tables,  Prev: Paragraph and preformatted region,  Up: Customizing HTML

Formatting of complex formats (`@example', `@display'...)
=========================================================

   Here we see how a whole complex format is formatted. For the
formatting of the text, see *Note Paragraph and preformatted region::.

   The formatting of the complex formats is ultimately controlled by a
function, however the default for this function uses a hash reference
and changing the hash reference values should be enough in most cases.
This hash reference is called `$complex_format_map'. It has a key for
each of the complex format commands (`example', `smallexample', `lisp',
`smalllisp', `display', `smalldisplay', `format', `smallformat').

   The associated value is also a reference on a hash. The keys are
`begin' and `end'. An eval of `begin' should lead to the beginning of
the formatted HTML, an eval of `end' should lead to the end of the
formatted HTML. The enclosed text will be formatted as described in
*Note Paragraph and preformatted region::, and the name of the complex
format will be available to the function formatting the text.

   If you aren't satisfied with this scheme, you can redefine the
following function reference for a better control over the complex
format formatting:

 - Function Reference: $complex_format_text complex_format $format_name
          $preformatted_text
     $FORMAT_NAME is the complex format name, $PREFORMATTED_TEXT is the
     text allready formatted as described in *Note Paragraph and
     preformatted region::.  This function returns the whole complex
     format.


File: texi2html.info,  Node: Lists tables,  Next: Definitions,  Prev: Complex formats,  Up: Customizing HTML

Customizing the formatting of lists and tables
==============================================

   The formatting of lists and tables is done at two levels:
   * At the level of the whole region (table or list),

   * At the level of the individual items, rows or cells of the list or
     table.

* Menu:

* Table and list items::
* Whole table list::


File: texi2html.info,  Node: Table and list items,  Next: Whole table list,  Up: Lists tables

Formatting individual table and list items
------------------------------------------

   In texinfo it is possible to give `@itemize' or table command
(hereafter called a "format command") a "formatting command".  For
example `@minus' is the formatting command here:
     @table @minus

   The default is to apply the command to the text item, however it is
possible to avoid it.  The hash `%special_list_commands' has an entry
for each of the format command. Each of these entries is a hash
reference. If a formatting command is a key of the hash reference, then
the formatting command is not applied to the text item for that format
command. For example, if we have:

     $special_list_commands{'itemize'} = { 'bullet' => '' };

   and we have the following `@itemize':
     @itemize @bullet
     @item an item
     @end itemize

   then `@bullet' will not be applied to `an item'.

_lists_
     The items of lists are formatted using the following function
     reference:

      - Function Reference: $list_item list_item $text $format $command
               $formatted_command $item_number $enumerate_style $number
          This function formats the text between `@item' commands. $TEXT
          is the text corresponding with the item. $FORMAT is the type
          of format, `itemize' or `enumerate'. $COMMAND is the
          formatting command given in argument to `@itemize',
          $FORMATTED_COMMAND is this command formatted if it is a
          leading command, like `@minus'.

          If the $FORMAT is an enumerate, $ITEM_NUMBER is the number of
          the item in the list, $ENUMERATE_STYLE is the argument of the
          enumerate, $NUMBER is the number or letter corresponding with
          this item.

_two column tables_
     The two columns tables (`@table', `@ftable' and `@vtable'), items
     are formatted using two function references, one for the first
     line located on the `@item' line corresponding with the first
     column, the other for the text appearing on the following lines,
     corresponding with the second column text.

      - Function Reference: $table_item table_item $item_text
               $index_label_text $format $command $formatted_command
          This function is used to format the text on the `@item' line.
          $TEXT_ITEM is the text line. In case there is an index entry
          associated with the `@item' (as with `@ftable' and
          `@vtable'), $INDEX_LABEL_TEXT is the text inserted at the
          place where an index entry appears. *Note Index entry place::.
          $FORMAT is the type of format, `table', `ftable' or `vtable'.
          $COMMAND is the formatting command given in argument to the
          table format command, $FORMATTED_COMMAND is this command
          formatted if it is a leading command, like `@minus'.

      - Function Reference: $table_line table_line $text
          This function is used to format the text on the lines
          following the `@item' line. $TEXT is the corresponding text.

_multitable_
     The multitable elements formatting is controlled by the functions
     associated with two function references. One for a cell, and the
     other for a row.

      - Function Reference: $multitable_cell cell $text
          This function is used to format the text of a multitable
          cell, the text following a `@item' or a `@tab'.  $TEXT is the
          corresponding text.

      - Function Reference: $multitable_row row $text $item_command
          This function is used to format a multitable row. $TEXT is
          the row text, with cells allready formatted with the `$cell'
          function reference. $ITEM_COMMAND is the command used to
          introduce the row, such that it is possible to distinguish
          between `@item' and `@headitem'.