File: formath.texi

package info (click to toggle)
gnuastro 0.24-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,360 kB
  • sloc: ansic: 185,444; sh: 15,785; makefile: 1,303; cpp: 9
file content (70 lines) | stat: -rw-r--r-- 1,482 bytes parent folder | download
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
@ignore
Some macros to be able to show math nicely in HTML and TeX.  The
problem is that when you use braces in the TeX commands, Texinfo will
complain for other formats and when you quote the braces with the at
sign, e.g. @{, then TeX will not see the brace properly.

So I made two macro functions: mymath{} and dispmath{}.  The first is
for inline math and the second is for display math where the equation
has a line of its own.

For the other formats, everything is normal, except the display math
equations that don't have any proper solution, so I have just put a $$
$$ around the math.

Copyright (C) 2015-2025 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without any warranty.
@end ignore

@c HTML:
@ifhtml
@macro mymath{arg}
@inlineraw{html,\\(\arg\\\)}
@end macro

@macro dispmath{arg}
@inlineraw{html,$$\arg\$$}
@end macro
@end ifhtml


@c Docbook
@ifdocbook
@macro mymath{arg}
@math{\arg\}
@end macro

@macro dispmath{arg}
@center@inlineraw{docbook,$$\arg\$$}
@end macro
@end ifdocbook


@c info and plaintext
@ifinfo
@macro mymath{arg}
@inlineraw{info,$\arg\$}
@end macro

@macro dispmath{arg}
@center@inlineraw{info,$$\arg\$$}
@end macro
@end ifinfo


@c TeX
@iftex
@macro mymath{arg}
@math{\arg\}
@end macro

@macro dispmath{arg}
@tex
$$\arg\$$
@end tex
@end macro
@end iftex