Theorem環境について

Theorem環境について

- Merzong の投稿
返信数: 7
theorem環境を用いた際に定義・定理・補題が通し番号になり,定理番号と定理名の後に改行して定理本文が始まるようにしたくて以下のようなプリアンブルを書いたところ,

! Missing \endcsnname inserted
<to be read again>
\relax
l.8 \newtheorem{theo}{定理}[section]

というエラーが出てきます。
定理環境部分に関しての最小限

\theoremstyle{definition,break}
\newtheorem{theo}{定理}[section]
\newtheorem{axi}{公理}
\newtheorem{defi}[theo]{定義}
\newtheorem{lemm}[theo]{補題}

のみをプリアンブルに書くと,エラーは出ないので何かが干渉したりしてるのかなと思うのですが,どこを直せばよいでしょうか?

宜しくお願いします。

<エラーが出るプリアンブル>

\documentclass[uplatex,titlepage]{jsarticle}
\setcounter{tocdepth}{3}
\usepackage{amsmath,amssymb,amsthm,bm,cases,url,theorem}
\usepackage[dvipdfmx,hiresbb]{graphicx}
\usepackage[dvipdfmx,bookmarks=true,pdfborder={0 0 0},pdfauthor={(私の本名)}]{hyperref}
\usepackage{pxjahyper}
\theoremstyle{definition,break}
\newtheorem{theo}{定理}[section]
\newtheorem{axi}{公理}
\newtheorem{defi}[theo]{定義}
\newtheorem{lemm}[theo]{補題}
%%%ここから参照コマンドの定義%%%
\renewcommand{\eqref}[1]{式(\ref{#1})} %式参照
\newcommand{\figref}[1]{図\ref{#1}} %図参照
\newcommand{\tabref}[1]{表\ref{#1}} %表参照
\newcommand{\theoref}[1]{定理\ref{#1}} %定理参照
\newcommand{\defiref}[1]{定義\ref{#1}} %定義参照
\newcommand{\lemmref}[1]{補題\ref{#1}} %補題参照
%%%ここまで参照コマンドの定義%%%
%%%ここから数学記号マクロの定義%%%
\newcommand{\eqdef}{\stackrel{\mathrm{def.}}{\equiv}} %定義記号
\newcommand{\dif}[2]{\dfrac{d #1}{d #2}} %導関数
\newcommand{\pdif}[2]{\dfrac{\partial #1}{\partial #2}} %偏導関数
\renewcommand{\div}{{\rm div}} %div
\newcommand{\rot}{{\rm rot}} %rot
\newcommand{\grad}{{\rm grad}} %grad
\newcommand{\unit}[1]{\ \rm{#1}} %単位
%%%ここまで数学記号マクロの定義%%%
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}} %数式番号を(section.通し番号)の形式に
\renewcommand\proofname{\bf 証明} %証明の書き出しを設定
\makeatletter
\@addtoreset{equation}{section} %数式番号を節ごとにリセット
\AtBeginDocument{\hypersetup{pdftitle={\@title}}} %pdfのタイトルを自動的に\titleにする
%%%ここから定理環境後の.削除%%%
\def\@thm#1#2#3{
\ifhmode\unskip\unskip\par\fi
\normalfont
\trivlist
\let\thmheadnl\relax
\let\thm@swap\@gobble
\thm@notefont{\fontseries\mddefault\upshape}
\thm@headpunct{}
\thm@headsep 5\p@ plus\p@ minus\p@\relax
\thm@space@setup
#1
\@topsep \thm@preskip
\@topsepadd \thm@postskip
\def\@tempa{#2}\ifx\@empty\@tempa
\def\@tempa{\@oparg{\@begintheorem{#3}{}}[]}
\else
\refstepcounter{#2}
\def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}
\fi
\@tempa
}
%%%ここまで定理環境後の.削除%%%
\makeatother
Merzong への返信

Re: Theorem環境について

- 本田 知亮 の投稿
角藤先生がご指摘くださっているように
まずはtheorem packageを外しましょう

amsthmとthoeremを同時に指定することには
意味がありません.
両方とも\newenvironmentを書き直すものであり
衝突しています.

amsthmの体裁で「ピリオド」をつけたくない
ということなのでしょうが,
amsthmのあとにtheoremを読み込んで,
theoremのほうが有効になっているのに
amsthmのためのコードを書いている?
のではないかと想像します
#実際に実行しているわけではないので「想像」です.

なお,amsthmで「ピリオド」をとるには
内部マクロを書き直さずとも
体裁変更のマクロ
\theoremstyle,\newtheoremstyleがあるので
それで何とかなるはずです.
Merzong への返信

Re: Theorem環境について

- Merzong の投稿
お二方とも回答ありがとうございます。

まず,角藤先生のご指摘の通りtheorem.styを読み込まないようにしたらエラーは出ませんでしたが,
定理番号と定理名の後ろで改行されずに定理本文がそのまま続いてしまいます。

逆にamsthm.styを読み込まずプリアンブルの関連部分を

\theoremstyle{break}
\theorembodyfont{\normalfont}
\newtheorem{theo}{定理}[section]
\newtheorem{axi}[theo]{公理}
\newtheorem{defi}[theo]{定義}
\newtheorem{lemm}[theo]{補題}

に変更すると,定理番号と定理名の後ろで改行されて希望の出力が得られるのですが,
こちらはamsthm.styにおけるproof環境に相当するものを自前で定義しなければいけません。

どちらかのパッケージのみで両立させるにはどうすればいいでしょうか?

宜しくお願いします。
Merzong への返信

Re: Theorem環境について

- 本田 知亮 の投稿
amsmath packageのマニュアルをお読みください

\texmf-dist\doc\latex\amscls\amsthmdoc.pdf

というのがマニュアルです.

前にも書いたように
\theoremsty,\newtheoremstyle
という体裁調整のためのマクロがあります.
本田 知亮 への返信

Re: Theorem環境について

- 本田 知亮 の投稿
>\texmf-dist\doc\latex\amscls\amsthmdoc.pdf

ファイル名が違ってます.
申し訳ないです
角藤先生のおっしゃるとおり
amsthdoc.pdf
が正です.