LoginSignup
3
3

More than 5 years have passed since last update.

tex 図番号,表番号の後ろに不要なピリオドが出力される

Posted at

変なピリオドが出てくる

このファイルに従って原稿を作成していると...
図を挿入するために以下のような記述をする場面が出てくる.

main.tex
\begin{figure}[b]
\begin{center}
\label{hogehoge}

\includegraphics[width=70mm]{hogehogehoge}
\caption{hoge}

\end{center}
\end{figure}

labelを付けた図を本文中で
「図ref{hogehoge}に示す.」というように引用したい.

しかし,

これをすると出力結果として

「図1.に示す.」

なんだこの1の後ろのピリオドは!!!

原因は学会側から配布されたclsファイル

ggってもなかなか解決策が見いだせない中,指定のclsファイルを見ていると,,,

hogehoge.cls
\renewcommand{\thesection}{\@arabic\c@section.}
\renewcommand{\thesubsection}{\thesection\,\@arabic\c@subsection}
\renewcommand{\thesubsubsection}{%
   \thesubsection.\,\@arabic\c@subsubsection}
\renewcommand{\theparagraph}{% (
 \@alph\c@paragraph\,)}
\renewcommand{\thesubparagraph}{% (
 \@roman\c@subparagraph\,)}

section,subsectionの番号に「.」をつけて整形している場所を見つける.

試しにコメントアウトしてみると,,,

「図1に示す.」

消えた!!

しかし,,,

「2. ほげほげ
  2.1 ほげほげのほげほげ」
      ↓↓↓
「2 ほげほげ
  21 ほげほげのほげほげ」

節番号の「.」が消えた!!(当たり前)

解決策

hogehoge.cls
%\renewcommand{\thesection}{\@arabic\c@section.}
\renewcommand{\thesubsection}{\thesection.\,\@arabic\c@subsection}
\renewcommand{\thesubsubsection}{%
   \thesubsection.\,\@arabic\c@subsubsection}
\renewcommand{\theparagraph}{% (
 \@alph\c@paragraph\,)}
\renewcommand{\thesubparagraph}{% (
 \@roman\c@subparagraph\,)}

1行目をのsectionに関するところをコメントアウト
2行目の\thesectionのところに「.」を追加.
プリアンブルで
\usepackage{secdot}
\sectiondot{section}

を追加

これで
「2. ほげほげ
  2.1 ほげほげのほげほげ」
を保ちながら
「図1に示す.」
が実現

とりいそぎこれで一応解決しました.

3
3
1

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
3
3