Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
29
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@krtx

LaTeXでセクションとかのデザインを変える

こんな感じにした

latex

ソース全部

\documentclass[a4paper]{jreport}

\usepackage{titlesec}
\usepackage{picture}
\usepackage[usenames]{color}
%\usepackage[usenames,divpsnames]{xcolor}                                                                                                                                                                                                                                                                                                                              

% colors                                                                                                                                                                                                                                                                                                                                                               
\definecolor{teal}{RGB}{0,128,128}
\definecolor{powderblue}{RGB}{176,224,230}
\definecolor{darkslateblue}{RGB}{72,61,139}
\definecolor{darkslategray}{RGB}{47,79,79}
\definecolor{lightcyan}{RGB}{224,255,255}

% chapter                                                                                                                                                                                                                                                                                                                                                              
\titleformat{\chapter}[block]
{}{}{0pt}{
  \fontsize{40pt}{40pt}\selectfont\filleft
}[
  \hrule \Large{\filleft\thechapter}
]

% section                                                                                                                                                                                                                                                                                                                                                              
\titleformat{\section}[block]
{}{}{0pt}
{
  \colorbox{teal}{\begin{picture}(0,20)\end{picture}}
  \hspace{0pt}
  \normalfont \Huge\bfseries \thesection
  \hspace{-4pt}
}
[
\begin{picture}(100,0)
  \put(3,30){\color{teal}\line(1,0){400}}
\end{picture}
\\
\vspace{-50pt}
]

% subsection                                                                                                                                                                                                                                                                                                                                                           
\titleformat{\subsection}[block]
{}{}{0pt}
{
  \colorbox{darkslateblue}{\begin{picture}(0,10)\end{picture}}
  \hspace{0pt}
  \normalfont \Large\bfseries \thesubsection
  \hspace{-4pt}
}
[
\begin{picture}(100,0)
  \put(3,18){\color{darkslateblue}\line(1,0){300}}
\end{picture}
\\
\vspace{-30pt}
]

% margin                                                                                                                                                                                                                                                                                                                                                               
\addtolength{\textwidth}{2in}
\addtolength{\oddsidemargin}{-1in}
\addtolength{\textheight}{1in}
\addtolength{\voffset}{-0.5in}
\parindent=0zw

\begin{document}

\chapter{章章章章章}
\section{セクションセクション}
\subsection{サブセクションサブセクション}
\subsubsection{サブサブセクション}

本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文本文

\end{document}
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
29
Help us understand the problem. What are the problem?