diff --git a/docs/en/releases/unreleased.ipynb b/docs/en/releases/unreleased.ipynb index 6b342b0..74819fe 100644 --- a/docs/en/releases/unreleased.ipynb +++ b/docs/en/releases/unreleased.ipynb @@ -569,11 +569,57 @@ }, { "cell_type": "markdown", - "id": "dd292ce1", + "id": "67828e19", "metadata": {}, "source": [ "Starting with this release, data is generated successfully in cases like the example above.\n", "\n", + "#### Fixed a bug where `latex` specifications were ignored in LaTeX output for decision variable bounds\n", + "\n", + "We fixed a bug where the values of the `latex=` keyword argument for other variables were ignored when outputting decision variable bounds in $\\LaTeX$." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "765650c8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "$$\\begin{array}{rl}\n", + "\\text{Problem}\\colon &\\text{LaTeX bugfix example}\\\\\\displaystyle \\min &\\displaystyle x\\\\&\\\\\\text{where}&\\\\&\\text{Decision Variables:}\\\\&\\qquad \\begin{alignedat}{2}x&\\in \\mathbb{R}\\;\\left(\\ell\\leq x\\leq \\mathcal{U}\\right)&\\quad &0\\text{-dim continuous variable}\\\\\\end{alignedat}\\\\&\\\\&\\text{Placeholders:}\\\\&\\qquad \\begin{alignedat}{2}\\ell&\\in \\mathbb{R}&\\quad &\\text{A scalar placeholder in }\\mathbb{R}\\\\\\mathcal{U}&\\in \\mathbb{R}&\\quad &\\text{A scalar placeholder in }\\mathbb{R}\\\\\\end{alignedat}\\end{array}\n", + "$$" + ], + "text/plain": [ + "Problem(name=\"LaTeX bugfix example\", sense=MINIMIZE, objective=x, constraints=[])" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import jijmodeling as jm\n", + "\n", + "problem = jm.Problem(\"LaTeX bugfix example\")\n", + "L = problem.Float(\"L\", latex=r\"\\ell\")\n", + "U = problem.Float(\"U\", latex=r\"\\mathcal{U}\")\n", + "x = problem.ContinuousVar(\"x\", lower_bound=L, upper_bound=U)\n", + "problem += x\n", + "\n", + "problem" + ] + }, + { + "cell_type": "markdown", + "id": "dd292ce1", + "metadata": {}, + "source": [ + "In previous releases, the `latex` specifications were ignored in the code above, and the bounds were displayed as $L \\leq x \\leq U$.\n", + "Starting with this release, the settings are preserved as shown above, and the bounds are displayed as $\\ell \\leq x \\leq \\mathcal{U}$.\n", "\n", "## Other Changes\n", "\n", diff --git a/docs/ja/releases/unreleased.ipynb b/docs/ja/releases/unreleased.ipynb index 22b5469..2c22c43 100644 --- a/docs/ja/releases/unreleased.ipynb +++ b/docs/ja/releases/unreleased.ipynb @@ -559,10 +559,56 @@ }, { "cell_type": "markdown", + "id": "5fc150c5", "metadata": {}, "source": [ "今回のリリースから、上記のように問題なくデータが生成されるようになりました。\n", "\n", + "#### 決定変数の上下界のLaTeX出力で `latex` 指定が無視されていた問題の修正\n", + "\n", + "決定変数の上下界を $\\LaTeX$ 出力する際に、他の変数の `latex=` キーワード引数の値が無視されていた問題を修正しました。" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "e1b1c10f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "$$\\begin{array}{rl}\n", + "\\text{Problem}\\colon &\\text{LaTeX bugfix example}\\\\\\displaystyle \\min &\\displaystyle x\\\\&\\\\\\text{where}&\\\\&\\text{Decision Variables:}\\\\&\\qquad \\begin{alignedat}{2}x&\\in \\mathbb{R}\\;\\left(\\ell\\leq x\\leq \\mathcal{U}\\right)&\\quad &0\\text{-dim continuous variable}\\\\\\end{alignedat}\\\\&\\\\&\\text{Placeholders:}\\\\&\\qquad \\begin{alignedat}{2}\\ell&\\in \\mathbb{R}&\\quad &\\text{A scalar placeholder in }\\mathbb{R}\\\\\\mathcal{U}&\\in \\mathbb{R}&\\quad &\\text{A scalar placeholder in }\\mathbb{R}\\\\\\end{alignedat}\\end{array}\n", + "$$" + ], + "text/plain": [ + "Problem(name=\"LaTeX bugfix example\", sense=MINIMIZE, objective=x, constraints=[])" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import jijmodeling as jm\n", + "\n", + "problem = jm.Problem(\"LaTeX bugfix example\")\n", + "L = problem.Float(\"L\", latex=r\"\\ell\")\n", + "U = problem.Float(\"U\", latex=r\"\\mathcal{U}\")\n", + "x = problem.ContinuousVar(\"x\", lower_bound=L, upper_bound=U)\n", + "problem += x\n", + "\n", + "problem" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "これまでのリリースでは、上記のコードでは `latex` 指定が無視され、$L \\leq x \\leq U$ のように表示されていましたが、上記のように設定が保たれるようになり、$\\ell \\leq x \\leq \\mathcal{U}$ と表示されるようになりました。\n", + "\n", "## その他の変更\n", "\n", "- バージョン条件を緩和し、Python 3.11 以降の任意の Python 3 でのインストールを許容しました。" diff --git a/markdowns/en/releases/unreleased.md b/markdowns/en/releases/unreleased.md index c548dd2..a286243 100644 --- a/markdowns/en/releases/unreleased.md +++ b/markdowns/en/releases/unreleased.md @@ -166,6 +166,24 @@ problem.generate_random_dataset(seed=17) Starting with this release, data is generated successfully in cases like the example above. +#### Fixed a bug where `latex` specifications were ignored in LaTeX output for decision variable bounds + +We fixed a bug where the values of the `latex=` keyword argument for other variables were ignored when outputting decision variable bounds in $\LaTeX$. + +```{code-cell} ipython3 +import jijmodeling as jm + +problem = jm.Problem("LaTeX bugfix example") +L = problem.Float("L", latex=r"\ell") +U = problem.Float("U", latex=r"\mathcal{U}") +x = problem.ContinuousVar("x", lower_bound=L, upper_bound=U) +problem += x + +problem +``` + +In previous releases, the `latex` specifications were ignored in the code above, and the bounds were displayed as $L \leq x \leq U$. +Starting with this release, the settings are preserved as shown above, and the bounds are displayed as $\ell \leq x \leq \mathcal{U}$. ## Other Changes diff --git a/markdowns/ja/releases/unreleased.md b/markdowns/ja/releases/unreleased.md index 7af46e7..4c6d89e 100644 --- a/markdowns/ja/releases/unreleased.md +++ b/markdowns/ja/releases/unreleased.md @@ -163,6 +163,24 @@ problem.generate_random_dataset(seed=17) 今回のリリースから、上記のように問題なくデータが生成されるようになりました。 +#### 決定変数の上下界のLaTeX出力で `latex` 指定が無視されていた問題の修正 + +決定変数の上下界を $\LaTeX$ 出力する際に、他の変数の `latex=` キーワード引数の値が無視されていた問題を修正しました。 + +```{code-cell} ipython3 +import jijmodeling as jm + +problem = jm.Problem("LaTeX bugfix example") +L = problem.Float("L", latex=r"\ell") +U = problem.Float("U", latex=r"\mathcal{U}") +x = problem.ContinuousVar("x", lower_bound=L, upper_bound=U) +problem += x + +problem +``` + +これまでのリリースでは、上記のコードでは `latex` 指定が無視され、$L \leq x \leq U$ のように表示されていましたが、上記のように設定が保たれるようになり、$\ell \leq x \leq \mathcal{U}$ と表示されるようになりました。 + ## その他の変更 - バージョン条件を緩和し、Python 3.11 以降の任意の Python 3 でのインストールを許容しました。