-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jiazhu: 夹注的底线对齐 #535
Labels
Comments
底线对齐的实现比较简单,夹注的基线下移量为 \cs_new_protected:Npn \__jiazhu_calc_box_offset:
{
\exp_args:Nxx \__jiazhu_calc_box_offset_aux:nn
{
\fp_compare:nNnTF \l__jiazhu_jzideoht_fp = \c_zero_fp
{ \fp_eval:n { 1 - \l__jiazhu_ideoht_fp } }
{ \fp_eval:n { 1 - \l__jiazhu_jzideoht_fp } }
}
{ \fp_eval:n { 1 - \l__jiazhu_ideoht_fp } }
}
\cs_new_protected:Npn \__jiazhu_calc_box_offset_aux:nn #1#2
{
\dim_set:Nn \l__jiazhu_box_offset_dim
{
#2 \l__jiazhu_outer_unit_dim - #1 \l__jiazhu_unit_dim
}
\dim_set:Nn \l__jiazhu_mark_offset_dim
{
#2 \l__jiazhu_outer_unit_dim - \fp_eval:n { #1 * \l__jiazhu_bracket_ratio_fp } \l__jiazhu_unit_dim
}
} |
我忘了考虑竖排情况了……竖排时单行夹注是右对齐,对应到横排应该是顶线对齐。此时夹注的基线下移量为 \cs_new_protected:Npn \__jiazhu_calc_box_offset:
{
\exp_args:Nxx \__jiazhu_calc_box_offset_aux:nn
{
\fp_compare:nNnTF \l__jiazhu_jzideoht_fp = \c_zero_fp
{ \fp_eval:n { \l__jiazhu_ideoht_fp } }
{ \fp_eval:n { \l__jiazhu_jzideoht_fp } }
}
{ \fp_eval:n { \l__jiazhu_ideoht_fp } }
}
\cs_new_protected:Npn \__jiazhu_calc_box_offset_aux:nn #1#2
{
\dim_set:Nn \l__jiazhu_box_offset_dim
{
#1 \l__jiazhu_unit_dim + \int_eval:n { \l__jiazhu_lines_int - 1 } \tex_baselineskip:D - #2 \l__jiazhu_outer_unit_dim
}
\dim_set:Nn \l__jiazhu_mark_offset_dim
{
\fp_eval:n { #1 * \l__jiazhu_bracket_ratio_fp } \l__jiazhu_unit_dim - #2 \l__jiazhu_outer_unit_dim
}
} 感觉可以让 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在 #508 中,夹注是中线对齐的,但在 clreq 的此份提案中,单行的夹注应该是底线对齐,希望能加一个选项,让用户自己决定是中线对齐还是底线对齐。
The text was updated successfully, but these errors were encountered: