Is there a way to modify the theorem environment in order to have an horizontal rule immediately before and...












0














I've just seen this solution for the proof environment and I really liked it.



How to draw a horizontal line at the end of proofs?



I'm wondering if is there an elegant way to do it also with the theorem environment.



Note
I don't want to use boxes or mdframed packages...





Edit: the following code for example doesn't work:



documentclass[11pt,a4paper]{book}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{fourier}
usepackage{lipsum}
usepackage{amsmath}

usepackage{thmtools}
usepackage[thmmarks, thref, amsmath]{ntheorem}
theoremstyle{plain}
theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
theoremheaderfont{scshape}
theorembodyfont{itshape}
theoremseparator{. }
newtheorem{thm}{Theorem}
begin{document}
tableofcontents
lipsum[1]
begin{thm}[D’Alembert-Gauss]
The field $mathbf C$ is algebraically closed.
end{thm}
lipsum[2]

addcontentsline{toc}{chapter}{List of Theorems}
listoftheorems[ignoreall,onlynamed={thm,lmm,prop}
end{document}









share|improve this question





























    0














    I've just seen this solution for the proof environment and I really liked it.



    How to draw a horizontal line at the end of proofs?



    I'm wondering if is there an elegant way to do it also with the theorem environment.



    Note
    I don't want to use boxes or mdframed packages...





    Edit: the following code for example doesn't work:



    documentclass[11pt,a4paper]{book}
    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage{fourier}
    usepackage{lipsum}
    usepackage{amsmath}

    usepackage{thmtools}
    usepackage[thmmarks, thref, amsmath]{ntheorem}
    theoremstyle{plain}
    theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
    theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
    theoremheaderfont{scshape}
    theorembodyfont{itshape}
    theoremseparator{. }
    newtheorem{thm}{Theorem}
    begin{document}
    tableofcontents
    lipsum[1]
    begin{thm}[D’Alembert-Gauss]
    The field $mathbf C$ is algebraically closed.
    end{thm}
    lipsum[2]

    addcontentsline{toc}{chapter}{List of Theorems}
    listoftheorems[ignoreall,onlynamed={thm,lmm,prop}
    end{document}









    share|improve this question



























      0












      0








      0


      1





      I've just seen this solution for the proof environment and I really liked it.



      How to draw a horizontal line at the end of proofs?



      I'm wondering if is there an elegant way to do it also with the theorem environment.



      Note
      I don't want to use boxes or mdframed packages...





      Edit: the following code for example doesn't work:



      documentclass[11pt,a4paper]{book}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}
      usepackage{fourier}
      usepackage{lipsum}
      usepackage{amsmath}

      usepackage{thmtools}
      usepackage[thmmarks, thref, amsmath]{ntheorem}
      theoremstyle{plain}
      theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
      theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
      theoremheaderfont{scshape}
      theorembodyfont{itshape}
      theoremseparator{. }
      newtheorem{thm}{Theorem}
      begin{document}
      tableofcontents
      lipsum[1]
      begin{thm}[D’Alembert-Gauss]
      The field $mathbf C$ is algebraically closed.
      end{thm}
      lipsum[2]

      addcontentsline{toc}{chapter}{List of Theorems}
      listoftheorems[ignoreall,onlynamed={thm,lmm,prop}
      end{document}









      share|improve this question















      I've just seen this solution for the proof environment and I really liked it.



      How to draw a horizontal line at the end of proofs?



      I'm wondering if is there an elegant way to do it also with the theorem environment.



      Note
      I don't want to use boxes or mdframed packages...





      Edit: the following code for example doesn't work:



      documentclass[11pt,a4paper]{book}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}
      usepackage{fourier}
      usepackage{lipsum}
      usepackage{amsmath}

      usepackage{thmtools}
      usepackage[thmmarks, thref, amsmath]{ntheorem}
      theoremstyle{plain}
      theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
      theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
      theoremheaderfont{scshape}
      theorembodyfont{itshape}
      theoremseparator{. }
      newtheorem{thm}{Theorem}
      begin{document}
      tableofcontents
      lipsum[1]
      begin{thm}[D’Alembert-Gauss]
      The field $mathbf C$ is algebraically closed.
      end{thm}
      lipsum[2]

      addcontentsline{toc}{chapter}{List of Theorems}
      listoftheorems[ignoreall,onlynamed={thm,lmm,prop}
      end{document}






      theorems rules newtheorem addlines






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 18 '17 at 21:33

























      asked Oct 16 '17 at 18:09









      Erik Pillon

      1036




      1036






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Quite simple with the theoremprework and theorempostwork commands from ntheorem:



          documentclass[11pt,a4paper]{book}
          usepackage[utf8]{inputenc}
          usepackage[T1]{fontenc}
          usepackage{fourier}
          usepackage{lipsum}
          usepackage{amsmath}

          usepackage[thmmarks, thref, amsmath]{ntheorem}%
          theoremstyle{plain}
          theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
          theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
          theoremheaderfont{scshape}
          theorembodyfont{itshape}
          theoremseparator{. }
          newtheorem{thm}{Theorem}
          usepackage{thmtools}
          begin{document}
          tableofcontents
          bigskip

          lipsum[1]
          begin{thm}[D’Alembert-Gauss]
          The field $mathbf C$ is algebraically closed.
          end{thm}
          lipsum[2]
          bigskip
          addcontentsline{toc}{chapter}{List of Theorems}
          theoremlisttype{allname}
          listtheorems{thm}%

          end{document}


          enter image description here






          share|improve this answer























          • The rules can get detached at page breaks and there's no spacing around the statement.
            – egreg
            Oct 16 '17 at 22:39












          • @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
            – Bernard
            Oct 16 '17 at 22:58










          • Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
            – Erik Pillon
            Oct 18 '17 at 21:16










          • Could you post a minimal (non-)working example?
            – Bernard
            Oct 18 '17 at 21:18










          • I've just edited the question. Thanks.
            – Erik Pillon
            Oct 18 '17 at 21:33













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f396485%2fis-there-a-way-to-modify-the-theorem-environment-in-order-to-have-an-horizontal%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Quite simple with the theoremprework and theorempostwork commands from ntheorem:



          documentclass[11pt,a4paper]{book}
          usepackage[utf8]{inputenc}
          usepackage[T1]{fontenc}
          usepackage{fourier}
          usepackage{lipsum}
          usepackage{amsmath}

          usepackage[thmmarks, thref, amsmath]{ntheorem}%
          theoremstyle{plain}
          theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
          theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
          theoremheaderfont{scshape}
          theorembodyfont{itshape}
          theoremseparator{. }
          newtheorem{thm}{Theorem}
          usepackage{thmtools}
          begin{document}
          tableofcontents
          bigskip

          lipsum[1]
          begin{thm}[D’Alembert-Gauss]
          The field $mathbf C$ is algebraically closed.
          end{thm}
          lipsum[2]
          bigskip
          addcontentsline{toc}{chapter}{List of Theorems}
          theoremlisttype{allname}
          listtheorems{thm}%

          end{document}


          enter image description here






          share|improve this answer























          • The rules can get detached at page breaks and there's no spacing around the statement.
            – egreg
            Oct 16 '17 at 22:39












          • @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
            – Bernard
            Oct 16 '17 at 22:58










          • Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
            – Erik Pillon
            Oct 18 '17 at 21:16










          • Could you post a minimal (non-)working example?
            – Bernard
            Oct 18 '17 at 21:18










          • I've just edited the question. Thanks.
            – Erik Pillon
            Oct 18 '17 at 21:33


















          2














          Quite simple with the theoremprework and theorempostwork commands from ntheorem:



          documentclass[11pt,a4paper]{book}
          usepackage[utf8]{inputenc}
          usepackage[T1]{fontenc}
          usepackage{fourier}
          usepackage{lipsum}
          usepackage{amsmath}

          usepackage[thmmarks, thref, amsmath]{ntheorem}%
          theoremstyle{plain}
          theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
          theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
          theoremheaderfont{scshape}
          theorembodyfont{itshape}
          theoremseparator{. }
          newtheorem{thm}{Theorem}
          usepackage{thmtools}
          begin{document}
          tableofcontents
          bigskip

          lipsum[1]
          begin{thm}[D’Alembert-Gauss]
          The field $mathbf C$ is algebraically closed.
          end{thm}
          lipsum[2]
          bigskip
          addcontentsline{toc}{chapter}{List of Theorems}
          theoremlisttype{allname}
          listtheorems{thm}%

          end{document}


          enter image description here






          share|improve this answer























          • The rules can get detached at page breaks and there's no spacing around the statement.
            – egreg
            Oct 16 '17 at 22:39












          • @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
            – Bernard
            Oct 16 '17 at 22:58










          • Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
            – Erik Pillon
            Oct 18 '17 at 21:16










          • Could you post a minimal (non-)working example?
            – Bernard
            Oct 18 '17 at 21:18










          • I've just edited the question. Thanks.
            – Erik Pillon
            Oct 18 '17 at 21:33
















          2












          2








          2






          Quite simple with the theoremprework and theorempostwork commands from ntheorem:



          documentclass[11pt,a4paper]{book}
          usepackage[utf8]{inputenc}
          usepackage[T1]{fontenc}
          usepackage{fourier}
          usepackage{lipsum}
          usepackage{amsmath}

          usepackage[thmmarks, thref, amsmath]{ntheorem}%
          theoremstyle{plain}
          theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
          theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
          theoremheaderfont{scshape}
          theorembodyfont{itshape}
          theoremseparator{. }
          newtheorem{thm}{Theorem}
          usepackage{thmtools}
          begin{document}
          tableofcontents
          bigskip

          lipsum[1]
          begin{thm}[D’Alembert-Gauss]
          The field $mathbf C$ is algebraically closed.
          end{thm}
          lipsum[2]
          bigskip
          addcontentsline{toc}{chapter}{List of Theorems}
          theoremlisttype{allname}
          listtheorems{thm}%

          end{document}


          enter image description here






          share|improve this answer














          Quite simple with the theoremprework and theorempostwork commands from ntheorem:



          documentclass[11pt,a4paper]{book}
          usepackage[utf8]{inputenc}
          usepackage[T1]{fontenc}
          usepackage{fourier}
          usepackage{lipsum}
          usepackage{amsmath}

          usepackage[thmmarks, thref, amsmath]{ntheorem}%
          theoremstyle{plain}
          theoremprework{bigskiphrulevspace{-1.5ex}leavevmodenobreak}%leavevmode
          theorempostwork{vspace*{-1ex}hrulebigskipleavevmode}
          theoremheaderfont{scshape}
          theorembodyfont{itshape}
          theoremseparator{. }
          newtheorem{thm}{Theorem}
          usepackage{thmtools}
          begin{document}
          tableofcontents
          bigskip

          lipsum[1]
          begin{thm}[D’Alembert-Gauss]
          The field $mathbf C$ is algebraically closed.
          end{thm}
          lipsum[2]
          bigskip
          addcontentsline{toc}{chapter}{List of Theorems}
          theoremlisttype{allname}
          listtheorems{thm}%

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 10 mins ago









          Frenzy Li

          231211




          231211










          answered Oct 16 '17 at 19:15









          Bernard

          166k769193




          166k769193












          • The rules can get detached at page breaks and there's no spacing around the statement.
            – egreg
            Oct 16 '17 at 22:39












          • @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
            – Bernard
            Oct 16 '17 at 22:58










          • Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
            – Erik Pillon
            Oct 18 '17 at 21:16










          • Could you post a minimal (non-)working example?
            – Bernard
            Oct 18 '17 at 21:18










          • I've just edited the question. Thanks.
            – Erik Pillon
            Oct 18 '17 at 21:33




















          • The rules can get detached at page breaks and there's no spacing around the statement.
            – egreg
            Oct 16 '17 at 22:39












          • @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
            – Bernard
            Oct 16 '17 at 22:58










          • Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
            – Erik Pillon
            Oct 18 '17 at 21:16










          • Could you post a minimal (non-)working example?
            – Bernard
            Oct 18 '17 at 21:18










          • I've just edited the question. Thanks.
            – Erik Pillon
            Oct 18 '17 at 21:33


















          The rules can get detached at page breaks and there's no spacing around the statement.
          – egreg
          Oct 16 '17 at 22:39






          The rules can get detached at page breaks and there's no spacing around the statement.
          – egreg
          Oct 16 '17 at 22:39














          @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
          – Bernard
          Oct 16 '17 at 22:58




          @egreg: For the rules at page breaks, there must be a way to avoid them that's explained somewhere in the documentation, but I can't find it. What do you mean with ‘no spacing around the statement’? I added a small negative vertical space because I found the spacing at the end too large.Could you give some details?
          – Bernard
          Oct 16 '17 at 22:58












          Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
          – Erik Pillon
          Oct 18 '17 at 21:16




          Thanks a lot for your immediate answer! Anyway this way strangely collides with the command listoftheorems of the package thmtools... Lualatex starts compiling the document but a certain point it get stuck and I have to force it it stop with the terminal.
          – Erik Pillon
          Oct 18 '17 at 21:16












          Could you post a minimal (non-)working example?
          – Bernard
          Oct 18 '17 at 21:18




          Could you post a minimal (non-)working example?
          – Bernard
          Oct 18 '17 at 21:18












          I've just edited the question. Thanks.
          – Erik Pillon
          Oct 18 '17 at 21:33






          I've just edited the question. Thanks.
          – Erik Pillon
          Oct 18 '17 at 21:33




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f396485%2fis-there-a-way-to-modify-the-theorem-environment-in-order-to-have-an-horizontal%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)