summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/doc/dvisvgm.1
blob: 063eb4b3da5dcbfff806647c147705d5b09ee9fe (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
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
'\" t
.\"     Title: dvisvgm
.\"    Author: Martin Gieseking <martin.gieseking@uos.de>
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2022-10-14
.\"    Manual: dvisvgm Manual
.\"    Source: dvisvgm 3.0.3
.\"  Language: English
.\"
.TH "DVISVGM" "1" "2022\-10\-14" "dvisvgm 3\&.0\&.3" "dvisvgm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
dvisvgm \- converts DVI and EPS files to the XML\-based SVG format
.SH "SYNOPSIS"
.sp
\fBdvisvgm\fR [\fIoptions\fR] \fIfile\fR[\&.dvi]
.sp
\fBdvisvgm\fR \-\-eps [\fIoptions\fR] \fIfile1\fR[\&.eps] \fIfile2\fR[\&.eps] \&...
.sp
\fBdvisvgm\fR \-\-pdf [\fIoptions\fR] \fIfile\fR[\&.pdf]
.SH "DESCRIPTION"
.sp
The command\-line utility \fBdvisvgm\fR converts DVI files, as generated by TeX/LaTeX, to the XML\-based scalable vector graphics format SVG\&. It supports the classic DVI version 2 as well as version 3 (created by pTeX in vertical mode), and the XeTeX versions 5 to 7 which are also known as XDV\&. Besides the basic DVI commands, dvisvgm also evaluates many so\-called \fIspecials\fR which heavily extend the capabilities of the plain DVI format\&. For a more detailed overview, see section \fBSupported Specials\fR below\&.
.sp
Since the current SVG standard 1\&.1 doesn\(cqt specify multi\-page graphics, dvisvgm creates separate SVG files for each DVI page\&. Because of compatibility reasons, only the first page is converted by default\&. In order to select a different page or arbitrary page sequences, use option \fB\-p\fR which is described below\&.
.sp
SVG is a vector\-based graphics format and therefore dvisvgm tries to convert the glyph outlines of all fonts referenced in a DVI page section to scalable path descriptions\&. The fastest way to achieve this is to extract the path information from vector\-based font files available in PFB, TTF, or OTF format\&. If dvisvgm is able to find such a file, it extracts all necessary outline information about the glyphs from it\&.
.sp
However, TeX\(cqs main source for font descriptions is Metafont, which produces bitmap output (GF files)\&. That\(cqs why not all obtainable TeX fonts are available in a scalable format\&. In these cases, dvisvgm tries to vectorize Metafont\(cqs output by tracing the glyph bitmaps\&. The results are not as perfect as most (manually optimized) PFB or OTF counterparts, but are nonetheless really nice in most cases\&.
.sp
When running dvisvgm without option \fB\-\-no\-fonts\fR, it creates \fIfont\fR elements (\fB<font>\fR\&...\fB</font>\fR) to embed the font data into the SVG files\&. Unfortunately, only few SVG renderers support these elements yet\&. Most web browsers and vector graphics applications don\(cqt evaluate them properly so that the text components of the resulting graphics might look strange\&. In order to create more compatible SVG files, command\-line option \fB\-\-no\-fonts\fR can be given to replace the font elements by plain graphics paths\&. Most web browsers (but only few external SVG renderers) also support WOFF and WOFF2 fonts that can be used instead of the default SVG fonts\&. Option \fB\-\-font\-format\fR offers the functionality to change the format applied to the fonts being embedded\&. This, however, only works when converting DVI files\&. Text present in PDF and PostScript files is always converted to path elements\&.
.SH "OPTIONS"
.sp
dvisvgm provides a POSIX\-compliant command\-line interface with short and long option names\&. They may be given before and/or after the name of the file to be converted\&. Also, the order of specifying the options is not significant, i\&.e\&. you can add them in any order without changing dvisvgm\(cqs behavior\&. Certain options accept or require additional parameters which are directly appended to or separated by whitespace from a short option (e\&.g\&. \fB\-v0\fR or \fB\-v 0\fR)\&. Long options require an additional equals sign (\fB=\fR) between option name and argument but without any surrounding whitespace (e\&.g\&. \fB\-\-verbosity=0\fR)\&. Multiple short options that don\(cqt expect a further parameter can be combined after a single dash (e\&.g\&. \fB\-ejs\fR rather than \fB\-e \-j \-s\fR)\&.
.sp
Long option names may also be shortened by omitting trailing characters\&. As long as the shortened name is unambiguous, it\(cqs recognized and applied\&. For example, option \fB\-\-exact\-bbox\fR can be shortened to \fB\-\-exact\fR, \fB\-\-exa\fR, or \fB\-\-ex\fR\&. In case of an ambiguous abbreviation, dvisvgm prints an error message together with all matching option names\&.
.PP
\fB\-b, \-\-bbox\fR=\fIfmt\fR
.RS 4
Sets the bounding box of the generated SVG graphic to the specified format\&. This option only affects the conversion of DVI files\&. SVG documents generated from PDF and PostScript always inherit the bounding boxes of the input files\&.
.sp
Parameter
\fIfmt\fR
takes either one of the format specifiers listed below, or a sequence of four comma\- or whitespace\-separated length values
\fIx1\fR,
\fIy1\fR,
\fIx2\fR
and
\fIy2\fR\&. The latter define the absolute coordinates of two diagonal corners of the bounding box\&. Each length value consists of a floating point number and an optional length unit (pt, bp, cm, mm, in, pc, dd, cc, or sp)\&. If the unit is omitted, TeX points (pt) are assumed\&.
.sp
It\(cqs also possible to give only one length value
\fIl\fR\&. In this case, the minimal bounding box is computed and enlarged by adding (\-\fIl\fR,\-\fIl\fR) to the upper left and (\fIl\fR,\fIl\fR) to the lower right corner\&.
.sp
Additionally, dvisvgm also supports the following format specifiers:
.PP
\fBInternational DIN/ISO paper sizes\fR
.RS 4
A\fIn\fR, B\fIn\fR, C\fIn\fR, D\fIn\fR, where
\fIn\fR
is a non\-negative integer, e\&.g\&. A4 or a4 for DIN/ISO A4 format (210mm \(mu 297mm)\&.
.RE
.PP
\fBNorth American paper sizes\fR
.RS 4
invoice, executive, legal, letter, ledger
.RE
.PP
\fBSpecial bounding box sizes\fR
.RS 4
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBdvi\fR
T}:T{
page size stored in the DVI file
T}
T{
\fBmin\fR
T}:T{
computes the minimal/tightest bounding box
T}
T{
\fBnone\fR
T}:T{
no bounding box is assigned
T}
T{
\fBpapersize\fR
T}:T{
box sizes specified by
\fIpapersize\fR
specials present in the DVI file
T}
T{
\fBpreview\fR
T}:T{
bounding box data computed by the preview package (if present in the DVI file)
T}
.TE
.sp 1
.RE
.PP
\fBPage orientation\fR
.RS 4
The default page orientation for DIN/ISO and American paper sizes is
\fIportrait\fR, i\&.e\&.
\fIwidth\fR
<
\fIheight\fR\&. Appending
\fB\-landscape\fR
or simply
\fB\-l\fR
to the format string switches to
\fIlandscape\fR
mode (\fIwidth\fR
>
\fIheight\fR)\&. For symmetry reasons you can also explicitly add
\fB\-portrait\fR
or
\fB\-p\fR
to indicate the default portrait format\&. Note that these suffixes are part of the size string and not separate options\&. Thus, they must directly follow the size specifier without additional blanks\&. Furthermore, the orientation suffixes can\(cqt be used with
\fBdvi\fR,
\fBmin\fR, and
\fBnone\fR\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
Option
\fB\-b, \-\-bbox\fR
only affects the bounding box and does not transform the page content\&. Hence, if you choose a landscape format, the page won\(cqt be rotated\&.
.sp .5v
.RE
.RE
.RE
.PP
\fB\-B, \-\-bitmap\-format\fR=\fIfmt\fR
.RS 4
This option sets the image format used to embed bitmaps extracted from PostScript or PDF data\&. By default, dvisvgm embeds all bitmaps as JPEG images because it\(cqs the most compact of the two formats supported by SVG\&. To select the alternative lossless PNG format,
\fB\-\-bitmap\-format=png\fR
can be used\&. There are some more format variants dvisvgm currently supports even though
\fBjpeg\fR
and
\fBpng\fR
should be sufficient in most cases\&. The following list gives an overview of the known format names which correspond to names of Ghostscript output devices\&.
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBnone\fR
T}:T{
disable processing of bitmap images
T}
T{
\fBjpeg\fR
T}:T{
color JPEG format
T}
T{
\fBjpeggray\fR
T}:T{
grayscale JPEG format
T}
T{
\fBpng\fR
T}:T{
grayscale or 24\-bit color PNG format depending on current color space
T}
T{
\fBpnggray\fR
T}:T{
grayscale PNG format
T}
T{
\fBpngmono\fR
T}:T{
black\-and\-white PNG format
T}
T{
\fBpngmonod\fR
T}:T{
dithered black\-and\-white PNG format
T}
T{
\fBpng16\fR
T}:T{
4\-bit color PNG format
T}
T{
\fBpng256\fR
T}:T{
8\-bit color PNG format
T}
T{
\fBpng16m\fR
T}:T{
24\-bit color PNG format
T}
.TE
.sp 1
Since the collection of supported output devices can vary among local Ghostscript installations, not all formats may be available in some environments\&. dvisvgm quits with a PostScript error message if the selected output format requires a locally unsupported output device\&.
.sp
The two JPEG format specifiers accept an optional parameter to set the IJG quality level which must directly follow the format specifier separated by a colon, e\&.g\&.
\fB\-\-bitmap\-format=jpeg:50\fR\&. The quality value is an integer between 0 and 100\&. Higher values result in better image quality but lower compression rates and therefore larger files\&. The default quality level is 75 which is applied if no quality parameter is given or if it\(cqs set to 0\&.
.RE
.PP
\fB\-C, \-\-cache\fR[=\fIdir\fR]
.RS 4
To speed up the conversion process of bitmap fonts, dvisvgm saves intermediate conversion information in cache files\&. By default, these files are stored in
\fB$XDG_CACHE_HOME/dvisvgm/\fR
or
\fB$HOME/\&.cache/dvisvgm\fR
if
\fBXDG_CACHE_HOME\fR
is not set\&. If you prefer a different location, use option
\fB\-\-cache\fR
to overwrite the default\&. Furthermore, it is also possible to disable the font caching mechanism completely with option
\fB\-\-cache=none\fR\&. If argument
\fIdir\fR
is omitted, dvisvgm prints the path of the default cache directory together with further information about the stored fonts\&. Additionally, outdated and corrupted cache files are removed\&.
.RE
.PP
\fB\-j, \-\-clipjoin\fR
.RS 4
This option tells dvisvgm to compute all intersections of clipping paths itself rather than delegating this task to the SVG renderer\&. The resulting SVG files are more portable because some SVG viewers don\(cqt support intersecting clipping paths which are defined by
\fIclipPath\fR
elements containing a
\fIclip\-path\fR
attribute\&.
.RE
.PP
\fB\-\-color\fR
.RS 4
Enables colorization of messages printed during the conversion process\&. The colors can be customized via environment variable
\fBDVISVGM_COLORS\fR\&. See the
Environment section
below for further information\&.
.RE
.PP
\fB\-\-colornames\fR
.RS 4
By default, dvisvgm exclusively uses RGB values of the form
\fI#RRGGBB\fR
or
\fI#RGB\fR
to represent colors in the SVG file\&. The latter is a short form for colors whose RGB components each consist of two identical hex digits, e\&.g\&.
\fB#123\fR
equals
\fB#112233\fR\&. According to the SVG standard, it\(cqs also possible to use color names (like
\fBblack\fR
and
\fBdarkblue\fR) for a limited number of
predefined colors (\m[blue]https://www.w3.org/TR/SVG11/types.html#ColorKeywords\m[])\&. In order to apply these color names rather than their RGB values, call dvisvgm with option
\fB\-\-colornames\fR\&. All colors without an SVG color name will still be represented by RGB values\&.
.RE
.PP
\fB\-\-comments\fR
.RS 4
Adds comments with further information about selected data to the SVG file\&. Currently, only font elements and font CSS rules related to native fonts are annotated\&.
.RE
.PP
\fBembed\-bitmaps\fR
.RS 4
Embeds the contents of bitmap files into the generated SVG files instead of adding file references\&. Because of the base64\-encoded data, the SVG files are usually much bigger but at the same time more portable because they don\(cqt rely on external bitmap files\&.
.sp
This option only affects bitmaps referenced in DVI/XDV files, e\&.g\&. added by
\fB\eincludegraphics\fR\&. Bitmaps in PostScript or PDF files are always embedded\&. Also see option
\fBbitmap\-format\fR\&.
.RE
.PP
\fB\-E, \-\-eps\fR
.RS 4
If this option is given, dvisvgm does not expect a DVI but a single or multiple EPS input files, and tries to convert them to SVG\&. In order to do so, a single
\fIpsfile\fR
special command is created and forwarded to the PostScript special handler\&. This option is only available if dvisvgm was built with PostScript support enabled, and requires Ghostscript to be available\&. See option
\fB\-\-libgs\fR
for further information\&.
.RE
.PP
\fB\-e, \-\-exact\-bbox\fR
.RS 4
This option tells dvisvgm to compute the precise bounding box of each character\&. By default, the values stored in a font\(cqs TFM file are used to determine a glyph\(cqs extent\&. As these values are intended to implement optimal character placements and are not designed to represent the exact dimensions, they don\(cqt necessarily correspond with the bounds of the visual glyphs\&. Thus, width and/or height of some glyphs may be larger (or smaller) than the respective TFM values\&. As a result, this can lead to clipped characters at the bounds of the SVG graphics\&. With option
\fB\-\-exact\-bbox\fR
given, dvisvgm analyzes the actual shape of each character and derives a usually tight bounding box\&.
.RE
.PP
\fB\-f, \-\-font\-format\fR=\fIformat\fR
.RS 4
Selects the file format used to embed font data into the generated SVG output when converting DVI or PDF files\&. The latter require the new mutool\-based PDF handler introduced with dvisvgm 3\&.0 (also see option
\fB\-\-pdf\fR)\&. Option
\fB\-\-font\-format\fR
has no effect when converting PDF or PostScript files using Ghostscript\&. Text fragments present in these files are then always converted to path elements\&.
.sp
Following formats are supported:
\fBSVG\fR
(that\(cqs the default),
\fBTTF\fR
(TrueType),
\fBWOFF\fR, and
\fBWOFF2\fR
(Web Open Font Format version 1 and 2)\&. By default, dvisvgm creates unhinted fonts that might look bad on low\-resolution devices\&. In order to improve the display quality, the generated TrueType, WOFF, or WOFF2 fonts can be autohinted\&. The autohinter is enabled by appending
\fB,autohint\fR
or
\fB,ah\fR
to the font format, e\&.g\&.
\fB\-\-font\-format=woff,autohint\fR
or
\fB\-\-fwoff,ah\fR\&. This functionality requires the
ttfautohint library (\m[blue]https://freetype.org/ttfautohint\m[])\&. If it\(cqs not available or can\(cqt be found, dvisvgm issues a corresponding warning message\&.
.sp
Option
\fB\-\-font\-format\fR
is only available if dvisvgm was built with WOFF support enabled\&.
.RE
.PP
\fB\-m, \-\-fontmap\fR=\fIfilenames\fR
.RS 4
Loads and evaluates a single font map file or a sequence of font map files\&. These files are required to resolve font file names and encodings\&. dvisvgm does not provide its own map files but tries to read available ones coming with dvips or dvipdfm\&. If option
\fB\-\-fontmap\fR
is omitted, dvisvgm looks for the default map files
\fIps2pk\&.map\fR,
\fIpdftex\&.map\fR,
\fIdvipdfm\&.map\fR, and
\fIpsfonts\&.map\fR
(in this order)\&. Otherwise, the files given as option arguments are evaluated in the given order\&. Multiple filenames must be separated by commas without leading and/or trailing whitespace\&.
.sp
By default, redefined mappings do not replace previous ones\&. However, each filename can be preceded by an optional mode specifier (\fB+\fR,
\fB\-\fR, or
\fB=\fR) to change this behavior:
.PP
+mapfile
.RS 4
Only those entries in the given map file that don\(cqt redefine a font mapping are applied, i\&.e\&. fonts already mapped keep untouched\&. That\(cqs also the default mode if no mode specifier is given\&.
.RE
.PP
\-mapfile
.RS 4
Ensures that none of the font mappings defined in the given map file are used, i\&.e\&. previously defined mappings for the specified fonts are removed\&.
.RE
.PP
=mapfile
.RS 4
All mappings defined in the map file are applied\&. Previously defined settings for the same fonts are replaced\&.
.sp
If the first filename in the filename sequence is preceded by a mode specifier, dvisvgm loads the default font map (see above) and applies the other map files afterwards\&. Otherwise, none of default map files will be loaded automatically\&.
.sp
Examples:
\fB\-\-fontmap=myfile1\&.map,+myfile2\&.map\fR
loads
\fImyfile1\&.map\fR
followed by
\fImyfile2\&.map\fR
where all redefinitions of
\fBmyfile2\&.map\fR
are ignored\&.
\fB\-\-fontmap==myfile1\&.map,\-myfile2\&.map\fR
loads the default map file followed by
\fImyfile1\&.map\fR
and
\fImyfile2\&.map\fR
where all redefinitions of
\fImyfile1\&.map\fR
replace previous entries\&. Afterwards, all definitions for the fonts given in
\fImyfile2\&.map\fR
are removed from the font map tree\&.
.sp
For further information about the map file formats and the mode specifiers, see the manuals of
dvips (\m[blue]https://tug.org/texinfohtml/dvips.html\m[])
and
dvipdfm (\m[blue]https://ctan.org/tex-archive/dviware/dvipdfm\m[])\&.
.RE
.RE
.PP
\fB\-\-grad\-overlap\fR
.RS 4
Tells dvisvgm to create overlapping grid segments when approximating color gradient fills (also see option
\fB\-\-grad\-segments\fR
below)\&. By default, adjacent segments don\(cqt overlap but only touch each other like separate tiles\&. However, this alignment can lead to visible gaps between the segments because the background color usually influences the color at the boundary of the segments if the SVG renderer uses anti\-aliasing to create smooth contours\&. One way to avoid this and to create seamlessly touching color regions is to enlarge the segments so that they extend into the area of their right and bottom neighbors\&. Since the latter are drawn on top of the overlapping parts, the visible size of all segments keeps unchanged\&. Just the former gaps disappear as the background is now completely covered by the correct colors\&. Currently, dvisvgm computes the overlapping segments separately for each patch of the mesh (a patch mesh may consist of multiple patches of the same type)\&. Therefore, there still might be visible gaps at the seam of two adjacent patches\&.
.RE
.PP
\fB\-\-grad\-segments\fR=\fInumber\fR
.RS 4
Determines the maximal number of segments per column and row used to approximate gradient color fills\&. Since SVG 1\&.1 only supports a small subset of the shading algorithms available in PostScript, dvisvgm approximates some of them by subdividing the area to be filled into smaller, monochromatic segments\&. Each of these segments gets the average color of the region it covers\&. Thus, increasing the number of segments leads to smaller monochromatic areas and therefore a better approximation of the actual color gradient\&. As a drawback, more segments imply bigger SVG files because every segment is represented by a separate path element\&.
.sp
Currently, dvisvgm supports free\- and lattice\-form triangular patch meshes as well as Coons and tensor\-product patch meshes\&. They are approximated by subdividing the area of each patch into a
\fIn\fR\(mu\fIn\fR
grid of smaller segments\&. The maximal number of segments per column and row can be changed with option
\fB\-\-grad\-segments\fR\&.
.RE
.PP
\fB\-\-grad\-simplify\fR=\fIdelta\fR
.RS 4
If the size of the segments created to approximate gradient color fills falls below the given delta value, dvisvgm reduces their level of detail\&. For example, B\('ezier curves are replaced by straight lines, and triangular segments are combined to tetragons\&. For a small
\fIdelta\fR, these simplifications are usually not noticeable but reduce the size of the generated SVG files significantly\&.
.RE
.PP
\fB\-h, \-\-help\fR[=\fImode\fR]
.RS 4
Prints a short summary of all available command\-line options\&. The optional
\fImode\fR
parameter is an integer value between 0 and 2\&. It selects the display variant of the help text\&. Mode 0 lists all options divided into categories with section headers\&. This is also the default if dvisvgm is called without parameters\&. Mode 1 lists all options ordered by the short option names, while mode 2 sorts the lines by the long option names\&.
.sp
A values in brackets after the description text indicate the default parameter of the option\&. They are applied if an option with a mandatory parameter is not used or if an optional parameter is omitted\&. For example, option
\fB\-\-bbox\fR
requires a size parameter which defaults to
\fBmin\fR
if
\fB\-\-bbox\fR
is not used\&. Option
\fB\-\-zip\fR, which isn\(cqt applied by default, accepts an optional compression level parameter\&. If it\(cqs omitted, the stated default value 9 is used\&.
.RE
.PP
\fB\-\-keep\fR
.RS 4
Disables the removal of temporary files as created by Metafont (usually \&.gf, \&.tfm, and \&.log files) or the TrueType/WOFF module\&.
.RE
.PP
\fB\-\-libgs\fR=\fIpath\fR
.RS 4
This option is only available if the Ghostscript library is not directly linked to dvisvgm and if PostScript support was not completely disabled during compilation\&. In this case, dvisvgm tries to load the shared GS library dynamically during runtime\&. By default, it expects the library\(cqs name to be
\fBlibgs\&.so\&.X\fR
(on Unix\-like systems, where
\fBX\fR
is the ABI version of the library) or
\fBgsdll32\&.dll\fR/\fBgsdll64\&.dll\fR
(Windows)\&. If dvisvgm doesn\(cqt find the library, option
\fB\-\-libgs\fR
can be used to specify the correct path and filename, e\&.g\&.
\fB\-\-libgs=/usr/local/lib/libgs\&.so\&.9\fR
or
\fB\-\-libgs=\egs\egs9\&.25\ebin\egsdll64\&.dll\fR\&.
.sp
Alternatively, it\(cqs also possible to assign the path to environment variable
\fBLIBGS\fR, e\&.g\&.
\fBexport LIBGS=/usr/local/lib/libgs\&.so\&.9\fR
or
\fBset LIBGS=\egs\egs9\&.25\ebin\egsdll63\&.dll\fR\&.
\fBLIBGS\fR
has less precedence than the command\-line option, i\&.e\&. dvisvgm ignores variable
\fBLIBGS\fR
if
\fB\-\-libgs\fR
is given\&.
.RE
.PP
\fB\-L, \-\-linkmark\fR=\fIstyle\fR
.RS 4
Selects the method how to mark hyperlinked areas\&. The
\fIstyle\fR
argument can take one of the values
\fInone\fR,
\fIbox\fR, and
\fIline\fR, where
\fIbox\fR
is the default, i\&.e\&. a rectangle is drawn around the linked region if option
\fB\-\-linkmark\fR
is omitted\&. Style argument
\fIline\fR
just draws the lower edge of the bounding rectangle, and
\fInone\fR
tells dvisvgm not to add any visible objects to hyperlinks\&. The lines and boxes get the current text color selected\&. In order to apply a different, constant color, a colon followed by a color specifier can be appended to the style string\&. A
\fIcolor specifier\fR
is either a hexadecimal RGB value of the form
\fI#RRGGBB\fR, or a
dvips color name (\m[blue]https://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips\m[])\&.
.sp
Moreover, argument
\fIstyle\fR
can take a single color specifier to highlight the linked region by a frameless box filled with that color\&. An optional second color specifier separated by a colon selects the frame color\&.
.sp
Examples:
\fBbox:red\fR
or
\fBbox:#ff0000\fR
draws red boxes around the linked areas\&.
\fByellow:blue\fR
creates yellow filled rectangles with blue frames\&.
.RE
.PP
\fB\-l, \-\-list\-specials\fR
.RS 4
Prints a list of registered special handlers and exits\&. Each handler processes a set of special statements belonging to the same category\&. In most cases, these categories are identified by the prefix of the special statements which is usually a leading string followed by a colon or a blank, e\&.g\&.
\fIcolor\fR
or
\fIps\fR\&. The listed handler names, however, don\(cqt need to match these prefixes, e\&.g\&. if there is no common prefix or if functionality is split into separate handlers in order to allow them to be disabled separately using option
\fB\-\-no\-specials\fR\&. All special statements not covered by one of the special handlers are silently ignored\&.
.RE
.PP
\fB\-M, \-\-mag\fR=\fIfactor\fR
.RS 4
Sets the magnification factor applied in conjunction with Metafont calls prior tracing the glyphs\&. The larger this value, the better the tracing results\&. Nevertheless, large magnification values can cause Metafont arithmetic errors due to number overflows\&. So, use this option with care\&. The default setting usually produces nice results\&.
.RE
.PP
\fB\-\-no\-merge\fR
.RS 4
Puts every single character in a separate
\fItext\fR
element with corresponding
\fIx\fR
and
\fIy\fR
attributes\&. By default, new
\fItext\fR
or
\fItspan\fR
elements are only created if a string starts at a location that differs from the regular position defined by the characters\*(Aq advance values\&.
.RE
.PP
\fB\-\-no\-mktexmf\fR
.RS 4
Suppresses the generation of missing font files\&. If dvisvgm can\(cqt find a font file through the kpathsea lookup mechanism, it calls the external tools
\fImktextfm\fR
or
\fImktexmf\fR\&. This option disables these calls\&.
.RE
.PP
\fB\-n, \-\-no\-fonts\fR[=\fIvariant\fR]
.RS 4
If this option is given, dvisvgm doesn\(cqt create SVG
\fIfont\fR
elements but uses
\fIpaths\fR
instead\&. The resulting SVG files tend to be larger but are concurrently more compatible with most applications that don\(cqt support SVG fonts\&. The optional argument
\fIvariant\fR
selects the method how to substitute fonts by paths\&. Variant 0 creates
\fIpath\fR
and
\fIuse\fR
elements in order to avoid lengthy duplicates\&. Variant 1 creates
\fIpath\fR
elements only\&. Option
\fB\-\-no\-fonts\fR
implies
\fB\-\-no\-styles\fR\&.
.RE
.PP
\fB\-c, \-\-scale\fR=\fIsx\fR[,\fIsy\fR]
.RS 4
Scales the page content horizontally by
\fIsx\fR
and vertically by
\fIsy\fR\&. This option is equivalent to
\fB\-TS\fR\fIsx\fR,\fIsy\fR\&.
.RE
.PP
\fB\-S, \-\-no\-specials\fR[=\fInames\fR]
.RS 4
Disable processing of special commands embedded in the DVI file\&. If no further parameter is given, all specials are ignored\&. To disable a selected set of specials, an optional comma\-separated list of names can be appended to this option\&. A
\fIname\fR
is the unique identifier referencing the intended special handler as listed by option
\fB\-\-list\-specials\fR\&.
.RE
.PP
\fB\-\-no\-styles\fR
.RS 4
By default, dvisvgm creates CSS styles and class attributes to reference fonts\&. This variant is more compact than adding the complete font information to each text element over and over again\&. However, if you prefer direct font references, the default behavior can be disabled with option
\fB\-\-no\-styles\fR\&.
.RE
.PP
\fB\-O, \-\-optimize\fR[=\fImodules\fR]
.RS 4
Applies several optimizations on the generated SVG tree to reduce the file size\&. The optimizations are performed by running separate optimizer modules specified by optional argument
\fImodules\fR\&. It may consist of a single module name or a comma\-separated list of several module names\&. The corresponding modules are executed one by one in the given order and thus transform the XML tree gradually\&.
.sp
The following list describes the currently available optimizer modules\&.
.PP
\fBlist\fR
.RS 4
Lists all available optimizer modules and exits\&.
.RE
.PP
\fBnone\fR
.RS 4
If this argument is given, dvisvgm doesn\(cqt apply any optimization\&.
\fBnone\fR
can\(cqt be combined with other module names\&.
.RE
.PP
\fBall\fR
.RS 4
Performs all optimizations listed below\&. This is also the default if option
\fB\-\-optimize\fR
is used without argument\&. The modules are executed in a predefined order that usually leads to the best results\&.
\fBall\fR
can\(cqt be combined with other module names\&.
.RE
.PP
\fBcollapse\-groups\fR
.RS 4
Combines nested group elements (\fB<g>\fR\&...\fB</g>\fR) that contain only a single group each\&. If possible, the group attributes are moved to the outermost element of the processed subtree\&. This module also unwraps group elements that have no attributes at all\&.
.RE
.PP
\fBgroup\-attributes\fR
.RS 4
Creates groups (\fB<g>\fR\&...\fB</g>\fR) for common attributes around adjacent elements\&. Each attribute is moved to a separate group so that multiple common attributes lead to nested groups\&. They can be combined by applying optimizer module
\fIcollapse\-groups\fR
afterwards\&. The algorithm only takes inheritable properties, such as
\fBfill\fR
or
\fBstroke\-width\fR, into account and only removes them from an element if none of the other attributes, like
\fBid\fR, prevents this\&.
.RE
.PP
\fBreassign\-clippaths\fR
.RS 4
Collects all
\fBclipPath\fR
elements that differ only by their IDs\&. Afterwards, the duplicates are removed so that only one remains\&. All
\fBclip\-path\fR
attributes referencing one of the duplicates are updated accordingly\&.
.RE
.PP
\fBremove\-clippaths\fR
.RS 4
Removes all redundant
\fIclipPath\fR
elements\&. This optimization was already present in former versions of dvisvgm and was always applied by default\&. This behavior is retained, i\&.e\&. dvisvgm executes this module even if option
\fB\-\-optimize\fR
is not given\&. You can use argument
\fInone\fR
to prevent that\&.
.RE
.PP
\fBsimplify\-text\fR
.RS 4
If a
\fBtext\fR
element only contains whitespace nodes and
\fBtspan\fR
elements, all common inheritable attributes of the latter are moved to the enclosing text element\&. All
\fBtspan\fR
elements without further attributes are unwrapped\&.
.RE
.PP
\fBsimplify\-transform\fR
.RS 4
Tries to shorten all
\fItransform\fR
attributes\&. This module combines the transformation commands of each attribute and decomposes the resulting transformation matrix into a sequence of basic transformations, i\&.e\&. translation, scaling, rotation, and skewing\&. If this sequence is shorter than the equivalent
\fImatrix\fR
expression, it\(cqs assigned to the attribute\&. Otherwise, the matrix expression is used\&.
.RE
.RE
.PP
\fB\-o, \-\-output\fR=\fIpattern\fR
.RS 4
Sets the pattern that determines the names of the generated SVG files, optionally including the file path\&. The required parameter
\fIpattern\fR
may consist of an arbitrary sequence of characters which make up the filenames or file paths relative to the current working directory\&. With the exception of the following mentioned variables and expressions, all characters are treated as static parts of the filenames/folders and are therefore identical for all pages processed during a run of dvisvgm\&. The strings
\fB%f\fR,
\fB%p\fR,
\fB%P\fR,
\fB%n\fR,
\fB%N\fR,
\fB%hd\fR,
\fB%ho\fR, and
\fB%hc\fR
are variables that can be used as part of the pattern\&.
\fB%f\fR
expands to the base name of the DVI file, i\&.e\&. the filename without suffix,
\fB%p\fR
is the current page number, and
\fB%P\fR
the total number of pages in the DVI file\&. The variables
\fB%n\fR
and
\fB%N\fR
expand to the number of the current file being converted (starting at 1) and the total number of files given, respectively\&.
.sp
An optional number (0\-9) specified directly after the percent sign of a variable holding a numeric value denotes the minimal number of digits to be created\&. If a particular value consists of less digits, the number is padded with leading zeros\&. Example:
\fB%3p\fR
enforces 3 digits for the current page number (001, 002, etc\&.)\&. Without an explicit width specifier,
\fB%p\fR
gets the same number of digits as
\fB%P\fR\&.
.sp
If you need more control over the numbering, you can use arithmetic expressions as part of the pattern\&. The syntax is
\fB%(\fR\fIexpr\fR\fB)\fR
where
\fIexpr\fR
may contain additions, subtractions, multiplications, and integer divisions with common precedence\&. The variables
\fBp\fR
and
\fBP\fR
contain the current page number and the total number of pages, respectively\&. For example,
\fB\-\-output="%f\-%(p\-1)"\fR
creates filenames where the numbering starts with 0 rather than 1\&.
.sp
The variables
\fB%hX\fR
contain different hash values computed from the DVI page data and the options given on the command\-line\&.
\fB%hd\fR
and
\fB%hc\fR
are only set if option
\fB\-\-page\-hashes\fR
is present\&. Otherwise, they are empty\&. For further information, see the description of option
\fB\-\-page\-hashes\fR
below\&.
.sp
The default pattern is
\fB%f\-%p\&.svg\fR
if the DVI file consists of more than one page, and
\fB%f\&.svg\fR
otherwise\&. That means, a DVI file
\fIfoo\&.dvi\fR
is converted to
\fIfoo\&.svg\fR
if
\fIfoo\&.dvi\fR
is a single\-page document\&. Otherwise, multiple SVG files
\fIfoo\-01\&.svg\fR,
\fIfoo\-02\&.svg\fR, etc\&. are produced\&. In Windows environments, the percent sign indicates dereferenced environment variables, and must therefore be protected by a second percent sign, e\&.g\&.
\fB\-\-output=%%f\-%%p\fR\&.
.RE
.PP
\fB\-p, \-\-page\fR=\fIranges\fR
.RS 4
This option selects the pages to be processed\&. Parameter
\fIranges\fR
consists of a comma\-separated list of single page numbers and/or page ranges\&. A page range is a pair of numbers separated by a hyphen, e\&.g\&. 5\-12\&. Thus, a page sequence might look like this: 2\-4,6,9\-12,15\&. It doesn\(cqt matter if a page is given more than once or if page ranges overlap\&. dvisvgm always extracts the page numbers in ascending order and converts them only once\&.
.sp
In order to stay compatible with previous versions, the default page sequence is 1\&. dvisvgm therefore converts only the first page and not the whole document if option
\fB\-\-page\fR
is omitted\&. Usually, page ranges consist of two numbers denoting the first and last page to be converted\&. If the conversion should start at page 1, or if it should continue up to the last DVI page, the first or second range number can be omitted, respectively\&. Example:
\fB\-\-page=\-10\fR
converts all pages up to page 10,
\fB\-\-page=10\-\fR
converts all pages starting with page 10\&. Please consider that the page values don\(cqt refer to the page numbers printed on the corresponding page\&. Instead, the physical page count is expected, where the first page always gets number 1\&.
.sp
At the end of the range sequence an optional filter specifier can be added\&. Currently, the two filters
\fB:even\fR
and
\fB:odd\fR
are supported which restrict the preceding values to even or odd numbers\&. For example,
\fB\-\-page=1\-11,20:even\fR
is equivalent to
\fB\-\-page=2,4,6,8,10,20\fR\&.
.RE
.PP
\fB\-H, \-\-page\-hashes\fR[=\fIparams\fR]
.RS 4
If this option is given, dvisvgm computes hash values of all pages to be processed\&. As long as the page contents don\(cqt change, the hash value of that page stays the same\&. This property can be used to determine whether a DVI page must be converted again or can be skipped in consecutive runs of dvisvgm\&. This is done by propagating the hash value to variable
\fB%hd\fR
which can be accessed in the output pattern (see option
\fB\-\-output\fR)\&. By default, dvisvgm changes the output pattern to
\fB%f\-%hd\fR
if option
\fB\-\-page\-hashes\fR
is given\&. As a result, all SVG file names contain the hash value instead of the page number\&. When calling dvisvgm again with option
\fB\-\-page\-hashes\fR
with the same output pattern, it checks the existence of the SVG file to be created and skips the conversion if it\(cqs already present\&. This also applies for consecutive calls of dvisvgm with different command\-line parameters\&. If you want to force another conversion of a DVI file that hasn\(cqt changed, you must remove the corresponding SVG files beforehand or add the parameter
\fBreplace\fR
(see below)\&. If you manually set the output pattern to not contain a hash value, the conversion won\(cqt be skipped\&.
.sp
Alternatively, the output pattern may contain the variables
\fB%ho\fR
and
\fB%hc\fR\&.
\fB%ho\fR
expands to a 32\-bit hash representing the given command\-line options that affect the generated SVG output, like
\fB\-\-no\-fonts\fR
and
\fB\-\-precision\fR\&. Different combinations of options and parameters lead to different hashes\&. Thus pattern
\fB%f\-%hd\-%ho\fR
creates filenames that change depending on the DVI data and the given command\-line options\&. Variable
\fB%hc\fR
provides a combined hash computed from the DVI data and the command\-line options\&. It has the same length as
\fB%hd\fR\&.
.sp
Since the page number isn\(cqt part of the file name by default, different DVI pages with identical contents get the same file name\&. Therefore, only the first one is converted while the others are skipped\&. To create separate files for each page, you can add the page number to the output pattern, e\&.g\&.
\fB\-\-output="%f\-%p\-%hc"\fR\&.
.sp
By default, dvisvgm uses the fast XXH64 hash algorithm to compute the values provided through
\fB%hd\fR
and
\fB%hc\fR\&. 64\-bit hashes should be sufficient for most documents with an average size of pages\&. Alternatively, XXH32 and MD5 can be used as well\&. The desired algorithm is specified by argument
\fIparams\fR
of option
\fB\-\-page\-hashes\fR\&. It takes one of the strings
\fBMD5\fR,
\fBXXH32\fR, and
\fBXXH64\fR, where the names can be given in lower case too, like
\fB\-\-page\-hashes=md5\fR\&. Since version 0\&.7\&.1, xxHash provides an experimental 128\-bit hash function whose algorithm has been stabilized as of version 0\&.8\&. When using a version prior to 0\&.8, the 128\-bit hash values can vary depending on the used xxHash version\&. If the corresponding API is available, dvisvgm supports the new hash function, and option
\fB\-\-page\-hashes\fR
additionally accepts the algorithm specifier
\fBXXH128\fR\&.
.sp
Finally, option
\fB\-\-page\-hashes\fR
can take a second argument that must be separated by a comma\&. Currently, only the two parameters
\fIlist\fR
and
\fIreplace\fR
are evaluated, e\&.g\&.
\fB\-\-page\-hashes=md5,list\fR
or
\fB\-\-page\-hashes=replace\fR\&. When
\fIlist\fR
is present, dvisvgm doesn\(cqt perform any conversion but just lists the hash values
\fB%hd\fR
and
\fB%hc\fR
of the pages specified by option
\fB\-\-page\fR\&. Parameter
\fIreplace\fR
forces dvisvgm to convert a DVI page even if a file with the target name already exists\&.
.RE
.PP
\fB\-P, \-\-pdf\fR
.RS 4
If this option is given, dvisvgm does not expect a DVI but a PDF input file, and tries to convert it to SVG\&. Similar to the conversion of DVI files, only the first page is processed by default\&. Option
\fB\-\-page\fR
can be used to select different pages, page ranges, and/or page sequences\&.
.sp
If a Ghostcript version < 10\&.1\&.0 is found, dvisvgm uses Ghostscript to process the PDF file\&. In this case, the conversion is realized by creating a single
\fIpdffile\fR
special command which is forwarded to dvisvgm\(cqs PostScript special handler\&. Therefore, this option is only available if dvisvgm was built with PostScript support enabled, and requires Ghostscript to be accessible\&. See option
\fB\-\-libgs\fR
for further information\&.
.sp
As of Ghostscript 10\&.1\&.0, this will no longer work due to the introduction of a new PDF interpreter\&. Therefore, an alternative conversion module based on
mutool (\m[blue]https://mupdf.com/docs/mutool.html\m[])
has been introduced\&. It\(cqs automatically invoked if Ghostscript can\(cqt be used and if a working
\fBmutool\fR
executable is present in a directory which is part of the system\(cqs search path\&.
.sp
Alternatively, environment variable
\fBDVISVGM_PDF_PROC\fR
can be used to select the PDF processor\&. The currently supported values are
\fBgs\fR
and
\fBmutool\fR\&.
.RE
.PP
\fB\-d, \-\-precision\fR=\fIdigits\fR
.RS 4
Specifies the maximal number of decimal places applied to floating\-point attribute values\&. All attribute values written to the generated SVG file(s) are rounded accordingly\&. The parameter
\fIdigits\fR
accepts integer values from 0 to 6, where 0 enables the automatic selection of significant decimal places\&. This is also the default value if dvisvgm is called without option
\fB\-\-precision\fR\&.
.RE
.PP
\fB\-\-progress\fR[=\fIdelay\fR]
.RS 4
Enables a simple progress indicator shown when time\-consuming operations like PostScript specials are processed\&. The indicator doesn\(cqt appear before the given delay (in seconds) has elapsed\&. The default delay value is 0\&.5 seconds\&.
.RE
.PP
\fB\-r, \-\-rotate\fR=\fIangle\fR
.RS 4
Rotates the page content clockwise by
\fIangle\fR
degrees around the page center\&. This option is equivalent to
\fB\-TR\fR\fIangle\fR\&.
.RE
.PP
\fB\-R, \-\-relative\fR
.RS 4
SVG allows you to define graphics paths by a sequence of absolute and/or relative path commands, i\&.e\&. each command expects either absolute coordinates or coordinates relative to the current drawing position\&. By default, dvisvgm creates paths made up of absolute commands\&. If option
\fB\-\-relative\fR
is given, relative commands are created instead\&. This slightly reduces the size of the SVG files in most cases\&.
.RE
.PP
\fB\-\-stdin\fR
.RS 4
Tells dvisvgm to read the DVI or EPS input data from
\fBstdin\fR
instead from a file\&. Alternatively to option
\fB\-\-stdin\fR, a single dash (\-) can be given\&. The default name of the generated SVG file is
\fIstdin\&.svg\fR
which can be changed with option
\fB\-\-output\fR\&.
.RE
.PP
\fB\-s, \-\-stdout\fR
.RS 4
Don\(cqt write the SVG output to a file but redirect it to
\fBstdout\fR\&.
.RE
.PP
\fB\-\-tmpdir\fR[=\fIpath\fR]
.RS 4
In some cases, dvisvgm needs to create temporary files to work properly\&. These files go to the system\(cqs temporary folder by default, e\&.g\&.
\fB/tmp\fR
on Linux systems\&. Option
\fB\-\-tmpdir\fR
can be used to specify a different location\&. Please note that dvisvgm does not create this folder if it doesn\(cqt exist\&. Therefore, you must ensure that it\(cqs actually present before running dvisvgm\&.
.sp
In order to prevent colliding files caused by parallel calls of dvisvgm, the program doesn\(cqt write the files directly in the specified directory but furthermore creates a uniquely named subfolder in there, where the temporary files will be placed\&. This can be prevented by appending
\fB//\fR
or
\fB\e\e\fR
(on Windows) to the specified directory name\&. For example,
\fB\-\-tmpdir=\&.//\fR
creates the temporary files directly in the current working directory, while
\fB\-\-tmpdir=\&.\fR
places them in a dedicated subfolder of the current working directory\&.
.sp
If the optional parameter
\fIpath\fR
of option
\fB\-\-tmpdir\fR
is omitted, dvisvgm prints the location of the system\(cqs temp folder and exits\&.
.RE
.PP
\fB\-a, \-\-trace\-all\fR=[\fIretrace\fR]
.RS 4
This option forces dvisvgm to vectorize not only the glyphs actually required to render the SVG file correctly \(en which is the default \(en, but processes all glyphs of all fonts referenced in the DVI file\&. Because dvisvgm stores the tracing results in a font cache, all following conversions of these fonts will speed up significantly\&. The boolean option
\fIretrace\fR
determines how to handle glyphs already stored in the cache\&. By default, these glyphs are skipped\&. Setting argument
\fIretrace\fR
to
\fIyes\fR
or
\fItrue\fR
forces dvisvgm to retrace the corresponding bitmaps again\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
This option only takes effect if font caching is active\&. Therefore,
\fB\-\-trace\-all\fR
cannot be combined with option
\fB\-\-cache=none\fR\&.
.sp .5v
.RE
.RE
.PP
\fB\-T, \-\-transform\fR=\fIcommands\fR
.RS 4
Applies a sequence of transformations to the SVG content\&. Each transformation is described by a
\fIcommand\fR
beginning with a capital letter followed by a list of comma\-separated parameters\&. Following transformation commands are supported:
.PP
\fBT\fR \fItx\fR[,\fIty\fR]
.RS 4
Translates (moves/shifts) the page in direction of vector (\fItx\fR,\fIty\fR)\&. If
\fIty\fR
is omitted,
\fIty\fR=0 is assumed\&. The expected unit length of
\fItx\fR
and
\fIty\fR
are TeX points (1pt = 1/72\&.27in)\&. However, there are several constants defined to simplify the unit conversion (see below)\&.
.RE
.PP
\fBS\fR \fIsx\fR[,\fIsy\fR]
.RS 4
Scales the page horizontally by
\fIsx\fR
and vertically by
\fIsy\fR\&. If
\fIsy\fR
is omitted,
\fIsy\fR=\fIsx\fR
is assumed\&.
.RE
.PP
\fBR\fR \fIangle\fR[,\fIx\fR,\fIy\fR]
.RS 4
Rotates the page clockwise by
\fIangle\fR
degrees around point (\fIx\fR,\fIy\fR)\&. If the optional arguments
\fIx\fR
and
\fIy\fR
are omitted, the page will be rotated around its center depending on the chosen page format\&. When option
\fB\-bnone\fR
is given, the rotation center is origin (0,0)\&.
.RE
.PP
\fBKX\fR \fIangle\fR
.RS 4
Skews the page along the
\fIx\fR\-axis by
\fIangle\fR
degrees\&. Argument
\fIangle\fR
can take any value except 90+180\fIk\fR, where
\fIk\fR
is an integer\&.
.RE
.PP
\fBKY\fR \fIangle\fR
.RS 4
Skews the page along the
\fIy\fR\-axis by
\fIangle\fR
degrees\&. Argument
\fIangle\fR
can take any value except 90+180\fIk\fR, where
\fIk\fR
is an integer\&.
.RE
.PP
\fBFH\fR [\fIy\fR]
.RS 4
Mirrors (flips) the page at the horizontal line through point (0,\fIy\fR)\&. Omitting the optional argument leads to
\fIy\fR=\fIh\fR/2, where
\fIh\fR
denotes the page height (see
\fIpre\-defined constants\fR
below)\&.
.RE
.PP
\fBFV\fR [\fIx\fR]
.RS 4
Mirrors (flips) the page at the vertical line through point (\fIx\fR,0)\&. Omitting the optional argument leads to
\fIx\fR=\fIw\fR/2, where
\fIw\fR
denotes the page width (see
\fIpre\-defined constants\fR
below)\&.
.RE
.PP
\fBM\fR \fIm1\fR,\&...,\fIm6\fR
.RS 4
Applies a transformation described by the 3\(mu3 matrix ((\fIm1\fR,\fIm2\fR,\fIm3\fR),(\fIm4\fR,\fIm5\fR,\fIm6\fR),(0,0,1)), where the inner triples denote the rows\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
All transformation commands of option
\fB\-T, \-\-transform\fR
are applied in the order of their appearance\&. Multiple commands can optionally be separated by spaces\&. In this case the whole transformation string has to be enclosed in double quotes to keep them together\&. All parameters are expressions of floating point type\&. You can either give plain numbers or arithmetic terms combined by the operators
\fB+\fR
(addition),
\fB\-\fR
(subtraction),
\fB*\fR
(multiplication),
\fB/\fR
(division) or
\fB%\fR
(modulo) with common associativity and precedence rules\&. Parentheses may be used as well\&.
.sp
Additionally, some pre\-defined constants are provided:
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt.
T{
\fBux\fR
T}:T{
horizontal position of upper left page corner in TeX point units
T}
T{
\fBuy\fR
T}:T{
vertical position of upper left page corner in TeX point units
T}
T{
\fBh\fR
T}:T{
page height in TeX point units (0 in case of
\fB\-bnone\fR)
T}
T{
\fBw\fR
T}:T{
page width in TeX point units (0 in case of
\fB\-bnone\fR)
T}
.TE
.sp 1
Furthermore, you can use the 9 length constants
\fBpt\fR,
\fBbp\fR,
\fBcm\fR,
\fBmm\fR,
\fBin\fR,
\fBpc\fR,
\fBdd\fR,
\fBcc\fR, and
\fBsp\fR, e\&.g\&.
\fB2cm\fR
or
\fB1\&.6in\fR\&. Thus, option
\fB\-TT1in,0R45\fR
moves the page content 1 inch to the right and rotates it by 45 degrees around the page center afterwards\&.
.sp
For single transformations, there are also the short\-hand options
\fB\-c\fR,
\fB\-t\fR
and
\fB\-r\fR
available\&. In contrast to the
\fB\-\-transform\fR
commands, the order of these options is not significant, so that it\(cqs not possible to describe transformation sequences with them\&.
.sp .5v
.RE
.RE
.RE
.PP
\fB\-t, \-\-translate\fR=\fItx\fR[,\fIty\fR]
.RS 4
Translates (moves) the page content in direction of vector (\fItx\fR,\fIty\fR)\&. This option is equivalent to
\fB\-TT\fR\fItx\fR,\fIty\fR\&.
.RE
.PP
\fB\-v, \-\-verbosity\fR=\fIlevel\fR
.RS 4
Controls the type of messages printed during a dvisvgm run:
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt.
T{
\fB0\fR
T}:T{
no message output at all
T}
T{
\fB1\fR
T}:T{
error messages only
T}
T{
\fB2\fR
T}:T{
warning messages only
T}
T{
\fB4\fR
T}:T{
informational messages only
T}
.TE
.sp 1
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
By adding these values you can combine the categories\&. The default level is 7, i\&.e\&. all messages are printed\&.
.sp .5v
.RE
.RE
.PP
\fB\-V, \-\-version\fR[=\fIextended\fR]
.RS 4
Prints the version of dvisvgm and exits\&. If the optional argument is set to
\fIyes\fR, the version numbers of the linked libraries are printed as well\&.
.RE
.PP
\fB\-z, \-\-zip\fR[=\fIlevel\fR]
.RS 4
Creates a compressed SVG file with suffix \&.svgz\&. The optional argument specifies the compression level\&. Valid values are in the range of 1 to 9 (default value is 9)\&. Larger values cause better compression results but may take slightly more computation time\&.
.RE
.PP
\fB\-Z, \-\-zoom\fR=\fIfactor\fR
.RS 4
Multiplies the values of the
\fIwidth\fR
and
\fIheight\fR
attributes of the SVG root element by argument
\fIfactor\fR
while the coordinate system of the graphic content is retained\&. As a result, most SVG viewers zoom the graphics accordingly\&. If a negative zoom factor is given, the
\fIwidth\fR
and
\fIheight\fR
attributes are omitted\&.
.RE
.SH "SUPPORTED SPECIALS"
.sp
dvisvgm supports several \fIspecial commands\fR that enrich the DVI command set with additional instructions for features, like color, graphics, and hyperlinks\&. The term \fIspecial command\fR, or just \fIspecial\fR, originates from the TeX command \fB\especial{\&...}\fR which does almost nothing\&. TeX only forwards the whole command to the DVI file and delegates its execution to the DVI driver\&. The DVI driver can then decide to either process or ignore it, depending on the supported statements\&. The parameter of TeX\(cqs \fB\especial\fR command is given in curly braces and may consist of an arbitrary character sequence representing the actual instruction, for example \fBcolor Red\fR\&.
.sp
+ dvisvgm delegates the evaluation of special commands to dedicated handlers\&. Each handler is responsible for all special statements of the same command set, i\&.e\&. commands usually \(en but not necessarily \(en beginning with a common prefix\&. For example, all PDF specials start with the prefix \fBpdf:\fR, while the TPIC special set consists of 13 different commands without common identifier\&. The PDF specials are processed by dvisvgm\(cqs \fIpdf\fR handler, the TPIC ones by the \fItpic\fR handler\&. To get a list of the actually provided special handlers, use option \fB\-\-list\-specials\fR (see above)\&. The following list gives an overview of the special sets currently supported\&. The names of the handlers can also be used to disable the processing of individual sets of specials\&. For further information on this, see option \fB\-\-no\-specials\fR\&.
.PP
\fBbgcolor\fR
.RS 4
Special statements for changing the background/page color\&. Currently, dvisvgm only supports the
\fBbackground\fR
statement as specified in the
dvips manual (\m[blue]https://tug.org/texinfohtml/dvips.html#Color-specifications\m[])\&. Since SVG 1\&.1 doesn\(cqt support background colors, dvisvgm inserts a rectangle of the chosen color into the generated SVG document\&. This rectangle always gets the same size as the selected or computed bounding box\&. This background color command is part of the color special set but is handled separately in order to let the user turn it off\&.
.RE
.PP
\fBcolor\fR
.RS 4
Statements of this command set provide instructions to change the text/paint color\&. For an overview of the exact syntax, see the documentation of dvips, for instance\&.
.RE
.PP
\fBdvisvgm\fR
.RS 4
dvisvgm offers its own small set of specials\&. The following list gives a brief overview\&.
.PP
\fBdvisvgm:raw\fR \fItext\fR
.RS 4
Adds an arbitrary sequence of XML nodes to the page section of the SVG document\&. dvisvgm checks syntax and proper nesting of the inserted elements but does not perform any validation, thus the user has to ensure that the resulting SVG is still valid\&. Opening and closing tags may be distributed among different
\fIraw\fR
specials\&. The tags themselves can also be split but must be continued with the immediately following
\fIraw\fR
special\&. Both syntactically incorrect and wrongly nested tags lead to error messages\&. Parameter
\fItext\fR
may also contain the expressions
\fB{?x}\fR,
\fB{?y}\fR,
\fB{?color}\fR, and
\fB{?matrix}\fR
that expand to the current
\fIx\fR
or
\fIy\fR
coordinate, the current color, and current transformation matrix, respectively\&. Character sequence
\fB{?nl}\fR
expands to a newline character\&. Finally, constructions of the form
\fB{?(\fR\fB\fIexpr\fR\fR\fB)}\fR
enable the evaluation of mathematical expressions which may consist of basic arithmetic operations including modulo\&. Like above, the variables
\fIx\fR
and
\fIy\fR
represent the current coordinates\&. Example:
\fB{?(\-10*(x+2y)\-5)}\fR\&.
.RE
.PP
\fBdvisvgm:rawdef\fR \fItext\fR
.RS 4
This command is similar to
\fBdvisvgm:raw\fR, but puts the XML nodes into the <defs> section of the SVG document currently being generated\&.
.RE
.PP
\fBdvisvgm:rawset\fR \fIname\fR \&... \fBdvisvgm:endrawset\fR
.RS 4
This pair of specials marks the begin and end of a definition of a named raw SVG fragment\&. All
\fBdvisvgm:raw\fR
and
\fBdvisvgm:rawdef\fR
specials enclosed by
\fBdvisvgm:rawset\fR
and
\fBdvisvgm:endrawset\fR
are not evaluated immediately but stored together under the given
\fIname\fR
for later use\&. Once defined, the named fragment can be referenced throughout the DVI file by
\fBdvisvgm:rawput\fR
(see below)\&. The two commands
\fBdvisvgm:rawset\fR
and
\fBdvisvgm:endrawset\fR
must not be nested, i\&.e\&. each call of
\fBdvisvgm:rawset\fR
has to be followed by a corresponding call of
\fBdvisvgm:endrawset\fR
before another
\fBdvisvgm:rawset\fR
may occur\&. Also, the identifier
\fIname\fR
must be unique throughout the DVI file\&. Using
\fBdvisvgm:rawset\fR
multiple times together with the same
\fIname\fR
leads to warning messages\&.
.RE
.PP
\fBdvisvgm:rawput\fR \fIname\fR
.RS 4
Inserts raw SVG fragments previously stored under the given
\fIname\fR\&. dvisvgm distinguishes between fragments that were specified with
\fBdvisvgm:raw\fR
or
\fBdvisvgm:rawdef\fR, and handles them differently: It inserts all
\fBdvisvgm:raw\fR
parts every time
\fBdvisvgm:rawput\fR
is called, whereas the
\fBdvisvgm:rawdef\fR
portions go to the <defs> section of the current SVG document only once\&.
.RE
.PP
\fBdvisvgm:img\fR \fIwidth\fR \fIheight\fR \fIfile\fR
.RS 4
Creates an image element at the current graphic position referencing the given file\&. JPEG, PNG, and SVG images can be used here\&. However, dvisvgm does not check the file format or the file name suffix\&. The lengths
\fIwidth\fR
and
\fIheight\fR
can be given together with a unit specifier (see option
\fB\-\-bbox\fR) or as plain floating point numbers\&. In the latter case, TeX point units are assumed (1in = 72\&.27pt)\&.
.RE
.PP
\fBdvisvgm:bbox\fR lock
.RS 4
Locks the bounding box of the current page and prevents it from further updating, i\&.e\&. graphics elements added after calling this special are not taken into account in determining the extent of the bounding box\&.
.RE
.PP
\fBdvisvgm:bbox\fR unlock
.RS 4
Unlocks the previously locked bounding box of the current page so that it gets updated again when adding graphics elements to the page\&.
.RE
.PP
\fBdvisvgm:bbox\fR n[ew] \fIname\fR
.RS 4
Defines or resets a local bounding box called
\fIname\fR\&. The name may consist of letters and digits\&. While processing a DVI page, dvisvgm continuously updates the (global) bounding box of the current page in order to determine the minimal rectangle containing all visible page components (characters, images, drawing elements etc\&.) Additionally to the global bounding box, the user can request an arbitrary number of named local bounding boxes\&. Once defined, these boxes are updated together with the global bounding box starting with the first character that follows the definition\&. Thus, the local boxes can be used to compute the extent of parts of the page\&. This is useful for scenarios where the generated SVG file is post\-processed\&. In conjunction with special
\fBdvisvgm:raw\fR, the macro
\fB{?bbox \fR\fB\fIname\fR\fR\fB}\fR
expands to the four values
\fIx\fR,
\fIy\fR,
\fIw\fR, and
\fIh\fR
(separated by spaces) specifying the coordinates of the upper left corner, width, and height of the local box
\fIname\fR\&. If box
\fIname\fR
wasn\(cqt previously defined, all four values equal to zero\&.
.RE
.PP
\fBdvisvgm:bbox\fR \fIwidth\fR \fIheight\fR [\fIdepth\fR] [\fBtransform\fR]
.RS 4
Updates the bounding box of the current page by embedding a virtual rectangle (\fIx\fR,
\fIy\fR,
\fIwidth\fR,
\fIheight\fR) where the lower left corner is located at the current DVI drawing position (\fIx\fR,\fIy\fR)\&. If the optional parameter
\fIdepth\fR
is specified, dvisvgm embeds a second rectangle (\fIx\fR,
\fIy\fR,
\fIwidth\fR, \-\fIdepth\fR)\&. The lengths
\fIwidth\fR,
\fIheight\fR, and
\fIdepth\fR
can be given together with a unit specifier (see option
\fB\-\-bbox\fR) or as plain floating point numbers\&. In the latter case, TeX point units are assumed (1in = 72\&.27pt)\&. Depending on size and position of the virtual rectangle, this command either enlarges the overall bounding box or leaves it as is\&. It\(cqs not possible to reduce its extent\&. This special should be used together with
\fBdvisvgm:raw\fR
in order to update the viewport of the page properly\&. By default, the box extents are assigned unchanged and, in particular, are not altered by transformation commands\&. In order to apply the current transformation matrix, the optional modifier
\fBtransform\fR
can be added at the end of the special statement\&.
.RE
.PP
\fBdvisvgm:bbox\fR a[bs] \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR [\fBtransform\fR]
.RS 4
This variant of the bbox special updates the bounding box by embedding a virtual rectangle (\fIx1\fR,\fIy1\fR,\fIx2\fR,\fIy2\fR)\&. The points (\fIx1\fR,\fIy1\fR) and (\fIx2\fR,\fIy2\fR) denote the absolute coordinates of two diagonal corners of the rectangle\&. As with the relative special variant described above, the optional modifier
\fBtransform\fR
allows for applying the current transformation matrix to the bounding box\&.
.RE
.PP
\fBdvisvgm:bbox\fR f[ix] \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR [\fBtransform\fR]
.RS 4
This variant of the bbox special assigns an absolute (final) bounding box to the resulting SVG\&. After executing this command, dvisvgm doesn\(cqt further alter the bounding box coordinates, except this special is called again later\&. The points (\fIx1\fR,\fIy1\fR) and (\fIx2\fR,\fIy2\fR) denote the absolute coordinates of two diagonal corners of the rectangle\&. As with the relative special variant described above, the optional modifier
\fBtransform\fR
allows for applying the current transformation matrix to the bounding box\&.
.sp
The following TeX snippet adds two raw SVG elements to the output and updates the bounding box accordingly:
.sp
.if n \{\
.RS 4
.\}
.nf
\especial{dvisvgm:raw <circle cx=\*(Aq{?x}\*(Aq cy=\*(Aq{?y}\*(Aq r=\*(Aq10\*(Aq stroke=\*(Aqblack\*(Aq fill=\*(Aqred\*(Aq/>}%
\especial{dvisvgm:bbox 10bp 10bp 10bp transform}%
\especial{dvisvgm:bbox \-10bp 10bp 10bp transform}

\especial{dvisvgm:raw <path d=\*(AqM50 200 L10 250 H100 Z\*(Aq stroke=\*(Aqblack\*(Aq fill=\*(Aqblue\*(Aq/>}%
\especial{dvisvgm:bbox abs 10bp 200bp 100bp 250bp transform}
.fi
.if n \{\
.RE
.\}
.RE
.RE
.PP
\fBem\fR
.RS 4
These specials were introduced with the
\fIemTeX\fR
distribution by Eberhard Mattes\&. They provide line drawing statements, instructions for embedding MSP, PCX, and BMP image files, as well as two PCL commands\&. dvisvgm supports only the line drawing statements and ignores all other em specials silently\&. A description of the command syntax can be found in the DVI driver documentation coming with
emTeX (\m[blue]https://ctan.org/pkg/emtex\m[])\&.
.RE
.PP
\fBhtml\fR
.RS 4
The hyperref specification defines several variants on how to mark hyperlinked areas in a DVI file\&. dvisvgm supports the plain HyperTeX special constructs as created with hyperref package option
\fIhypertex\fR\&. By default, all linked areas of the document are marked by a rectangle\&. Option
\fB\-\-linkmark\fR
allows you to change this behavior\&. See above for further details\&. Information on syntax and semantics of the HyperTeX specials can be found in the
hyperref manual (\m[blue]https://ctan.org/pkg/hyperref\m[])\&.
.RE
.PP
\fBpapersize\fR
.RS 4
The
\fIpapersize\fR
special, which is an extension introduced by dvips, can be used to specify the widths and heights of the pages in the DVI file\&. It affects the page it appears on as well as all following pages until another papersize special is found\&. If there is more than one papersize special present on a page, dvisvgm applies the last one\&. However, in order to stay compatible with previous versions of dvisvgm that did not evaluate these specials, their processing must be explicitly enabled by adding option
\fB\-\-bbox=papersize\fR
on the command\-line\&. Otherwise, dvisvgm ignores them and computes tight bounding boxes\&.
.RE
.PP
\fBpdf\fR
.RS 4
pdfTeX and dvipdfmx introduced several special commands related to the generation of PDF files\&. Currently, only
\fIpdf:mapfile\fR,
\fIpdf:mapline\fR,
\fIpdf:pagesize\fR, and PDF hyperlink specials are supported by dvisvgm\&. The latter are the PDF pendants to the HTML HyperTeX specials generated by the hyperref package in PDF mode\&.
.sp
\fIpdf:pagesize\fR
is similar to the
\fIpapersize\fR
special (see above) which specifies the size of the current and all folowing pages\&. In order to actually apply the extents to the generated SVG files, option
\fB\-\-bbox=papersize\fR
must be given\&.
.sp
\fIpdf:mapfile\fR
and
\fIpdf:mapline\fR
allow for modifying the font map tree while processing the DVI file\&. They are used by CTeX, for example\&. dvisvgm supports both, the dvips and dvipdfm font map format\&. For further information on the command syntax and semantics, see the documentation of
\fB\epdfmapfile\fR
in the
pdfTeX user manual (\m[blue]https://ctan.org/pkg/pdftex\m[])\&.
.RE
.PP
\fBps\fR
.RS 4
The famous DVI driver
\fIdvips\fR (\m[blue]https://www.tug.org/texinfohtml/dvips.html\m[])
introduced its own set of specials in order to embed PostScript code into DVI files, which greatly improves the capabilities of DVI documents\&. One aim of dvisvgm is to completely evaluate all PostScript fragments and to convert as many of them as possible to SVG\&. In contrast to dvips, dvisvgm uses floating point arithmetics to compute the precise position of each graphic element, i\&.e\&. it doesn\(cqt round the coordinates\&. Therefore, the relative locations of the graphic elements may slightly differ from those computed by dvips\&.
.sp
Since PostScript is a rather complex language, dvisvgm does not implement its own PostScript interpreter but relies on
Ghostscript (\m[blue]https://ghostscript.com\m[])
instead\&. If the Ghostscript library was not linked to the dvisvgm binary, it is looked up and loaded dynamically during runtime\&. In this case, dvisvgm looks for
\fIlibgs\&.so\&.X\fR
on Unix\-like systems (supported ABI versions: 7,8,9), for
\fIlibgs\&.X\&.dylib\fR
on macOS, and for
\fIgsdll32\&.dll\fR
or
\fIgsdll64\&.dll\fR
on Windows\&. You can override the default file names with environment variable
\fBLIBGS\fR
or the command\-line option
\fB\-\-libgs\fR\&. The library must be reachable through the ld search path (*nix) or the PATH environment variable (Windows)\&. Alternatively, the absolute file path can be specified\&. If the library cannot be found, dvisvgm disables the processing of PostScript specials and prints a warning message\&. Use option
\fB\-\-list\-specials\fR
to check whether PostScript support is available, i\&.e\&. entry
\fIps\fR
is present\&.
.sp
The PostScript handler also recognizes and evaluates bounding box data generated by the
preview package (\m[blue]https://ctan.org/pkg/preview\m[])
with option
\fItightpage\fR\&. If such data is present in the DVI file and if dvisvgm is called with option
\fB\-\-bbox=preview\fR, dvisvgm sets the width and total height of the SVG file to the values derived from the preview data\&. Additionally, it prints a message showing the width, height, and depth of the box in TeX point units to the console\&. Especially, the depth value can be read by a post\-processor to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL\-FO documents, for example\&. Please note that SVG bounding boxes are defined by a width and (total) height\&. In contrast to TeX, SVG provides no means to differentiate between height and depth, i\&.e\&. the vertical extents above and below the baseline, respectively\&. Therefore, it is generally not possible to retrieve the depth value from the SVG file itself\&.
.sp
If you call dvisvgm with option
\fB\-\-bbox=min\fR
(the default) and preview data is present in the DVI file, dvisvgm doesn\(cqt apply the preview extents but computes a bounding box that tightly encloses the page contents\&. The height, depth and width values written to console are adapted accordingly\&.
.RE
.PP
\fBtpic\fR
.RS 4
The TPIC special set defines instructions for drawing simple geometric objects\&. Some LaTeX packages, like eepic and tplot, use these specials to describe graphics\&.
.RE
.SH "EXAMPLES"
.PP
\fBdvisvgm file\fR
.RS 4
Converts the first page of
\fIfile\&.dvi\fR
to
\fIfile\&.svg\fR\&.
.RE
.PP
\fBdvisvgm \-p1\-5 file\fR
.RS 4
Converts the first five pages of
\fIfile\&.dvi\fR
to
\fIfile\-1\&.svg\fR,\&...,\fIfile\-5\&.svg\fR\&.
.RE
.PP
\fBdvisvgm \-p1\- file\fR
.RS 4
Converts all pages of
\fIfile\&.dvi\fR
to separate SVG files\&.
.RE
.PP
\fBdvisvgm \-p1,3 \-O file\fR
.RS 4
Converts the first and third page of
\fIfile\&.dvi\fR
to optimized SVG files\&.
.RE
.PP
\fBdvisvgm \- < file\&.dvi\fR
.RS 4
Converts the first page of
\fIfile\&.dvi\fR
to
\fIstdin\&.svg\fR
where the contents of
\fIfile\&.dvi\fR
is read from
\fBstdin\fR\&.
.RE
.PP
\fBdvisvgm \-z file\fR
.RS 4
Converts the first page of
\fIfile\&.dvi\fR
to
\fIfile\&.svgz\fR
with default compression level 9\&.
.RE
.PP
\fBdvisvgm \-p5 \-z3 \-ba4\-l \-o newfile file\fR
.RS 4
Converts the fifth page of
\fIfile\&.dvi\fR
to
\fInewfile\&.svgz\fR
with compression level 3\&. The bounding box is set to DIN/ISO A4 in landscape format\&.
.RE
.PP
\fBdvisvgm \-\-transform="R20,w/3,2h/5 T1cm,1cm S2,3" file\fR
.RS 4
Converts the first page of
\fIfile\&.dvi\fR
to
\fIfile\&.svg\fR
where three transformations are applied\&.
.RE
.SH "ENVIRONMENT"
.sp
dvisvgm uses the \fBkpathsea\fR library for locating the files that it opens\&. Hence, the environment variables described in the library\(cqs documentation influence the converter\&.
.sp
If dvisvgm was linked without the Ghostscript library, and if PostScript support has not been disabled, the shared Ghostscript library is looked up during runtime via dlopen()\&. The environment variable \fBLIBGS\fR can be used to specify path and file name of the library\&.
.sp
The pre\-compiled Windows versions of dvisvgm require a working installation of MiKTeX 2\&.9 or above\&. dvisvgm does not work together with the portable edition of MiKTeX because it relies on MiKTeX\(cqs COM interface that is only accessible in a local installation\&. To enable the evaluation of PostScript specials, the original Ghostscript DLL \fIgsdll32\&.dll\fR must be present and reachable through the search path\&. 64\-bit Windows builds require the 64\-bit Ghostscript DLL \fIgsdll64\&.dll\fR\&. Both DLLs come with the corresponding Ghostscript installers available from \m[blue]\fBhttps://ghostscript\&.com\fR\m[]\&.
.sp
The environment variable \fBDVISVGM_COLORS\fR specifies the colors used to highlight various parts of dvisvgm\(cqs message output\&. It is only evaluated if option \fB\-\-color\fR is given\&. The value of \fBDVISVGM_COLORS\fR is a list of colon\-separated entries of the form \fIgg\fR=\fIBF\fR, where \fIgg\fR denotes one of the color group indicators listed below, and \fIBF\fR are two hexadecimal digits specifying the background (first digit) and foreground/text color (second digit)\&. The color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta, D=bright cyan, E=bright gray, F=white\&. Depending on the terminal, the colors may differ\&. Rather than changing both the text and background color, it\(cqs also possible to change only one of them: An asterisk (*) in place of a hexadecimal digit indicates the default text or background color of the terminal\&.
.sp
All malformed entries in the list are silently ignored\&.
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
.sp
\fBer\fR
T}:T{
.sp
error messages
T}
T{
.sp
\fBwn\fR
T}:T{
.sp
warning messages
T}
T{
.sp
\fBpn\fR
T}:T{
.sp
messages about page numbers
T}
T{
.sp
\fBps\fR
T}:T{
.sp
page size messages
T}
T{
.sp
\fBfw\fR
T}:T{
.sp
information about the files written
T}
T{
.sp
\fBsm\fR
T}:T{
.sp
state messages
T}
T{
.sp
\fBtr\fR
T}:T{
.sp
messages of the glyph tracer
T}
T{
.sp
\fBpi\fR
T}:T{
.sp
progress indicator
T}
.TE
.sp 1
.sp
\fBExample:\fR \fBer=01:pi=*5\fR sets the colors of error messages (\fBer\fR) to red (\fB1\fR) on black (\fB0\fR), and those of progress indicators (\fBpi\fR) to cyan (\fB5\fR) on default background (\fB*\fR)\&.
.sp
Variable \fBDVISVGM_PDF_PROC\fR allows you to select the desired PDF processor\&. dvisvgm requires either Ghostscript (version < 10\&.1\&.0) or mutool to process PDF files\&. IF \fBDVISVGM_PDF_PROC\fR is not set, dvisvgm tries to detect the available processors\&. See option \fB\-\-pdf\fR for further information\&. To select a specific PDF processor, you can set \fBDVISVGM_PDF_PROC\fR to \fBgs\fR or \fBmutool\fR which forces the use of Ghostscript and mutool respectively\&.
.SH "FILES"
.sp
The location of the following files is determined by the kpathsea library\&. To check the actual kpathsea configuration you can use the \fBkpsewhich\fR utility\&.
.TS
tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
.sp
\fB*\&.enc\fR
T}:T{
.sp
Font encoding files
T}
T{
.sp
\fB*\&.fgd\fR
T}:T{
.sp
Font glyph data files (cache files created by dvisvgm)
T}
T{
.sp
\fB*\&.map\fR
T}:T{
.sp
Font map files
T}
T{
.sp
\fB*\&.mf\fR
T}:T{
.sp
Metafont input files
T}
T{
.sp
\fB*\&.pfb\fR
T}:T{
.sp
PostScript Type 1 font files
T}
T{
.sp
\fB*\&.pro\fR
T}:T{
.sp
PostScript header/prologue files
T}
T{
.sp
\fB*\&.tfm\fR
T}:T{
.sp
TeX font metric files
T}
T{
.sp
\fB*\&.ttf\fR
T}:T{
.sp
TrueType font files
T}
T{
.sp
\fB*\&.vf\fR
T}:T{
.sp
Virtual font files
T}
.TE
.sp 1
.SH "SEE ALSO"
.sp
\fBtex(1), mf(1), mktexmf(1), grodvi(1), potrace(1)\fR, and the \fBkpathsea library\fR info documentation\&.
.SH "RESOURCES"
.PP
Project home page
.RS 4
\m[blue]\fBhttps://dvisvgm\&.de\fR\m[]
.RE
.PP
Code repository
.RS 4
\m[blue]\fBhttps://github\&.com/mgieseki/dvisvgm\fR\m[]
.RE
.SH "BUGS"
.sp
Please report bugs using the bug tracker at GitHub (\m[blue]https://github.com/mgieseki/dvisvgm/issues\m[])\&.
.SH "AUTHOR"
.sp
Written by Martin Gieseking <\m[blue]\fBmartin\&.gieseking@uos\&.de\fR\m[]>
.SH "COPYING"
.sp
Copyright \(co 2005\-2023 Martin Gieseking\&. Free use of this software is granted under the terms of the GNU General Public License (GPL) version 3 or, (at your option) any later version\&.