LoginSignup
11
8

More than 5 years have passed since last update.

jsreportのchapter名を変更する

Last updated at Posted at 2018-09-23

やりたいこと

LaTeXのjsreport環境下でchapterを使うと、デフォルトでは下図のように「第n章」と表示される。
Screen Shot 2018-09-23 at 19.03.27.png
この「第n章」を適当な文字列に変更したい。

方法

プリアンブルにて\prechaptername, \postchaptername, \thechapterコマンドを\renewcommandしてあげればよい。

chapterchanger.tex
\documentclass[12pt]{jsreport}

\renewcommand{\prechaptername}{これは}
\renewcommand{\postchaptername}{章目だよ}
\renewcommand{\thechapter}{\roman{chapter}}

\begin{document}
    \chapter{かわったよ}
\end{document}

タイプセット結果

Screen Shot 2018-09-23 at 19.07.44.png

chapter以外も変える場合

jsreport.cls内では、各コマンドが以下のように定義/再定義されている。なので、chapter以外も変えたければ各コマンドを\renewcommandを用いて再定義すればok

jsreport.cls
% the系
\renewcommand{\thepart}{\@Roman\c@part} 
\renewcommand{\thechapter}{\@arabic\c@chapter} 
\renewcommand{\thesection}{\thechapter.\@arabic\c@section} 
\renewcommand{\thesubsection}{\thesection.\@arabic\c@subsection} 
\renewcommand{\thesubsubsection}{% 
  \thesubsection.\@arabic\c@subsubsection} 
\renewcommand{\theparagraph}{% 
    \thesubsubsection.\@arabic\c@paragraph} 
 \renewcommand{\thesubparagraph}{% 
    \theparagraph.\@arabic\c@subparagraph} 

% pre~は前につく言葉, post~は後につく言葉
\newcommand{\prepartname}{\if@english Part~\else\fi} 
\newcommand{\postpartname}{\if@english\else\fi} 
\newcommand{\prechaptername}{\if@english Chapter~\else\fi} 
\newcommand{\postchaptername}{\if@english\else\fi}
\newcommand{\presectionname}{}%  第
\newcommand{\postsectionname}{}% 節
\newcommand{\contentsname}{\if@english Contents\else 目次\fi}
\newcommand{\listfigurename}{\if@english List of Figures\else 図目次\fi}
\newcommand{\listtablename}{\if@english List of Tables\else 表目次\fi}
\newcommand{\refname}{\if@english References\else 参考文献\fi}
\newcommand{\bibname}{\if@english Bibliography\else 参考文献\fi}
\newcommand{\indexname}{\if@english Index\else 索引\fi}
\newcommand{\figurename}{\if@english Fig.~\else\fi}
\newcommand{\tablename}{\if@english Table~\else\fi}
\newcommand{\appendixname}{\if@english \else 付録\fi}
\newcommand{\abstractname}{\if@english Abstract\else 概要\fi}

参考文献

jsclasses(by texjporg)のGithub

11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8