简体   繁体   中英

How do I show math block inside list in github readme?

I tried this:

1. Setup
        1. item 1:
```math
                \left( \{g^{s^k}\}_{k\in[d]}, \{g_l^{l_i(s)}, g_r^{r_i(s)}, g_o^{o_i(s)}\}_{i\in\{0,...,n\}}, \\
                \{g_l^{α_{l}l_i(s)}, g_r^{α_{r}r_i(s)}, g_o^{α_{o}o_i(s)}, g_l^{βl_i(s)}g_r^{βr_i(s)}g_o^{βo_i(s)}\}_{i\in\{m+1,...,n\}}, \\
                g_l^{t(s)}, g_r^{t(s)}, g_o^{t(s)}, g_l^{α_{l}t(s)}, g_r^{α_{r}t(s)}, g_o^{α_{o}t(s)}, g_l^{βt(s)}, g_r^{βt(s)}, g_o^{βt(s)}  \right)
```extraly_added_not_exist_in_OP
        2. item 2

But it breaks the display of "item 2", which is supposed to be aligned with "item 1", now becomes aligned with the parent item, demo here

What's the correct way to make both math and list look normal?

Make sure to indent the whole math block with 3 spaces inside the list item, like this:


1. Setup
   1. item 1:

      ```math
       \left( \{g^{s^k}\}_{k\in[d]}, \{g_l^{l_i(s)}, g_r^{r_i(s)}, g_o^{o_i(s)}\}_{i\in\{0,...,n\}}, \\
       \{g_l^{α_{l}l_i(s)}, g_r^{α_{r}r_i(s)}, g_o^{α_{o}o_i(s)}, g_l^{βl_i(s)}g_r^{βr_i(s)}g_o^{βo_i(s)}\}_{i\in\{m+1,...,n\}}, \\
       g_l^{t(s)}, g_r^{t(s)}, g_o^{t(s)}, g_l^{α_{l}t(s)}, g_r^{α_{r}t(s)}, g_o^{α_{o}t(s)}, g_l^{βt(s)}, g_r^{βt(s)}, g_o^{βt(s)}  \right)
      ```
       
   1. item 2

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM