asciidoctor-latex 1.5.0.3.dev → 1.5.0.4.dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +28 -5
  3. data/README.adoc +48 -23
  4. data/Rakefile +2 -1
  5. data/data/asciidoc_tex_macros.tex +86 -3
  6. data/data/extras.css +73 -1
  7. data/data/preamble_article.tex +15 -6
  8. data/data/preamble_book.tex +25 -9
  9. data/examples/README.adoc +341 -9
  10. data/examples/README.html +915 -0
  11. data/examples/math_article.adoc +46 -46
  12. data/examples/xref-equations.adoc +1 -2
  13. data/lib/asciidoctor-latex/click.css +2 -0
  14. data/lib/asciidoctor-latex/click.js +6 -0
  15. data/lib/asciidoctor-latex/jquery.js +4 -0
  16. data/lib/asciidoctor-latex/preamble_processor.rb +18 -0
  17. data/lib/asciidoctor/latex/click_block.rb +7 -4
  18. data/lib/asciidoctor/latex/converter.rb +75 -29
  19. data/lib/asciidoctor/latex/core_ext/utility.rb +55 -0
  20. data/lib/asciidoctor/latex/css.rb +50 -0
  21. data/lib/asciidoctor/latex/environment_block.rb +13 -6
  22. data/lib/asciidoctor/latex/inject_html.rb +2 -1
  23. data/lib/asciidoctor/latex/node_processors.rb +329 -152
  24. data/lib/asciidoctor/latex/prepend_processor.rb +1 -0
  25. data/lib/asciidoctor/latex/tex_postprocessor.rb +8 -3
  26. data/lib/asciidoctor/latex/tex_preprocessor.rb +31 -9
  27. data/lib/asciidoctor/latex/version.rb +1 -1
  28. data/test/examples/adoc/ampersand.adoc +2 -0
  29. data/test/examples/adoc/block_olist.adoc +58 -0
  30. data/test/examples/adoc/block_ulist.adoc +42 -0
  31. data/test/examples/adoc/box.adoc +35 -1
  32. data/test/examples/adoc/chem.adoc +8 -0
  33. data/test/examples/adoc/click_plain.adoc +24 -0
  34. data/test/examples/adoc/dlist.adoc +15 -0
  35. data/test/examples/adoc/env2.adoc +57 -0
  36. data/test/examples/adoc/env_joke.adoc +12 -0
  37. data/test/examples/adoc/env_plain.adoc +10 -0
  38. data/test/examples/adoc/eq-latex.adoc +39 -0
  39. data/test/examples/adoc/eq.adoc +18 -0
  40. data/test/examples/adoc/eq.tex +28 -0
  41. data/test/examples/adoc/eqalign.adoc +19 -6
  42. data/test/examples/adoc/eqalign.tex +25 -0
  43. data/test/examples/adoc/eqno-latex.adoc +120 -0
  44. data/test/examples/adoc/extras.adoc +14 -0
  45. data/test/examples/adoc/hypertarget.adoc +29 -0
  46. data/test/examples/adoc/image.adoc +7 -0
  47. data/test/examples/adoc/newEnvironments.tex +0 -0
  48. data/test/examples/adoc/table.adoc +6 -0
  49. data/test/examples/adoc/table.tex +10 -0
  50. data/test/examples/adoc/tex_pathologies.adoc +30 -0
  51. data/test/examples/html/env.html +147 -0
  52. data/test/examples/html/equations.html +14 -0
  53. data/test/examples/tex/ampersand.tex +2 -0
  54. data/test/examples/tex/block_admonition.tex +20 -0
  55. data/test/examples/tex/block_audio.tex +7 -0
  56. data/test/examples/tex/block_colist.tex +23 -0
  57. data/test/examples/tex/block_dlist.tex +117 -0
  58. data/test/examples/tex/block_example.tex +20 -0
  59. data/test/examples/tex/block_floating_title.tex +20 -0
  60. data/test/examples/tex/block_image.tex +46 -0
  61. data/test/examples/tex/block_listing.tex +59 -0
  62. data/test/examples/tex/block_literal.tex +28 -0
  63. data/test/examples/tex/block_olist.tex +119 -0
  64. data/test/examples/tex/block_open.tex +22 -0
  65. data/test/examples/tex/block_outline.tex +25 -0
  66. data/test/examples/tex/block_page_break.tex +4 -0
  67. data/test/examples/tex/block_paragraph.tex +13 -0
  68. data/test/examples/tex/block_pass.tex +3 -0
  69. data/test/examples/tex/block_preamble.tex +15 -0
  70. data/test/examples/tex/block_quote.tex +51 -0
  71. data/test/examples/tex/block_sidebar.tex +21 -0
  72. data/test/examples/tex/block_stem.tex +19 -0
  73. data/test/examples/tex/block_table.tex +188 -0
  74. data/test/examples/tex/block_thematic_break.tex +1 -0
  75. data/test/examples/tex/block_toc.tex +27 -0
  76. data/test/examples/tex/block_ulist.tex +96 -0
  77. data/test/examples/tex/block_verse.tex +39 -0
  78. data/test/examples/tex/block_video.tex +15 -0
  79. data/test/examples/tex/box.tex +25 -0
  80. data/test/examples/tex/chem.tex +7 -0
  81. data/test/examples/tex/click_plain.tex +25 -0
  82. data/test/examples/tex/dlist.tex +17 -0
  83. data/test/examples/tex/document.tex +25 -0
  84. data/test/examples/tex/embedded.tex +7 -0
  85. data/test/examples/tex/env.tex +7 -7
  86. data/test/examples/tex/env2.tex +29 -0
  87. data/test/examples/tex/env_joke.tex +9 -0
  88. data/test/examples/tex/env_plain.tex +7 -0
  89. data/test/examples/tex/eq-latex.tex +49 -0
  90. data/test/examples/tex/eq.tex +9 -0
  91. data/test/examples/tex/eqalign.tex +23 -0
  92. data/test/examples/tex/eqno-latex.tex +237 -0
  93. data/test/examples/tex/exponent1.tex +2 -0
  94. data/test/examples/tex/exponent2.tex +4 -0
  95. data/test/examples/tex/extras.tex +13 -0
  96. data/test/examples/tex/hypertarget.tex +25 -0
  97. data/test/examples/tex/image.tex +4 -0
  98. data/test/examples/tex/inline_anchor.tex +25 -0
  99. data/test/examples/tex/inline_break.tex +7 -0
  100. data/test/examples/tex/inline_button.tex +1 -0
  101. data/test/examples/tex/inline_callout.tex +4 -0
  102. data/test/examples/tex/inline_footnote.tex +9 -0
  103. data/test/examples/tex/inline_image.tex +25 -0
  104. data/test/examples/tex/inline_kbd.tex +3 -0
  105. data/test/examples/tex/inline_menu.tex +5 -0
  106. data/test/examples/tex/inline_quoted.tex +63 -0
  107. data/test/examples/tex/line_break.tex +4 -0
  108. data/test/examples/tex/listing.tex +10 -0
  109. data/test/examples/tex/literal.tex +42 -0
  110. data/test/examples/tex/macro_underscore.tex +6 -0
  111. data/test/examples/tex/math.tex +8 -0
  112. data/test/examples/tex/open_block.tex +10 -0
  113. data/test/examples/tex/page_break.tex +4 -0
  114. data/test/examples/tex/pass.tex +3 -0
  115. data/test/examples/tex/section.tex +51 -0
  116. data/test/examples/tex/sections.tex +13 -0
  117. data/test/examples/tex/table.tex +10 -0
  118. data/test/examples/tex/tex_pathologies.tex +26 -0
  119. data/test/examples/tex/zero.tex +1 -1
  120. metadata +188 -26
  121. data/examples/box.adoc +0 -16
  122. data/examples/chem.adoc +0 -17
  123. data/examples/eq-alignment.adoc +0 -5
  124. data/examples/eq-block.adoc +0 -60
  125. data/test/examples/adoc/admonition.adoc +0 -11
  126. data/test_jc/admonition.adoc +0 -4
  127. data/test_jc/click.adoc +0 -7
  128. data/test_jc/env.adoc +0 -31
  129. data/test_jc/example.adoc +0 -17
  130. data/test_jc/floating_title.adoc +0 -15
  131. data/test_jc/image.adoc +0 -84
  132. data/test_jc/images/frog.jpg +0 -0
  133. data/test_jc/images/red_frog.jpeg +0 -0
  134. data/test_jc/images/yellow_frog.jpeg +0 -0
  135. data/test_jc/listing.adoc +0 -9
  136. data/test_jc/lists.adoc +0 -20
  137. data/test_jc/math.adoc +0 -10
  138. data/test_jc/preamble.adoc +0 -14
  139. data/test_jc/section-numbered.adoc +0 -9
  140. data/test_jc/section.adoc +0 -7
  141. data/test_jc/sidebar.adoc +0 -61
  142. data/test_jc/verse.adoc +0 -15
@@ -0,0 +1,39 @@
1
+ %== .basic ==%
2
+ \begin{verse}
3
+ The fog comes
4
+ on little cat feet.
5
+ \end{verse}
6
+
7
+ %== .basic_with_attribution ==%
8
+ \begin{verse}
9
+ The fog comes
10
+ on little cat feet.
11
+ \end{verse}
12
+
13
+ %== .basic_with_attribution_and_citetitle ==%
14
+ \begin{verse}
15
+ The fog comes
16
+ on little cat feet.
17
+ \end{verse}
18
+
19
+ %== .basic_with_title ==%
20
+ \begin{verse}
21
+ The fog comes
22
+ on little cat feet.
23
+ \end{verse}
24
+
25
+ %== .basic_with_id_and_role ==%
26
+ \begin{verse}
27
+ The fog comes
28
+ on little cat feet.
29
+ \end{verse}
30
+
31
+ %== .block ==%
32
+ \begin{verse}
33
+ The fog comes
34
+ on little cat feet.
35
+ It sits looking
36
+ over harbor and city
37
+ on silent haunches
38
+ and then moves on.
39
+ \end{verse}
@@ -0,0 +1,15 @@
1
+ %== .basic ==%
2
+
3
+ %== .with_poster ==%
4
+
5
+ %== .with_dimensions ==%
6
+
7
+ %== .with_start ==%
8
+
9
+ %== .with_end ==%
10
+
11
+ %== .with_options ==%
12
+
13
+ %== .with_title ==%
14
+
15
+ %== .with_id_and_role ==%
@@ -0,0 +1,25 @@
1
+ \titledasciidocbox{}{Buurem lok medes, nor. Paat for deng zu locnoop.
2
+ Vor daal grustem balimor tuul, man vep, dar slek.
3
+ Morem labdis zoruk opmaak del!}
4
+
5
+
6
+ \titledasciidocbox{}{Buurem lok medes, nor. Paat for deng zu locnoop.
7
+ Vor daal grustem balimor tuul, man vep, dar slek.
8
+ Morem labdis zoruk opmaak del!}
9
+
10
+
11
+ This is a common problem and it is the first thing I check when I’m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the .js link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.
12
+
13
+
14
+ This is a common problem and it is the first thing I check when I’m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the .js link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.
15
+
16
+
17
+ This is a common problem and it is the first thing I check when I’m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the .js link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.
18
+
19
+
20
+ This is a common problem and it is the first thing I check when I’m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the .js link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.
21
+
22
+
23
+ This is a common problem and it is the first thing I check when I’m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the .js link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.
24
+
25
+
@@ -0,0 +1,7 @@
1
+ %== .chem-env ==%
2
+ \begin{equation}
3
+ \ce{2Fe2O3 + 3C -> 4Fe + 3CO2}
4
+ \end{equation}
5
+
6
+ %== .chem-inline ==%
7
+ $\ce{ Fe3+ }$, $\ce{ H20 }$
@@ -0,0 +1,25 @@
1
+ %== .click-normal ==%
2
+ \begin{remark*}
3
+ {\it This is a normal remark.}
4
+ \end{remark*}
5
+
6
+ %== .click-plain ==%
7
+ \begin{remark*}
8
+ {\rm This is a plain remark.}
9
+ \end{remark*}
10
+
11
+ %== .click-no-number ==%
12
+ \begin{remark-click-numbered}
13
+ This is a numbered remark.
14
+ \end{remark-click-numbered}
15
+ \begin{remark-click-numbered}
16
+ So is this.
17
+ \end{remark-click-numbered}
18
+
19
+ %== .numbered ==%
20
+ \begin{remark}
21
+ {\it This is a numbered remark.}
22
+ \end{remark}
23
+ \begin{remark}
24
+ {\it So is this.}
25
+ \end{remark}
@@ -0,0 +1,17 @@
1
+ %== .dlist ==%
2
+ \begin{description}
3
+ \item[Foo]A lambda expession of the first kind
4
+ \item[Bar]A lambda expressi of the second kind. A lambda expressi of the second kind.
5
+ A lambda expressi of the second kind.
6
+ A lambda expressi of the second kind.
7
+ A lambda expressi of the second kind.
8
+ A lambda expressi of the second kind.
9
+ A lambda expressi of the second kind.
10
+ A lambda expressi of the second kind.
11
+ \item[Baababababbababa]A very long word. A very long word.
12
+ A very long word. A very long word.
13
+ A very long word. A very long word.
14
+ A very long word. A very long word.
15
+ A very long word. A very long word.
16
+ \item[X]A short word.
17
+ \end{description}
@@ -0,0 +1,25 @@
1
+ %== .title ==%
2
+
3
+ %== .title_with_author ==%
4
+
5
+ %== .title_with_author_no_email ==%
6
+
7
+ %== .title_with_multiple_authors ==%
8
+
9
+ %== .title_with_revnumber ==%
10
+
11
+ %== .title_with_revdate ==%
12
+
13
+ %== .title_with_revremark ==%
14
+
15
+ %== .footnotes ==%
16
+ The hail-and-rainbow protocol can be initiated at five levels: double, tertiary, supernumerary,
17
+ supermassive, and apocalyptic party.\footnote{The double hail-and-rainbow level makes my toes tingle.}
18
+ A bold statement.\footnote{Opinions are my own.}
19
+ Another outrageous statement.\footnote{Opinions are my own.}
20
+
21
+ %== .toc ==%
22
+ \hypertarget{_cavern_glow}{\section*{Cavern Glow}}
23
+
24
+ %== .toc_title ==%
25
+ \hypertarget{_cavern_glow}{\section*{Cavern Glow}}
@@ -0,0 +1,7 @@
1
+ %== .title ==%
2
+
3
+ %== .footnotes ==%
4
+ The hail-and-rainbow protocol can be initiated at five levels: double, tertiary, supernumerary,
5
+ supermassive, and apocalyptic party.\footnote{The double hail-and-rainbow level makes my toes tingle.}
6
+ A bold statement.\footnote{Opinions are my own.}
7
+ Another outrageous statement.\footnote{Opinions are my own.}
@@ -1,20 +1,20 @@
1
1
  %== .env ==%
