我在证明环境方面遇到了问题。我正在用德语写论文,所以证明环境的名称应该是 Beweis,当我在网上查看时,每个人都说它会自动执行此操作。但在我的情况下,它总是显示 Proof: 。另一个问题是它没有设置证明结束符号,它也应该自动执行此操作。我尝试创建一个名为 {bew} 的新环境,但这也无济于事,我希望有人能帮助我。
这是我的代码:
\documentclass[12pt,a4paper,oneside,final]{amsbook}
%Sprache
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
%Zeichensatz
\usepackage[utf8]{inputenc}
%PDF Integrierung
\usepackage{pdfpages}
%Formatierung
\usepackage[left=3.5cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\usepackage[onehalfspacing]{setspace}
%Mathepackages
\usepackage{amsfonts,amstext,amsmath,amsthm,amssymb,mathrsfs}
%Algorithmen
\usepackage{algorithm, program}
\usepackage{physics}
%diverses
\usepackage{enumerate}
\usepackage[section]{placeins}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%Theoreme und Gleichungen
\numberwithin{equation}{chapter}
\numberwithin{figure}{chapter}
\newtheorem{prop}{Satz}
\newtheorem{lemma}{Lemma}
\newtheorem{korro}{Korollar}
\newtheorem{theorem}{Theorem}
\floatname{algorithm}{Algorithmus}
\newenvironment{bew}{\begin{proof}[Beweis]\end{proof}}
\begin{document}
\begin{proof}
Test 1
\end{proof}
\begin{proof}{Beweis}
Test 2
\end{proof}
\begin{bew}
Test 3
\end{bew}
\end{document}
答案1
program
罪魁祸首是这个包裹:
925 %% \proof macro for theorems and lemmas:
926 \def\proof{\normalshape{\setlength{\parskip}{0pt}\par\addvspace\medskipamount
927 \noindent{\bf Proof: }}\ignorespaces}
(添加了行号以供参考)。这当然是一个愚蠢的定义,但它覆盖了 给出的定义amsthm
。该包还重新定义了\qed
和\qedsymbol
。
这是一个简单的例子:
\documentclass{amsart}
\usepackage[ngerman]{babel}
\usepackage{program}
\begin{document}
\begin{proof}
xyz
\end{proof}
\end{document}
如果我注释掉\usepackage{program}
,我会得到预期的结果:
墓碑位于远端,为了获得尺寸合适的照片,省略了墓碑。
但是,你不能简单地切换包的顺序,假设你真的需要program
。
您可以执行以下操作(示例简化到最少):
\documentclass{amsart}
\usepackage[ngerman]{babel}
\usepackage{amsthm}
% save \proof, \qed and \qedsymbol
\let\amsthmproof\proof
\let\amsthmqed\qed
\let\amsthmqedsymbol\qedsymbol
% load program
\usepackage{program}
% revert
\let\proof\amsthmproof
\let\qed\amsthmqed
\let\qedsymbol\amsthmqedsymbol
\begin{document}
\begin{proof}
xyz
\end{proof}
\end{document}
amsthm
不需要使用amsart
或加载amsbook
,因为这些类使用它们自己的版本,但如果您决定更改文档类,这很重要。
据我所知,所有提供的语言定义文件都具有babel
本地化功能\proofname
;以下是搜索的输出grep
:
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-albanian/albanian.ldf:65: \def\proofname{V\"ertetim}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bahasa/bahasai.ldf:106: \def\proofname{Bukti}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bahasa/bahasam.ldf:109: \def\proofname{Bukti}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-basque/basque.ldf:75: \def\proofname{Frogapena}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-belarusian/belarusianb.ldf:172: \def\proofname{Доказ}% [amsthm]
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-belarusian/belarusianb.ldf:236: \def\proofname{Доказ}% [amsthm]
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-belarusian/belarusianb.ldf:292: \def\proofname{\CYRD\cyro\cyrk\cyra\cyrz}% [amsthm]
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-belarusian/belarusianb.ldf:343: \def\proofname{\CYRD\cyro\cyrk\cyra\cyrz}% [amsthm]
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bosnian/bosnian.ldf:65: \def\proofname{Dokaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-breton/breton.ldf:74: \def\proofname{Proof}% <-- needs translation
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bulgarian/bulgarian.ldf:190: \def\proofname{%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bulgarian/bulgarian.ldf:219: \SetString\proofname{Доказателство}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-bulgarian/bulgarian.ldf:267: \SetString\proofname{%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-catalan/catalan.ldf:77: \def\proofname{Demostraci\'o}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-croatian/croatian.ldf:71: \def\proofname{Dokaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-czech/czech.ldf:103: \def\proofname{D\r{u}kaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-danish/danish.ldf:72: \def\proofname{Bevis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-dutch/dutch.ldf:84: \def\proofname{Bew"ys}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-dutch/dutch.ldf:123: \def\proofname{Bewys}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-english/english.ldf:133: \def\proofname{Proof}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-esperanto/esperanto.ldf:72: \def\proofname{Pruvo}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-estonian/estonian.ldf:76: \def\proofname{T\~oestus}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-finnish/finnish.ldf:71: \def\proofname{Todistus}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-french/frenchb.ldf:806: \SetString{\proofname}{Démonstration}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-french/frenchb.ldf:831: \SetString{\proofname}{D\'emonstration}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-friulan/friulan.ldf:56: \def\proofname{Dimostrazion}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-galician/galician.ldf:106: \def\proofname{Demostraci\'on}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-georgian/georgiancaps.tex:35: \def\proofname{დამტკიცება}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-georgian/georgiancaps.tex:60: \def\proofname{\geod\geoa\geom\geot\geok\geoi\geoc\geoe\geob\geoa}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-georgian/georgiancaps.tex:83: \def\proofnamecap{\GEOD\GEOA\GEOM\GEOT\GEOK\GEOI\GEOC\GEOE\GEOB\GEOA}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-german/germanb.ldf:90: \def\proofname{Beweis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-german/ngermanb.ldf:68: \def\proofname{Beweis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-greek/greek.ldf:166: \def\proofname{\textAlpha\textpi\acctonos\textomicron
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-greek/greek.ldf:181: \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-greek/greek.ldf:220: \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron\textdelta\textepsilon
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-hebrew/hebrew.ldf:106: \def\proofname{\@ensure@R{\hebhe\hebvav\hebkaf\hebhet\hebhe}}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-hungarian/magyar.ldf:1598: \def\proofname{Bizony\'\i t\'as}% AMS-\LaTeX
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-icelandic/icelandic.ldf:77: \SetString{\proofname}{Sönnun}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-icelandic/icelandic.ldf:104: \SetString{\proofname}{S\"{o}nnun}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-interlingua/interlingua.ldf:72: \def\proofname{Prova}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-irish/irish.ldf:72: \def\proofname{Cruth\'unas}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-italian/italian.ldf:48: \def\proofname{Dimostrazione}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-kurmanji/kurmanji.ldf:76: \def\proofname{Del{\^\i}l}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-latin/latin.ldf:74: \def\proofname{Demonstratio}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-macedonian/macedonian.ldf:199: \def\proofname{%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-norsk/norsk.ldf:75: \def\proofname{Bevis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-norsk/norsk.ldf:101: \def\proofname{Bevis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-occitan/occitan.ldf:45: \def\proofname{Demostracion}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-piedmontese/piedmontese.ldf:49: \def\proofname{Dimostrassion}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-polish/polish.ldf:74: \def\proofname{Dow\'od}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-portuges/portuges.ldf:102: \def\proofname{Demonstra\c{c}\~ao}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-portuges/portuges.ldf:134: \def\proofname{Demonstra\c{c}\~ao}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-romanian/romanian.ldf:74: \def\proofname{Demonstra\c{t}ie} %
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-romansh/romansh.ldf:25: \def\proofname{Demonstraziun}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-russian/russianb.ldf:174: \def\proofname{Доказательство}% [amsthm]
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-russian/russianb.ldf:240: \def\proofname{Доказательство}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-russian/russianb.ldf:317: \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-russian/russianb.ldf:390: \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-samin/samin.ldf:71: \def\proofname{Duo\dj{}a\v stus}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-scottish/scottish.ldf:71: \def\proofname{Proof}% <-- needs translation
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-serbian/serbian.ldf:65: \def\proofname{Dokaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-serbianc/serbianc.ldf:59: \def\proofname{\CYRD\cyro\cyrk\cyra\cyrz}%{Доказ}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-slovak/slovak.ldf:106: \def\proofname{D\^okaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-slovenian/slovene.ldf:71: \def\proofname{Dokaz}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-sorbian/lsorbian.ldf:82: \def\proofname{Proof}% <-- needs translation
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-sorbian/usorbian.ldf:82: \def\proofname{Proof}% <-- needs translation
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-spanglish/spanglish.ldf:63: \def\proofname{Demostraci\'on}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-spanish/spanish.ldf:131: \SetString{\proofname}{Demostración}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-spanish/spanish.ldf:158: \SetString{\proofname}{Demostraci\'{o}n}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-swedish/swedish.ldf:71: \def\proofname{Bevis}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-thai/thai.ldf:128: \def\proofname{\thaiPhoPhan\thaiSaraI%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-turkish/turkish.ldf:72: \def\proofname{Kan\i t}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-turkish/turkish.ldf:104: \SetString\proofname{Kanıt}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-turkish/turkish.ldf:144: \SetString\proofname{Kan\i t}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-ukrainian/ukraineb.ldf:166: \def\proofname{{\cyr\CYRD\cyro\cyrv\cyre\cyrd\cyre\cyrn\cyrn\cyrya}}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-vietnamese/vietnamese.ldf:98: \SetString{\proofname}{Chứng minh}
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-vietnamese/vietnamese.ldf:137: \SetString{\proofname}{Ch\'\uhorn ng minh}%
/usr/local/texlive/2016/texmf-dist/tex/generic/babel-welsh/welsh.ldf:74: \SetString{\proofname}{Prawf}