tcolorbox: 주어진 치수의 다음 배수까지 높이를 반올림합니다.

tcolorbox: 주어진 치수의 다음 배수까지 높이를 반올림합니다.

나는 매우 강력한 패키지를 사용하기 시작했습니다 tcolorbox. 제가 이루고 싶은 것 중 하나는 학교 연습문제용 그리드를 제작하는 것입니다. 거의 다 온 것 같아요. 하지만 다음과 같은 방법으로 높이가 계산되는 상자를 만드는 것이 좋을 것입니다.

사용 가능한 콘텐츠에 대한 상자의 자연스러운 높이를 계산해야 합니다. 그런 다음 해당 치수는 주어진 길이의 다음 정수 배수로 반올림되어야 합니다. 그런 다음 상자의 높이를 해당 결과로 설정해야 합니다.

아이디어는 그리드가 상단과 하단에서 대칭으로 보인다는 것입니다.

이것이 내가 지금까지 가지고 있는 것입니다:

\documentclass{article}

\usepackage[most]{tcolorbox}
\usetikzlibrary{calc}

\newtcolorbox{mygrid}{breakable, colback=white, enhanced, 
    boxrule=0pt, arc=0pt, outer arc=0pt,
    boxsep=0pt, top=9pt, left=13pt, right=13pt, bottom=10pt,
    underlay={\begin{tcbclipinterior}
        \filldraw[help lines, black!15, step=0.04\linewidth,
                shift={($0.5*(interior.north west)+0.5*(interior.north east)
                    -0.02*(0,\linewidth)$)}]
            (interior.south west) grid (interior.north east);
        \end{tcbclipinterior}}}

\begin{document}
\begin{mygrid}
Some content. Some content. Some content. Some content. Some content. Some content. 
Some content. Some content. Some content. Some content. Some content. Some content. 
Some content. Some content. Some content. Some content. Some content. Some content. 
Some content. Some content. Some content. Some content. Some content.  
\end{mygrid}
\end{document}

이것이 가능한가?

관련 정보