2
2
  \begin{theorem}
3
- The equation $a^2 + b^2 = c^2$
3
+ \hypertarget{}{The equation $a^2 + b^2 = c^2$
4
4
  has infinitely many non-proportional
5
- integer solutions.
5
+ integer solutions.}
6
6
  \end{theorem}
7
7
 
8
8
  %== .env_display ==%
9
9
  \begin{theorem}
10
- \[
10
+ \hypertarget{}{\[
11
11
  e^{2\pi\sqrt{-1}} = 1
12
- \]
12
+ \]}
13
13
  \end{theorem}
14
14
 
15
15
  %== .env_display_with_title ==%
16
- \begin{theorem}{\rm (Euler) }
17
- \[
16
+ \begin{theorem}
17
+ {\rm (Euler) }\hypertarget{}{\[
18
18
  e^{2\pi\sqrt{-1}} = 1
19
- \]
19
+ \]}
20
20
  \end{theorem}
@@ -0,0 +1,29 @@
1
+ %== .env ==%
2
+ \begin{joke}
3
+ \hypertarget{}{An engineer, a mathematician, and a philosopher met
4
+ at a bar for a drink. After a few beers, talk
5
+ turned to the question of how best to understand
6
+ the world …​ (to be continued)}
7
+ \end{joke}
8
+
9
+ %== .auto-numbered ==%
10
+ \begin{objection}
11
+ \hypertarget{}{Your honor, my client could not have committed the
12
+ crime of which he is accused because he was
13
+ confined to the state penitentary at the time
14
+ that it occurred. If it please the court, …​}
15
+ \end{objection}
16
+ \begin{objection}
17
+ {\rm (Inadmissible testimony) }\hypertarget{}{Your honor, that testimony cannot be
18
+ heard in this courtroom because it
19
+ was obtained under duress and without
20
+ informing my client of his rights.}
21
+ \end{objection}
22
+ \begin{objection}
23
+ {\rm (Improper procedure) }\hypertarget{}{Your honor, the physical evidence
24
+ was not secured and was handled sloppily.
25
+ We cannot be sure tha the items which
26
+ the prosecution wishes to present here
27
+ have any association with my client
28
+ whatsoever.}
29
+ \end{objection}
@@ -0,0 +1,9 @@
1
+ %== .joke ==%
2
+ \begin{joke}
3
+ \hypertarget{}{Three men, a mathematician, a lawyer,
4
+ and a doctor …​}
5
+ \end{joke}
6
+ \begin{joke}
7
+ \rm{Three men, a mathematician, a lawyer,
8
+ and a doctor …​}
9
+ \end{joke}
@@ -0,0 +1,7 @@
1
+ %== .env_plain ==%
2
+ \begin{remark}
3
+ \hypertarget{}{This is a normal remark.}
4
+ \end{remark}
5
+ \begin{remark}
6
+ \rm{This is a plain remark.}
7
+ \end{remark}
@@ -0,0 +1,49 @@
1
+ \section*{\hypertarget{_some_equations}{Some Equations}}
2
+
3
+ \subsection*{\hypertarget{_number_theory}{Number Theory}}
4
+
5
+ The equation
6
+ $a^2 + b^2 = c^2$ has infinitely many
7
+ non-proportional integer solutions.
8
+ The integer solutions of the equation
9
+ \[
10
+ a^3 + b^3 = c^3
11
+ \]
12
+ are trivial: at least one entry is
13
+ zero and the others are "obvious"
14
+
15
+
16
+
17
+
18
+ \subsection*{\hypertarget{_calculus}{Calculus}}
19
+
20
+ A definite integral:
21
+ \[
22
+ \int_0^1 x^n dx = \frac{1}{n}
23
+ \]
24
+
25
+
26
+ The fundamental theorem of calculus:
27
+ \[
28
+ \frac{d}{dx} \int_a^x f(t) dt = f(x)
29
+ \]
30
+
31
+
32
+
33
+
34
+ \subsection*{\hypertarget{_linear_algebra}{Linear algebra}}
35
+
36
+ A matrix:
37
+ \[
38
+ M = \left[
39
+ \begin{array}{ c c }
40
+ 1 & 2 \\
41
+ 3 & 4
42
+ \end{array} \right]
43
+ \]
44
+
45
+
46
+
47
+
48
+
49
+
@@ -7,3 +7,12 @@ Euler’s formula states that
7
7
  e^{2\pi \sqrt{-1}} = 1
