Skip to content

Instantly share code, notes, and snippets.

@tk0miya
Created February 26, 2020 17:15
Show Gist options
  • Save tk0miya/7972a7c353027937b852322b4fcc61e6 to your computer and use it in GitHub Desktop.
Save tk0miya/7972a7c353027937b852322b4fcc61e6 to your computer and use it in GitHub Desktop.
latex_elements = {
'extrapackages': r'\usepackage{titlesec}',
'preamble': '\n'.join([
# 字下げ (なんでデフォルトで動かないんだろ?)
r'\setlength{\parindent}{1zw}',
# 段落調整、箇条書きの行間調整
r'\setlength{\parskip}{0ex}',
# 見出しの装飾
# ref: https://qiita.com/krtx/items/deeec0843caf37b66054
r'\definecolor{teal}{RGB}{0,128,128}',
r'\definecolor{powderblue}{RGB}{176,224,230}',
r'\definecolor{darkslateblue}{RGB}{72,61,139}',
r'\definecolor{darkslategray}{RGB}{47,79,79}',
r'\definecolor{lightcyan}{RGB}{224,255,255}',
r'',
r'% section',
r'\titleformat{\section}[block]',
r'{}{}{0pt}',
r'{',
r' \colorbox{teal}{\begin{picture}(0,20)\end{picture}}',
r' \hspace{0pt}',
r' \normalfont \Huge\bfseries \thesection',
r' \hspace{-4pt}',
r'}',
r'[',
r'\begin{picture}(100,0)',
r' \put(3,30){\color{teal}\line(1,0){400}}',
r'\end{picture}',
r'\\',
r'\vspace{-50pt}',
r']',
r'',
r'% subsection',
r'\titleformat{\subsection}[block]',
r'{}{}{0pt}',
r'{',
r' \colorbox{darkslateblue}{\begin{picture}(0,10)\end{picture}}',
r' \hspace{0pt}',
r' \normalfont \Large\bfseries \thesubsection',
r' \hspace{-4pt}',
r'}',
r'[',
r'\begin{picture}(100,0)',
r' \put(3,18){\color{darkslateblue}\line(1,0){300}}',
r'\end{picture}',
r'\\',
r'\vspace{-30pt}',
r']',
])
@shimizukawa
Copy link

shimizukawa commented Feb 26, 2020

ありがとう〜〜 参照リンクはらせてもらいました
https://scrapbox.io/shimizukawa/SphinxのLaTeX_PDF出力をカスタマイズする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment