Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{book}
- usepackage{amsthm}
- usepackage{enumitem}
- usepackage{xparse}
- usepackage{hyperref}
- usepackage{lipsum}
- newtheoremstyle{fctaylor}% name
- {topsep}% Space above
- {topsep}% Space below
- {normalfont}% Body font
- {}% Indent amount (empty = no indent, parindent = para indent)
- {bfseries}% Thm head font
- {}% Punctuation after thm head
- {newline}% Space after thm head: " " = normal interword space;
- {makethmhead{#1}{#2}{#3}}
- newlengthfctaylortheoremindent
- AtBeginDocument{setlengthfctaylortheoremindent{3em}} % <- customize here
- newlengthfctaylorlabelsep
- AtBeginDocument{setlengthfctaylorlabelsep{1em}} % <- customize here
- makeatletter
- newcommand{makethmhead}[3]{%
- gdefthisthmhead{%
- makebox[fctaylortheoremindent][l]{bfseries#2}%
- {bfseries#1}%
- @ifnotempty{#3}{ (#3)}%
- hspace{fctaylorlabelsep}%
- phantomsection%%% THIS LINE ADDED
- }%
- }
- makeatother
- newenvironment{fctayloritemize}
- {list{}{%
- leftmargin=fctaylortheoremindent
- labelwidth=dimexprfctaylortheoremindent-labelseprelax
- itemindent=0pt
- }}
- {endlist}
- NewDocumentCommand{newfctaylortheorem}{smomo}{%
- IfBooleanTF{#1}
- {newtheorem*{fctaylor@#2}{#4}}
- {IfNoValueTF{#3}
- {IfNoValueTF{#5}
- {newtheorem{fctaylor@#2}{#4}}
- {newtheorem{fctaylor@#2}{#4}[#5]}}
- {newtheorem{fctaylor@#2}[fctaylor@#3]{#4}}}%
- NewDocumentEnvironment{#2}{o}
- {IfNoValueTF{##1}{begin{fctaylor@#2}}{begin{fctaylor@#2}[##1]}%
- begin{fctayloritemize}item[thisthmheadhfill]}
- {end{fctayloritemize}end{fctaylor@#2}}%
- }
- theoremstyle{fctaylor}
- newfctaylortheorem{thm}{Theorem}[section]
- newfctaylortheorem*{defn}{Definition}
- begin{document}
- section{One}
- begin{defn}
- lipsum*[2]
- end{defn}
- begin{thm}label{A}
- lipsum*[2]
- end{thm}
- begin{thm}[Somebody]label{B}
- Something that should show how the text is split across line boundaries
- and is correctly indented. And some equivalent conditions:
- begin{enumerate}[label=upshape(alph*),ref=(alph*)]
- item a condition
- item another
- item and another
- end{enumerate}
- which show the point made.
- textbf{This line, which begins a new paragraph, should immediately follow the above line but be indented.}
- end{thm}
- Here are the references: ref{A} and ref{B}.
- end{document}
- newtheoremstyle{fctaylor}%
- {topsep}%
- {topsep}%
- {normalfont}%
- {}%
- {bfseries}%
- {}%
- {0pt}% Space after thm head: " " = normal interword space;
- {makethmhead{#1}{#2}{#3}}
- newtheoremstyle{fctaylor}%
- {topsep}%
- {topsep}%
- {normalfont}%
- {}%
- {bfseries}%
- {}%
- {newline}% The one thing I changed which seemed to work in the other answer
- {makethmhead{#1}{#2}{#3}}
Add Comment
Please, Sign In to add comment