~ubuntu-branches/ubuntu/utopic/asciidoc/utopic

« back to all changes in this revision

Viewing changes to doc/latexmath.txt

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2010-11-27 23:19:57 UTC
  • mfrom: (1.1.12 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20101127231957-jxdmrk7z7lkcqy3l
Tags: 8.6.3-1
* New upstream version (Closes: #595324)
* Support asciidoc API (Closes: #526351)
* Depend on python >= 2.4 (Closes: #571303)
* Do not compress .txt files (Closes: #592423)
* Enhance asciidoc manpage (Closes: #499497)
* Move some of the Recommends (vim-addon-manager, source-highlight) to 
  Suggests (Closes: #564015)
* Bump standards version (No changes)
* Add README.Source file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Embedding LaTeX Math in AsciiDoc dblatex documents
2
2
==================================================
3
3
 
4
 
You can include
5
 
ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf[LaTeX math]
6
 
equations in AsciiDoc documents that are processed by 'dblatex'.
 
4
You can include LaTeX math equations in AsciiDoc documents that are
 
5
processed by http://dblatex.sourceforge.net/[dblatex]. The AsciiDoc
 
6
'latexmath' macros and passthrough blocks generate DocBook
 
7
'inlineequation', 'informalequation' and 'equation' elements
 
8
containing the LaTeX markup which is processed by 'dblatex'.
7
9
 
8
10
 
9
11
Inline equations
12
14
 
13
15
---------------------------------------------------------------------
14
16
An inline equation latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
15
 
using the 'math' inline macro.
16
 
 
17
 
You can use the same 'math' macro to inject arbitrary latexmath:[\LaTeX] markup
18
 
(but beware, this is an undocumented trick).
 
17
using the 'latexmath' inline macro.
19
18
---------------------------------------------------------------------
20
19
 
21
20
Renders:
22
21
 
23
22
An inline equation latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
24
 
using the 'math' inline macro.
25
 
 
26
 
You can use the same 'math' macro to inject arbitrary latexmath:[\LaTeX] markup
27
 
(but beware, this is an undocumented trick).
 
23
using the 'latexmath' inline macro.
28
24
 
29
25
 
30
26
Informal equations
31
27
------------------
32
 
Informal (untitled) equations are generated with a 'math' style
 
28
Informal (untitled) equations are generated with a 'latexmath' style
33
29
passthrough delimited block. This markup:
34
30
 
35
31
---------------------------------------------------------------------
59
55
 
60
56
Formal equations
61
57
----------------
62
 
Formal equations are titled and are generated with a 'math' style
 
58
Formal equations are titled and are generated with a 'latexmath' style
63
59
passthrough delimited block.
64
60
 
65
61
This markup:
66
62
 
67
63
---------------------------------------------------------------------
68
 
.Unnumbered
69
 
[latexmath]
70
 
++++++++++++++++++++++++++++++++++++++++++++
71
 
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
72
 
++++++++++++++++++++++++++++++++++++++++++++
73
 
---------------------------------------------------------------------
74
 
 
75
 
Renders:
76
 
 
77
 
.Unnumbered
78
 
[latexmath]
79
 
++++++++++++++++++++++++++++++++++++++++++++
80
 
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
81
 
++++++++++++++++++++++++++++++++++++++++++++
82
 
 
83
 
This markup:
84
 
 
85
 
---------------------------------------------------------------------
86
 
.Aligned
87
 
[latexmath]
88
 
++++++++++++++++++++++++++++++++++++++++++++
89
 
\begin{align*}
90
 
2x^2 + 3(x-1)(x-2) & = 2x^2 + 3(x^2-3x+2) \\
91
 
&= 2x^2 + 3x^2 - 9x + 6 \\
92
 
&= 5x^2 - 9x + 6
93
 
\end{align*}
94
 
++++++++++++++++++++++++++++++++++++++++++++
95
 
---------------------------------------------------------------------
96
 
 
97
 
Renders:
98
 
 
99
 
.Unnumbered
100
 
.Aligned
101
 
[latexmath]
102
 
++++++++++++++++++++++++++++++++++++++++++++
103
 
\begin{align*}
104
 
2x^2 + 3(x-1)(x-2) & = 2x^2 + 3(x^2-3x+2) \\
105
 
&= 2x^2 + 3x^2 - 9x + 6 \\
106
 
&= 5x^2 - 9x + 6
107
 
\end{align*}
108
 
++++++++++++++++++++++++++++++++++++++++++++
109
 
 
110
 
This markup:
111
 
 
112
 
---------------------------------------------------------------------
113
 
.Array
114
 
[latexmath]
115
 
++++++++++++++++++++++++++++++++++++++++++++
116
 
\begin{eqnarray}
117
 
x & = & \frac{-7 \pm \sqrt{49 - 24}}{6} \\
118
 
& = & -2 \textrm{ or } -\frac13
119
 
\end{eqnarray}
120
 
++++++++++++++++++++++++++++++++++++++++++++
121
 
---------------------------------------------------------------------
122
 
 
123
 
Renders:
124
 
 
125
 
.Array
126
 
[latexmath]
127
 
++++++++++++++++++++++++++++++++++++++++++++
128
 
\begin{eqnarray}
129
 
x & = & \frac{-7 \pm \sqrt{49 - 24}}{6} \\
130
 
& = & -2 \textrm{ or } -\frac13
131
 
\end{eqnarray}
132
 
++++++++++++++++++++++++++++++++++++++++++++
133
 
 
134
 
This markup:
135
 
 
136
 
---------------------------------------------------------------------
137
 
.Array
138
 
[latexmath]
139
 
++++++++++++++++++++++++++++++++++++++++++++
140
 
\begin{eqnarray*}
141
 
4r^2\int_0^{\pi/2} \cos^2 \theta\, d\theta
142
 
&=& 4r^2\int_0^{\pi/2} \frac{1}{2}(1 + \cos 2\theta) \,d\theta\\
143
 
& = & {2r^2\theta}\Bigg{|}_0^{\pi/2}
144
 
  + 2r^2\int_0^{\pi/2} \cos 2\theta \,d\theta\\
145
 
& = & \pi r^2 + 2r^2(\sin2\theta)\Bigg{|}_0^{\pi/2}\\
146
 
& = & \pi r^2
147
 
\end{eqnarray*}
148
 
++++++++++++++++++++++++++++++++++++++++++++
149
 
---------------------------------------------------------------------
150
 
 
151
 
Renders:
152
 
 
153
 
.Array
154
 
[latexmath]
155
 
++++++++++++++++++++++++++++++++++++++++++++
156
 
\begin{eqnarray*}
157
 
4r^2\int_0^{\pi/2} \cos^2 \theta\, d\theta
158
 
&=& 4r^2\int_0^{\pi/2} \frac{1}{2}(1 + \cos 2\theta) \,d\theta\\
159
 
& = & {2r^2\theta}\Bigg{|}_0^{\pi/2}
160
 
  + 2r^2\int_0^{\pi/2} \cos 2\theta \,d\theta\\
161
 
& = & \pi r^2 + 2r^2(\sin2\theta)\Bigg{|}_0^{\pi/2}\\
162
 
& = & \pi r^2
163
 
\end{eqnarray*}
164
 
++++++++++++++++++++++++++++++++++++++++++++
165
 
 
166
 
This markup:
167
 
 
168
 
---------------------------------------------------------------------
169
 
.List
170
 
[latexmath]
171
 
++++++++++++++++++++++++++++++++++++++++++++
172
 
\begin{enumerate}
173
 
\item $\frac{da}{dx} = 0$
174
 
\item $\frac{d}{dx} ax = a$
175
 
\item $\frac{d}{dx} x^n = nx^{n-1}$
176
 
\item $\displaystyle \frac{d}{dx} (f(x) + g(x))
177
 
  = \frac{d}{dx} f(x) + \frac{d}{dx} g(x)$
178
 
\item $\displaystyle \frac{d}{dx} f(x)g(x)
179
 
  = g(x) \frac{d}{dx} f(x) + f(x) \frac{d}{dx} g(x)$
180
 
\item $\displaystyle  \frac{d}{dx} \frac{f(x)}{g(x)}
181
 
  = \frac{g(x) \frac{d}{dx} f(x) - f(x) \frac{d}{dx} g(x)}{(g(x))^2}$
182
 
\end{enumerate}
183
 
++++++++++++++++++++++++++++++++++++++++++++
184
 
---------------------------------------------------------------------
185
 
 
186
 
Renders:
187
 
 
188
 
.List
189
 
[latexmath]
190
 
++++++++++++++++++++++++++++++++++++++++++++
191
 
\begin{enumerate}
192
 
\item $\frac{da}{dx} = 0$
193
 
\item $\frac{d}{dx} ax = a$
194
 
\item $\frac{d}{dx} x^n = nx^{n-1}$
195
 
\item $\displaystyle \frac{d}{dx} (f(x) + g(x))
196
 
  = \frac{d}{dx} f(x) + \frac{d}{dx} g(x)$
197
 
\item $\displaystyle \frac{d}{dx} f(x)g(x)
198
 
  = g(x) \frac{d}{dx} f(x) + f(x) \frac{d}{dx} g(x)$
199
 
\item $\displaystyle  \frac{d}{dx} \frac{f(x)}{g(x)}
200
 
  = \frac{g(x) \frac{d}{dx} f(x) - f(x) \frac{d}{dx} g(x)}{(g(x))^2}$
201
 
\end{enumerate}
202
 
++++++++++++++++++++++++++++++++++++++++++++
203
 
 
204
 
This markup:
205
 
 
206
 
---------------------------------------------------------------------
207
 
.Matrix
208
 
[latexmath]
209
 
++++++++++++++++++++++++++++++++++++++++++++
210
 
\[ P^{e \rightarrow c}= \left[
211
 
  \begin{array}{*{3}{r@{}l}}
212
 
  & \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
213
 
 
214
 
  & \sin \theta \sin \psi
215
 
  & & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
216
 
  & - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
217
 
 
218
 
  - & \sin \theta \cos \psi
219
 
  & & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
220
 
  & - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
221
 
  \end{array}
222
 
\right] \]
223
 
++++++++++++++++++++++++++++++++++++++++++++
224
 
---------------------------------------------------------------------
225
 
 
226
 
Renders:
227
 
 
228
 
.Matrix
229
 
[latexmath]
230
 
++++++++++++++++++++++++++++++++++++++++++++
231
 
\[ P^{e \rightarrow c}= \left[
232
 
  \begin{array}{*{3}{r@{}l}}
233
 
  & \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
234
 
 
235
 
  & \sin \theta \sin \psi
236
 
  & & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
237
 
  & - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
238
 
 
239
 
  - & \sin \theta \cos \psi
240
 
  & & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
241
 
  & - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
242
 
  \end{array}
243
 
\right] \]
244
 
++++++++++++++++++++++++++++++++++++++++++++
 
64
.First equation
 
65
[latexmath]
 
66
++++++++++++++++++++++++++++++++++++++++++++
 
67
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
 
68
++++++++++++++++++++++++++++++++++++++++++++
 
69
---------------------------------------------------------------------
 
70
 
 
71
Renders:
 
72
 
 
73
.First equation
 
74
[latexmath]
 
75
++++++++++++++++++++++++++++++++++++++++++++
 
76
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
 
77
++++++++++++++++++++++++++++++++++++++++++++
 
78
 
 
79
This markup:
 
80
 
 
81
---------------------------------------------------------------------
 
82
.Matrix
 
83
[latexmath]
 
84
++++++++++++++++++++++++++++++++++++++++++++
 
85
\[ P^{e \rightarrow c}= \left[
 
86
  \begin{array}{*{3}{r@{}l}}
 
87
  & \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
 
88
 
 
89
  & \sin \theta \sin \psi
 
90
  & & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
 
91
  & - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
 
92
 
 
93
  - & \sin \theta \cos \psi
 
94
  & & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
 
95
  & - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
 
96
  \end{array}
 
97
\right] \]
 
98
++++++++++++++++++++++++++++++++++++++++++++
 
99
---------------------------------------------------------------------
 
100
 
 
101
Renders:
 
102
 
 
103
.Matrix
 
104
[latexmath]
 
105
++++++++++++++++++++++++++++++++++++++++++++
 
106
\[ P^{e \rightarrow c}= \left[
 
107
  \begin{array}{*{3}{r@{}l}}
 
108
  & \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
 
109
 
 
110
  & \sin \theta \sin \psi
 
111
  & & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
 
112
  & - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
 
113
 
 
114
  - & \sin \theta \cos \psi
 
115
  & & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
 
116
  & - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
 
117
  \end{array}
 
118
\right] \]
 
119
++++++++++++++++++++++++++++++++++++++++++++
 
120
 
 
121