我的问题类似于这和这。我希望定理编号位于左边距(与正文间距为 0.6em),名称“定理”应与正文对齐。解决方案应与包一起制作,因为我已使用fromamsthm
制作了我非常具体的proof
环境。\renewenvironment
amsthm
\documentclass[12pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage{lipsum,lmodern,libertine}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{amsthm}
\newtheoremstyle{mystyle}
{\topsep} %space above
{\topsep} %space below
{} %bodyfont
{} %indent
{\bfseries} %headfont
{} %punctuation
{0.6em} %space after head
{#2 #1 #3} %theoremheadspec
\theoremstyle{mystyle}
\newtheorem{theorem}{Theorem}
\begin{document}
\lipsum[1]
\begin{theorem}
Let $f\colon [a,b]\to\mathbb{R}$ be continious and let $F$ be an antiderivative of $f$, then
\begin{align*}
\int_a^b f(x)\,\mathrm{d}x=F(b)-F(a).
\end{align*}
\end{theorem}
\end{document}
这看起来像
但它看起来应该像这样(这是用ntheorem
包制作的):
答案1
听起来你想要\llap
命令left overlap
{\llap{#2 }#1 #3} %theoremheadspec
这是一个完整的 MWE,可供使用。
% arara: pdflatex
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{lipsum}
\usepackage{amsthm}
\newtheoremstyle{mystyle}
{\topsep} %space above
{\topsep} %space below
{} %bodyfont
{} %indent
{\bfseries} %headfont
{} %punctuation
{0.6em} %space after head
{\llap{#2 }#1 #3} %theoremheadspec
\theoremstyle{mystyle}
\newtheorem{theorem}{Theorem}
\begin{document}
\lipsum[1]
\begin{theorem}
Let $f\colon [a,b]\to\mathbb{R}$ be continious and let $F$ be an antiderivative of $f$, then
\begin{align*}
\int_a^b f(x)\,\mathrm{d}x=F(b)-F(a).
\end{align*}
\end{theorem}
\end{document}