From 905b7f9b507f38b917df5eaf60eac0a5d3e57bb1 Mon Sep 17 00:00:00 2001 From: Longye Tian <133612246+longye-tian@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:45:20 +1000 Subject: [PATCH] [general] remark_admonition + upgrade sphinx-proof and quantecon-book-theme (#493) * [geom_series] remark_admonition Dear John, This pull request is for #442. I use the geom_series.md lecture as an example to test the current admonition style. Best, Longye * TST: install main branch version of sphinx-proof * test with new css definition * test the new css styling for remark * test updated quantecon-book-theme * upgrade quantecon-book-theme==0.7.2 * update branch until released for sphinx-proof * enable sphinx-proof==0.2.0 * update software for collab testing * remark_money_inflation Add remark admonition for money_inflation.md * remark_unpleasent Add remark admonition to unpleasent.md * remark_money_inflation_nonlinear Add remark admonition for money_inflation_nonlinear.md --------- Co-authored-by: mmcky Co-authored-by: Matt McKay --- .github/workflows/collab.yml | 2 +- environment.yml | 4 ++-- lectures/_config.yml | 1 + lectures/geom_series.md | 5 ++++- lectures/money_inflation.md | 16 ++++++++++++---- lectures/money_inflation_nonlinear.md | 5 ++++- lectures/unpleasant.md | 1 + 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/collab.yml b/.github/workflows/collab.yml index 90595060..7a3284d4 100644 --- a/.github/workflows/collab.yml +++ b/.github/workflows/collab.yml @@ -30,7 +30,7 @@ jobs: - name: Install Build Software shell: bash -l {0} run: | - pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.1 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx_proof==0.1.3 sphinx_reredirects==0.1.3 + pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx_proof==0.2.0 sphinx_reredirects==0.1.3 # Build of HTML (Execution Testing) - name: Build HTML shell: bash -l {0} diff --git a/environment.yml b/environment.yml index d9b55519..f60099b5 100644 --- a/environment.yml +++ b/environment.yml @@ -9,11 +9,11 @@ dependencies: - pip: - jupyter-book==0.15.1 - docutils==0.17.1 - - quantecon-book-theme==0.7.1 + - quantecon-book-theme==0.7.2 - sphinx-tojupyter==0.3.0 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==0.4.1 - - sphinx-proof==0.1.3 + - sphinx-proof==0.2.0 - ghp-import==1.1.0 - sphinxcontrib-youtube==1.1.0 - sphinx-togglebutton==0.3.1 diff --git a/lectures/_config.yml b/lectures/_config.yml index 84d407d7..ecd808f0 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -45,6 +45,7 @@ sphinx: width: 80% nb_code_prompt_show: "Show {type}" suppress_warnings: [mystnb.unknown_mime_type, myst.domains] + proof_minimal_theme: true # ------------- html_js_files: - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js diff --git a/lectures/geom_series.md b/lectures/geom_series.md index be698d01..0ea97279 100644 --- a/lectures/geom_series.md +++ b/lectures/geom_series.md @@ -105,9 +105,12 @@ $$ 1 + c + c^2 + c^3 + \cdots + c^T = \frac{1 - c^{T+1}}{1-c} $$ -**Remark:** The above formula works for any value of the scalar +```{prf:remark} +:label: geom_formula +The above formula works for any value of the scalar $c$. We don't have to restrict $c$ to be in the set $(-1,1)$. +``` We now move on to describe some famous economic applications of geometric series. diff --git a/lectures/money_inflation.md b/lectures/money_inflation.md index 216a9a63..d7e37ecd 100644 --- a/lectures/money_inflation.md +++ b/lectures/money_inflation.md @@ -385,13 +385,21 @@ m_t & = b_{t-1} p_t \end{aligned} $$ (eq:method1) -**Remark 1:** method 1 uses an indirect approach to computing an equilibrium by first computing an equilibrium $\{R_t, b_t\}_{t=0}^\infty$ sequence and then using it to back out an equilibrium $\{p_t, m_t\}_{t=0}^\infty$ sequence. - +```{prf:remark} +:label: method_1 +Method 1 uses an indirect approach to computing an equilibrium by first computing an equilibrium $\{R_t, b_t\}_{t=0}^\infty$ sequence and then using it to back out an equilibrium $\{p_t, m_t\}_{t=0}^\infty$ sequence. +``` -**Remark 2:** notice that method 1 starts by picking an **initial condition** $R_0$ from a set $[\frac{\gamma_2}{\gamma_1}, R_u]$. Equilibrium $\{p_t, m_t\}_{t=0}^\infty$ sequences are not unique. There is actually a continuum of equilibria indexed by a choice of $R_0$ from the set $[\frac{\gamma_2}{\gamma_1}, R_u]$. +```{prf:remark} +:label: initial_condition +Notice that method 1 starts by picking an **initial condition** $R_0$ from a set $[\frac{\gamma_2}{\gamma_1}, R_u]$. Equilibrium $\{p_t, m_t\}_{t=0}^\infty$ sequences are not unique. There is actually a continuum of equilibria indexed by a choice of $R_0$ from the set $[\frac{\gamma_2}{\gamma_1}, R_u]$. +``` -**Remark 3:** associated with each selection of $R_0$ there is a unique $p_0$ described by +```{prf:remark} +:label: unique_selection +Associated with each selection of $R_0$ there is a unique $p_0$ described by equation {eq}`eq:p0fromR0`. +``` ### Method 2 diff --git a/lectures/money_inflation_nonlinear.md b/lectures/money_inflation_nonlinear.md index f716916f..07922373 100644 --- a/lectures/money_inflation_nonlinear.md +++ b/lectures/money_inflation_nonlinear.md @@ -68,7 +68,10 @@ $$ (eq:msupply) where $g$ is the part of government expenditures financed by printing money. -**Remark:** Please notice that while equation {eq}`eq:mdemand` is linear in logs of the money supply and price level, equation {eq}`eq:msupply` is linear in levels. This will require adapting the equilibrium computation methods that we deployed in {doc}`money_inflation`. +```{prf:remark} +:label: linear_log +Please notice that while equation {eq}`eq:mdemand` is linear in logs of the money supply and price level, equation {eq}`eq:msupply` is linear in levels. This will require adapting the equilibrium computation methods that we deployed in {doc}`money_inflation`. +``` diff --git a/lectures/unpleasant.md b/lectures/unpleasant.md index 676edfa1..5eb80e31 100644 --- a/lectures/unpleasant.md +++ b/lectures/unpleasant.md @@ -241,6 +241,7 @@ p_T = \frac{m_0}{\gamma_1 - \overline g - \gamma_2 R_u^{-1}} = \gamma_1^{-1} $$ (eq:pTformula) ```{prf:remark} +:label: equivalence We can verify the equivalence of the two formulas on the right sides of {eq}`eq:pTformula` by recalling that $R_u$ is a root of the quadratic equation {eq}`eq:up_steadyquadratic` that determines steady state rates of return on currency. ```