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
- {0pt}% 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{mytheorem}{Theorem}[chapter]
- newcommand{thistheoremname}{}
- newfctaylortheorem{genericthm}[mytheorem]{thistheoremname}
- newenvironment{custom}[1][Custom]
- {renewcommand{thistheoremname}{#1}%
- begin{genericthm}}
- {end{genericthm}}
- newfctaylortheorem*{genericthm*}{thistheoremname}
- newenvironment{custom*}[1][Custom]
- {renewcommand{thistheoremname}{#1}%
- begin{genericthm*}}
- {end{genericthm*}}
- begin{document}
- section{One}
- begin{custom}{Custom Title}[optional words]label{A}
- lipsum*[2]
- end{custom}
- newpage
- begin{custom}label{B}
- Even though I've been teaching for n! years, every class is a fresh
- adventure -- An adventure. That word is a euphemism for the stark reality,
- which is that every class contains some totally shocking development
- that I have never seen before and haven't any idea how to cope with.
- Just last year, for the first time in many years, I taught a section
- of the junior-level mathematical analysis course. You know -- the one
- where students meet proofs in analysis for the first time. The one where
- students and epsilons meet, eyeball to eyeball, and it isn't the epsilons
- that blink. The one where students decide that they really wanted to be
- doctors and lawyers after all.
- end{custom}
- newpage
- Here are the references: ref{A} and ref{B}.
- end{document}
- begin{custom}{Custom Title}[optional words]label{A}
- lipsum*[2]
- end{custom}
- begin{custom}label{B}
- ...
- end{custom}
Add Comment
Please, Sign In to add comment