8
8
  \]
9
9
  Ain’t that great!
10
+ \begin{equation*}
11
+ \sum_{k=1}^\infty \frac{1}{n}
12
+ \end{equation*}
13
+ \begin{equation}
14
+ \label{hoho}\hypertarget{hoho}{\sum_{k=1}^\infty \frac{1}{n^2}}
15
+ \end{equation}
16
+ \begin{equation}
17
+ \hypertarget{}{\sum_{k=1}^\infty \frac{1}{n^3}}
18
+ \end{equation}
@@ -0,0 +1,23 @@
1
+ %== .eqalign ==%
2
+ \begin{equation*}
3
+ \begin{split}
4
+ a &= b + c \\
5
+ b &= x + y \\
6
+ a &= x + y + c
7
+ \end{split}
8
+ \end{equation*}
9
+ \begin{equation}
10
+ \begin{split}
11
+ \label{foo}
12
+ A &= B + C \\
13
+ B &= X + Y \\
14
+ Z &= X + Y + C
15
+ \end{split}
16
+ \end{equation}
17
+ \begin{equation}
18
+ \begin{split}
19
+ a &= b + c \\
20
+ b &= x + y \\
21
+ a &= x + y + c
22
+ \end{split}
23
+ \end{equation}
@@ -0,0 +1,237 @@
1
+ %% Preamble %%
2
+ %% A minimal LaTeX preamble
3
+
4
+ \documentclass[11pt]{amsart}
5
+ \usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
6
+ \geometry{letterpaper} % ... or a4paper or a5paper or ...
7
+ %\geometry{landscape} % Activate for for rotated page geometry
8
+ %\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
9
+ \usepackage{graphicx}
10
+ \graphicspath{ {images/} }
11
+ \usepackage{wrapfig}
12
+ \usepackage{tcolorbox}
13
+ \usepackage{lipsum}
14
+ \usepackage{amssymb}
15
+ \usepackage{epstopdf}
16
+ \usepackage{color}
17
+ \usepackage[usenames, dvipsnames]{color}
18
+ \usepackage{alltt}
19
+ \usepackage[version=3]{mhchem}
20
+ \usepackage{amsmath}
21
+
22
+ % Needed to properly typeset
23
+ % standard unicode characters:
24
+ %
25
+ \RequirePackage{fix-cm}
26
+ \usepackage{fontspec}
27
+ \usepackage[Latin,Greek]{ucharclasses}
28
+ %
29
+ % NOTE: you must also use xelatex
30
+ % as the typesetting engine
31
+
32
+
33
+ % \usepackage{fontspec}
34
+ % \usepackage{polyglossia}
35
+ % \setmainlanguage{en}
36
+
37
+ \usepackage{hyperref}
38
+ \hypersetup{
39
+ colorlinks=true,
40
+ linkcolor=blue,
41
+ filecolor=magenta,
42
+ urlcolor=cyan,
43
+ }
44
+
45
+ \DeclareGraphicsExtensions{.png, .jpg, jpeg, .pdf}
46
+
47
+ %% \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
48
+ %% Asciidoc TeX Macros %%
49
+
50
+ % Needed for Asciidoc
51
+
52
+ \newcommand{\admonition}[2]{\textbf{#1}: {#2}}
53
+ \newcommand{\rolered}[1]{ \textcolor{red}{#1} }
54
+ \newcommand{\roleblue}[1]{ \textcolor{blue}{#1} }
55
+ \newcommand{\rolehighlight}[1]{ \backgroundcolor{yellow}{#1} }
56
+
57
+
58
+ \newtheorem{theorem}{Theorem}
59
+ \newtheorem{proposition}{Proposition}
60
+ \newtheorem{corollary}{Corollary}
61
+ \newtheorem{lemma}{Lemma}
62
+ \newtheorem{definition}{Definition}
63
+ \newtheorem{conjecture}{Conjecture}
64
+ \newtheorem{problem}{Problem}
65
+ \newtheorem{example}{Example}
66
+ \newtheorem{remark}{Remark}
67
+ \newtheorem{note}{Note}
68
+
69
+
70
+ %%%
71
+ % Extended quote environment with author
72
+ \def\signed#1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
73
+ \hbox{}\nobreak\hfil\raise-3pt\hbox{(#1)}%
74
+ \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
75
+
76
+ \newsavebox\mybox
77
+ \newenvironment{aquote}[1]
78
+ {\savebox\mybox{#1}\begin{quotation}}
79
+ {\signed{\usebox\mybox}\end{quotation}}
80
+ %%%
81
+
82
+ \newenvironment{preamble}
83
+ {}
84
+ {}
85
+
86
+ %% http://tex.stackexchange.com/questions/99809/box-or-sidebar-for-additional-text
87
+ \newenvironment{sidebar}[1][r]
88
+ {\wrapfigure{#1}{0.5\textwidth}\tcolorbox}
89
+ {\endtcolorbox\endwrapfigure}
90
+
91
+ %% Style
92
+ \parindent0pt
93
+ \parskip8pt
94
+ %% User Macros %%
95
+ %% Front Matter %%
96
+
97
+ \title{Numbered Equations}
98
+ \author{}
99
+ \date{}
100
+
101
+
102
+ %% Begin Document %%
103
+
104
+ \begin{document}
105
+ \maketitle
106
+ \section*{\hypertarget{_numbered_equations}{Numbered Equations}}
107
+
108
+ The environment {\tt [env.equation]} is automatically
109
+ numbered by default, as in the examples below.
110
+
111
+
112
+ \begin{equation*}
113
+ a^3 + b^3 = c^3
114
+ \end{equation*}
115
+
116
+
117
+ \begin{equation*}
118
+ \int_0^1 x^n dx = \frac{1}{n}
119
+ \end{equation*}
120
+
121
+
122
+ Here is how the first equation is done:
123
+
124
+
125
+ \begin{verbatim}
126
+ [env.equation]
127
+ --
128
+ a^3 + b^3 = c^3
129
+ --
130
+ \end{verbatim}
131
+
132
+ \subsection*{\hypertarget{_some_more_equations}{Some more equations}}
133
+
134
+ \begin{equation}
135
+ \label{pyth}a^2 + b^2 = c^2
136
+ \end{equation}
137
+
138
+
139
+ A Fourier series:
140
+
141
+
142
+ \begin{equation}
143
+ \label{fourier}f(z) = \sum_{n=-\infty}^\infty e^{2\pi i n z }.
144
+ \end{equation}
145
+
146
+
147
+ A matrix:
148
+
149
+
150
+ \begin{equation}
151
+ \label{eq-matrix}M = \left(
152
+ \begin{matrix}
153
+ 1 & 2 \\
154
+ 3 & 4
155
+ \end{matrix}
156
+ \right)
157
+ \end{equation}
158
+
159
+
160
+
161
+
162
+ \subsection*{\hypertarget{_titles}{Titles}}
163
+
164
+ Equations can take a title:
165
+
166
+
167
+ \begin{equation*}
168
+ \frac{d}{dx} \int_a^x f(t) dt = f(x)
169
+ \end{equation*}
170
+
171
+
172
+ We wrote this:
173
+
174
+
175
+ \begin{verbatim}
176
+ .Fundamental theorem of calculus
177
+ [env.equation]
178
+ --
179
+ \frac{d}{dx} \int_a^x f(t) dt = f(x)
180
+ --
181
+ \end{verbatim}
182
+
183
+
184
+
185
+ \subsection*{\hypertarget{_suppressing_numbering}{Suppressing numbering}}
186
+
187
+ Numbering can be suppresed on a per-item basis.
188
+ This gives a "bare" equation.
189
+
190
+
191
+ \begin{equation*}
192
+ M = \left[
193
+ \begin{array}{ c c }
194
+ 1 & 2 \\
195
+ 3 & 4
196
+ \end{array} \right]
197
+ \end{equation*}
198
+
199
+
200
+ We wrote {\tt [env.equation%no-number]}.
201
+ If numbering is suppressed but a title is present,
202
+ the title is displayed.
203
+
204
+
205
+ \begin{equation*}
206
+ M = \left[
207
+ \begin{array}{ c c }
208
+ 1 & 2 \\
209
+ -2 & 5
210
+ \end{array} \right]
211
+ \end{equation*}
212
+
213
+
214
+ Here is the source:
215
+
216
+
217
+ \begin{verbatim}
218
+ .Symmetric matrix
219
+ [env.equation%no-number]
220
+ --
221
+ M = \left[
222
+ \begin{array}{ c c }
223
+ 1 & 2 \\
224
+ -2 & 5
225
+ \end{array} \right]
226
+ --
227
+ \end{verbatim}
228
+
229
+ Note: In \hyperlink{eq-matrix}{(3)} we defined a matrix.
230
+
231
+
232
+
233
+
234
+
235
+
236
+ \end{document}
237
+