Skip to content

Commit 6319994

Browse files
shirdekelcderv
andauthored
Add "Hypothesis" theorem environment (#1102)
Co-authored-by: christophe dervieux <[email protected]>
1 parent 2b7830f commit 6319994

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: bookdown
22
Type: Package
33
Title: Authoring Books and Technical Documents with R Markdown
4-
Version: 0.21.6
4+
Version: 0.21.7
55
Authors@R: c(
66
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
77
person("JJ", "Allaire", role = "ctb"),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
- `render_book()` can now take a directory as input, i.e `render_book("book_dir")`, to render in this directory by using the `index.Rmd` file if it exists. The default is now to look for `input.Rmd` is the current working directory. Previously, filename must have been provided (`render_book()` is now equivalent to `render_book("index.Rmd")`) (#990).
88

9+
- `hypothesis` environment is now supported among [Theorems and Proof](https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems) (thanks, @shirdekel, #1102).
10+
911
## BUG FIXES
1012

1113
- CSS dependencies like `url('truetype/Spectral-ExtraLight.ttf')` (with single quotes) are now correctly identified and moved (thanks, @RLesur, #991).

R/html.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,11 +591,12 @@ label_names = list(fig = 'Figure ', tab = 'Table ', eq = 'Equation ')
591591
# prefixes for theorem environments
592592
theorem_abbr = c(
593593
theorem = 'thm', lemma = 'lem', corollary = 'cor', proposition = 'prp', conjecture = 'cnj',
594-
definition = 'def', example = 'exm', exercise = 'exr'
594+
definition = 'def', example = 'exm', exercise = 'exr', hypothesis = 'hyp'
595595
)
596596
# numbered math environments
597597
label_names_math = setNames(list(
598-
'Theorem ', 'Lemma ', 'Corollary ', 'Proposition ', 'Conjecture ', 'Definition ', 'Example ', 'Exercise '
598+
'Theorem ', 'Lemma ', 'Corollary ', 'Proposition ', 'Conjecture ', 'Definition ', 'Example ', 'Exercise ',
599+
'Hypothesis '
599600
), theorem_abbr)
600601
# unnumbered math environments
601602
label_names_math2 = list(proof = 'Proof. ', remark = 'Remark. ', solution = 'Solution. ')

R/latex.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ restore_block2 = function(x, global = FALSE) {
250250
x
251251
}
252252

253-
style_definition = c('definition', 'example', 'exercise')
253+
style_definition = c('definition', 'example', 'exercise', 'hypothesis')
254254
style_remark = c('remark')
255255
# which styles of theorem environments to use
256256
theorem_style = function(env) {

inst/examples/02-components.Rmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ Applying Theorem \@ref(thm:chf-sum), we have
390390
391391
$$\varphi _{\bar{X}}(t)=\prod_{i=1}^n \varphi _{X_i}\left(\frac{t}{n}\right)=\left[\varphi _{X}\left(\frac{t}{n}\right)\right]^n.$$
392392
```
393+
394+
```{hypothesis, name="Riemann hypothesis"}
395+
The Riemann Zeta-function is defined as
396+
$$\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}$$
397+
for complex values of $s$ and which converges when the real part of $s$ is greater than 1. The Riemann hypothesis is that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part $1/2$.
398+
```
393399

394400
### Special headers
395401

inst/rmarkdown/lua/custom-environment.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ local theorem_abbr = {
1111
conjecture = 'cnj',
1212
definition = 'def',
1313
example = 'exm',
14-
exercise = 'exr'
14+
exercise = 'exr',
15+
hypothesis = 'hyp'
1516
}
1617

1718
-- other special proof envs

0 commit comments

Comments
 (0)