Guest User

Untitled

a guest
Jul 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. documentclass{book}
  2. usepackage{amsthm}
  3. usepackage{enumitem}
  4. usepackage{xparse}
  5. usepackage{hyperref}
  6.  
  7. usepackage{lipsum}
  8.  
  9. newtheoremstyle{fctaylor}% name
  10. {topsep}% Space above
  11. {topsep}% Space below
  12. {normalfont}% Body font
  13. {}% Indent amount (empty = no indent, parindent = para indent)
  14. {bfseries}% Thm head font
  15. {}% Punctuation after thm head
  16. {newline}% Space after thm head: " " = normal interword space;
  17. {makethmhead{#1}{#2}{#3}}
  18.  
  19. newlengthfctaylortheoremindent
  20. AtBeginDocument{setlengthfctaylortheoremindent{3em}} % <- customize here
  21. newlengthfctaylorlabelsep
  22. AtBeginDocument{setlengthfctaylorlabelsep{1em}} % <- customize here
  23.  
  24. makeatletter
  25. newcommand{makethmhead}[3]{%
  26. gdefthisthmhead{%
  27. makebox[fctaylortheoremindent][l]{bfseries#2}%
  28. {bfseries#1}%
  29. @ifnotempty{#3}{ (#3)}%
  30. hspace{fctaylorlabelsep}%
  31. phantomsection%%% THIS LINE ADDED
  32. }%
  33. }
  34. makeatother
  35.  
  36. newenvironment{fctayloritemize}
  37. {list{}{%
  38. leftmargin=fctaylortheoremindent
  39. labelwidth=dimexprfctaylortheoremindent-labelseprelax
  40. itemindent=0pt
  41. }}
  42. {endlist}
  43.  
  44. NewDocumentCommand{newfctaylortheorem}{smomo}{%
  45. IfBooleanTF{#1}
  46. {newtheorem*{fctaylor@#2}{#4}}
  47. {IfNoValueTF{#3}
  48. {IfNoValueTF{#5}
  49. {newtheorem{fctaylor@#2}{#4}}
  50. {newtheorem{fctaylor@#2}{#4}[#5]}}
  51. {newtheorem{fctaylor@#2}[fctaylor@#3]{#4}}}%
  52. NewDocumentEnvironment{#2}{o}
  53. {IfNoValueTF{##1}{begin{fctaylor@#2}}{begin{fctaylor@#2}[##1]}%
  54. begin{fctayloritemize}item[thisthmheadhfill]}
  55. {end{fctayloritemize}end{fctaylor@#2}}%
  56. }
  57.  
  58. theoremstyle{fctaylor}
  59. newfctaylortheorem{thm}{Theorem}[section]
  60. newfctaylortheorem*{defn}{Definition}
  61.  
  62. begin{document}
  63. section{One}
  64.  
  65. begin{defn}
  66. lipsum*[2]
  67. end{defn}
  68.  
  69. begin{thm}label{A}
  70. lipsum*[2]
  71. end{thm}
  72.  
  73. begin{thm}[Somebody]label{B}
  74. Something that should show how the text is split across line boundaries
  75. and is correctly indented. And some equivalent conditions:
  76. begin{enumerate}[label=upshape(alph*),ref=(alph*)]
  77. item a condition
  78. item another
  79. item and another
  80. end{enumerate}
  81. which show the point made.
  82.  
  83. textbf{This line, which begins a new paragraph, should immediately follow the above line but be indented.}
  84. end{thm}
  85.  
  86. Here are the references: ref{A} and ref{B}.
  87.  
  88. end{document}
  89.  
  90. newtheoremstyle{fctaylor}%
  91. {topsep}%
  92. {topsep}%
  93. {normalfont}%
  94. {}%
  95. {bfseries}%
  96. {}%
  97. {0pt}% Space after thm head: " " = normal interword space;
  98. {makethmhead{#1}{#2}{#3}}
  99.  
  100. newtheoremstyle{fctaylor}%
  101. {topsep}%
  102. {topsep}%
  103. {normalfont}%
  104. {}%
  105. {bfseries}%
  106. {}%
  107. {newline}% The one thing I changed which seemed to work in the other answer
  108. {makethmhead{#1}{#2}{#3}}
Add Comment
Please, Sign In to add comment