Closed ZhengYuan-Public closed 1 month ago
I think you should use double &
rather than a single &
, if you want two columns to align.
As your example,
$$ \begin{alignat}{2} v_{\pi 1}^{(0)} &= v0 \nonumber\ v{\pi 1}^{(1)} &= r{\pi 1} + \gamma P{\pi 1} v_{\pi 1}^{(0)} &&\longrightarrow v1 \longrightarrow \text{Value Iteration} \nonumber\ v{\pi 1}^{(2)} &= r{\pi 1} + \gamma P{\pi 1} v{\pi 1}^{(1)} \nonumber\ \vdots \nonumber\ v{\pi 1}^{(j)} &= r{\pi 1} + \gamma P{\pi 1} v_{\pi 1}^{(j-1)} &&\longrightarrow \bar{v1} \longrightarrow \text{Truncated Policy Iteration} \nonumber\ \vdots \nonumber\ v{\pi 1}^{(\infty)} &= r{\pi 1} + \gamma P{\pi 1} v{\pi 1}^{(\infty)} &&\longrightarrow v{\pi 1} \longrightarrow \text{Policy Iteration} \nonumber \end{alignat} $$
$$
\begin{alignat}{2}
v_{\pi 1}^{(0)} &= v_0 \nonumber\\
v_{\pi 1}^{(1)} &= r_{\pi 1} + \gamma P_{\pi 1} v_{\pi 1}^{(0)} &&\longrightarrow v_1 \longrightarrow \text{Value Iteration} \nonumber\\
v_{\pi 1}^{(2)} &= r_{\pi 1} + \gamma P_{\pi 1} v_{\pi 1}^{(1)} \nonumber\\
\vdots \nonumber\\
v_{\pi 1}^{(j)} &= r_{\pi 1} + \gamma P_{\pi 1} v_{\pi 1}^{(j-1)} &&\longrightarrow \bar{v_1} \longrightarrow \text{Truncated Policy Iteration} \nonumber\\
\vdots \nonumber\\
v_{\pi 1}^{(\infty)} &= r_{\pi 1} + \gamma P_{\pi 1} v_{\pi 1}^{(\infty)} &&\longrightarrow v_{\pi 1} \longrightarrow \text{Policy Iteration} \nonumber
\end{alignat}
$$
@huanyushi Thanks for the tip! It solved my 2nd problem ❤️
I think the text in a table is a inline element. But you use \displaystyle{}
in table, which will make your equation become block element (or the same height with a black element). This will exceed the height of the table, so a scroll bar is generated.
If you don't want a scroll bar in y direction, you can just delete \displaystyle{}
.
Another way is that you can modify css of the original template:
.table-wrapper {
overflow-y: hidden;
}
This won't change the scroll bar in x direction. As an example: But I'm not sure if this will cause other problems.
It seems that *
will be recognized as italic mark in markdown
code. I think you should use latex
code. This problem may be caused by kramdown.
$$
\begin{align}
D_{KL}(P^*(y|x_i)\ ||\ P(y|x_i; \Theta))
&= \sum_{y} P^*(y|x_i) log \frac{P^*(y|x_i)}{P(y|x_i; \Theta)} \\
&= \sum_{y} P^*(y|x_i)[logP^*(y|x_i) - logP(y|x_i; \Theta)] \\
&= \sum_{y} P^*(y|x_i)logP^*(y|x_i) - \sum_{y} P^*(y|x_i)logP(y|x_i; \Theta)
\end{align}
$$
@huanyushi
Thanks for you reply. For the 2nd problem, I just personally think the displaystyle of some equations are prettier. Could you give me some hint on how to override the table-wrapper
? I have no idea how to do it...
For the 3rd problem, changing code block type from markdown to latex can solve the problem with *
. But the dark mode behavior for markdown, and the python example are still confusing.
Checklist
How did you create the site?
Generated from
chirpy-starter
Describe the bug
I have made a post to reproduce all problems described in this issue here.
Verticsl scroll bar appeared in list when it shouldn't
Math euqation alignment at multiple palces
Here is the markdown for the equation
Code block grammar check (switching themes between dark and light is related)
Example 1
In light mode
Here is the HTML element for the code block
In dark mode,
Here is the HTML element for the code block
Example 2
The second problem is simpler. The standard output from a python console was marked problematic here.
Steps To Reproduce
I have made a post to reproduce all problems described in this issue here and you can find the markdown file for the post here.
Expected Behavior
Environment
Anything else?
No response