booktabs 패키지를 사용하여 스핑크스 LaTeX 테이블 스타일링

booktabs 패키지를 사용하여 스핑크스 LaTeX 테이블 스타일링

Sphinx에서 생성된 LaTeX 테이블의 모양을 개선하려고 합니다. 특히 북탭 상단, 중간, 하단 규칙을 사용하고 세로 셀 구분 기호를 억제하고 싶습니다.

이 rST 테이블은 다음과 같습니다.

+--------------+---+-----------+
|  simple text | 2 | 3         |
+==============+===+===========+
|  simple text | 2 | 3         |
+--------------+---+-----------+
|  simple text | 2 | 3         |
+--------------+---+-----------+

다음으로 변환:

\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{JJJ}
\hline
\sphinxstyletheadfamily 
simple text
&\sphinxstyletheadfamily

 
2
&\sphinxstyletheadfamily 
3
\\
\hline
simple text
&
2

&
3
\\
\hline
simple text
&
2
&
3
\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}

나는 그것을 은폐하고 싶습니다 :

\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{JJJ}
\toprule
\sphinxstyletheadfamily 
simple text
&\sphinxstyletheadfamily 
2
&\sphinxstyletheadfamily 
3
\\
\toprule
simple text
&
2
&
3
\\
\midrule
simple text
&
2
&
3
\\
\bottomrule
\end{tabulary}
\par
\sphinxattableend\end{savenotes}

conf.py에서 책탭을 로드할 수 있습니다.

현재 스핑크스 문서는 여기에 있습니다.https://www.sphinx-doc.org/en/master/latex.html이 제어 수준은 conf.py를 통해 사용할 수 없음을 의미하지만 페이지 하단에는 템플릿을 통한 사용자 정의를 암시하는 메모가 있습니다.

실험적인 기능으로, 프로젝트에 _templates/latex.tex_t라는 파일이 있는 경우 Sphinx는 LaTeX 소스에 대한 사용자 정의 템플릿 파일을 사용할 수 있습니다. 추가 파일 longtable.tex_t, tabulary.tex_t 및 tabular.tex_t를 _templates/에 추가하여 테이블 렌더링의 일부 측면(예: 캡션 위치)을 구성할 수 있습니다.

conf.py에 다음과 같이 설정한 이를 가리키는 매개변수가 있습니다.

templates_path = '_templates'

템플릿을 다음에서 추가했습니다.https://github.com/sphinx-doc/sphinx/tree/3.x/sphinx/templates/latex

템플릿을 읽을 수 없습니다.

질문:

  1. 템플릿을 통해 이것이 가능합니까? 그렇다면 어떻게 가능합니까? 이 기능은 Sphinx 1.6에서 실험적이었고 삭제되었을 수 있습니다.
  2. 그렇지 않은 경우 프리앰블, sty 파일 등을 통해 북 탭을 사용하도록 테이블을 재정의하는 방법이 있습니까?

많은 감사를 드립니다.

관련 정보