Indented theorem and proof environemnts











up vote
2
down vote

favorite












I would like to be able to recreate the following theorem style, where the main body of a theorem/proof/definition etc. is indented by a variable amount. I would also like to end a theorem proof with a filled circle rather than a square. The labels "Definition 1.1., etc." should be vertically aligned with the first line of the definition text. How do I go about achieving this?



As a starting point, I am working with the following document.



documentclass[11pt,a4paper]{article}
usepackage[margin=2.5cm]{geometry}
usepackage{xcolor}
usepackage[calcwidth]{titlesec}
usepackage{blindtext}
usepackage{scrextend}
usepackage{microtype}
usepackage[leqno]{amsmath}
usepackage[standard,amsmath,thmmarks]{ntheorem}
usepackage{etoolbox}
makeatletter
setlength labelsep {3.15em}
newtheoremstyle{mymargin}%
{item[theorem@headerfont llap{##1 ##2}]}%
{item[theorem@headerfont llap{##1 ##2}| ##3theorem@separatorhskiplabelsep]}%
makeatother


% my definition
theoremstyle{mymargin}
theorembodyfont{}
theoremsymbol{}
theoremprework{}
theorempostwork{}
theoremseparator{.}
newtheorem{mydefinition}{Definition}
numberwithin{mydefinition}{section}
newtheorem{mythm}{Theorem}
numberwithin{mythm}{section}

begin{document}

section{A test section}
begin{addmargin}[10em]{0em}begin{mydefinition}blindtextend{mydefinition}
end{addmargin}

end{document}


enter image description here










share|improve this question


























    up vote
    2
    down vote

    favorite












    I would like to be able to recreate the following theorem style, where the main body of a theorem/proof/definition etc. is indented by a variable amount. I would also like to end a theorem proof with a filled circle rather than a square. The labels "Definition 1.1., etc." should be vertically aligned with the first line of the definition text. How do I go about achieving this?



    As a starting point, I am working with the following document.



    documentclass[11pt,a4paper]{article}
    usepackage[margin=2.5cm]{geometry}
    usepackage{xcolor}
    usepackage[calcwidth]{titlesec}
    usepackage{blindtext}
    usepackage{scrextend}
    usepackage{microtype}
    usepackage[leqno]{amsmath}
    usepackage[standard,amsmath,thmmarks]{ntheorem}
    usepackage{etoolbox}
    makeatletter
    setlength labelsep {3.15em}
    newtheoremstyle{mymargin}%
    {item[theorem@headerfont llap{##1 ##2}]}%
    {item[theorem@headerfont llap{##1 ##2}| ##3theorem@separatorhskiplabelsep]}%
    makeatother


    % my definition
    theoremstyle{mymargin}
    theorembodyfont{}
    theoremsymbol{}
    theoremprework{}
    theorempostwork{}
    theoremseparator{.}
    newtheorem{mydefinition}{Definition}
    numberwithin{mydefinition}{section}
    newtheorem{mythm}{Theorem}
    numberwithin{mythm}{section}

    begin{document}

    section{A test section}
    begin{addmargin}[10em]{0em}begin{mydefinition}blindtextend{mydefinition}
    end{addmargin}

    end{document}


    enter image description here










    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I would like to be able to recreate the following theorem style, where the main body of a theorem/proof/definition etc. is indented by a variable amount. I would also like to end a theorem proof with a filled circle rather than a square. The labels "Definition 1.1., etc." should be vertically aligned with the first line of the definition text. How do I go about achieving this?



      As a starting point, I am working with the following document.



      documentclass[11pt,a4paper]{article}
      usepackage[margin=2.5cm]{geometry}
      usepackage{xcolor}
      usepackage[calcwidth]{titlesec}
      usepackage{blindtext}
      usepackage{scrextend}
      usepackage{microtype}
      usepackage[leqno]{amsmath}
      usepackage[standard,amsmath,thmmarks]{ntheorem}
      usepackage{etoolbox}
      makeatletter
      setlength labelsep {3.15em}
      newtheoremstyle{mymargin}%
      {item[theorem@headerfont llap{##1 ##2}]}%
      {item[theorem@headerfont llap{##1 ##2}| ##3theorem@separatorhskiplabelsep]}%
      makeatother


      % my definition
      theoremstyle{mymargin}
      theorembodyfont{}
      theoremsymbol{}
      theoremprework{}
      theorempostwork{}
      theoremseparator{.}
      newtheorem{mydefinition}{Definition}
      numberwithin{mydefinition}{section}
      newtheorem{mythm}{Theorem}
      numberwithin{mythm}{section}

      begin{document}

      section{A test section}
      begin{addmargin}[10em]{0em}begin{mydefinition}blindtextend{mydefinition}
      end{addmargin}

      end{document}


      enter image description here










      share|improve this question













      I would like to be able to recreate the following theorem style, where the main body of a theorem/proof/definition etc. is indented by a variable amount. I would also like to end a theorem proof with a filled circle rather than a square. The labels "Definition 1.1., etc." should be vertically aligned with the first line of the definition text. How do I go about achieving this?



      As a starting point, I am working with the following document.



      documentclass[11pt,a4paper]{article}
      usepackage[margin=2.5cm]{geometry}
      usepackage{xcolor}
      usepackage[calcwidth]{titlesec}
      usepackage{blindtext}
      usepackage{scrextend}
      usepackage{microtype}
      usepackage[leqno]{amsmath}
      usepackage[standard,amsmath,thmmarks]{ntheorem}
      usepackage{etoolbox}
      makeatletter
      setlength labelsep {3.15em}
      newtheoremstyle{mymargin}%
      {item[theorem@headerfont llap{##1 ##2}]}%
      {item[theorem@headerfont llap{##1 ##2}| ##3theorem@separatorhskiplabelsep]}%
      makeatother


      % my definition
      theoremstyle{mymargin}
      theorembodyfont{}
      theoremsymbol{}
      theoremprework{}
      theorempostwork{}
      theoremseparator{.}
      newtheorem{mydefinition}{Definition}
      numberwithin{mydefinition}{section}
      newtheorem{mythm}{Theorem}
      numberwithin{mythm}{section}

      begin{document}

      section{A test section}
      begin{addmargin}[10em]{0em}begin{mydefinition}blindtextend{mydefinition}
      end{addmargin}

      end{document}


      enter image description here







      theorems amsthm ntheorem






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      wrb98

      21219




      21219






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          I don't like ntheorem. Here's a modification of https://tex.stackexchange.com/a/106582/4427



          documentclass[a4paper]{article}
          usepackage{amsthm,thmtools}
          usepackage{etoolbox}

          usepackage{lipsum} % just for context
          usepackage{showframe} % for showing the margins

          makeatletter
          newlength{thmindent}
          AtBeginDocument{setlength{thmindent}{15em}}
          patchcmd@thm
          {trivlist}
          {list{}{leftmarginthmindent}}
          {}{}
          newcommand{xdeclaretheorem}[2]{%
          declaretheorem[#1]{#2}%
          expandafterpatchcmdcsname thmt@original@end#2endcsname
          {endtrivlist}{endlist}{}{}%
          }

          renewenvironment{proof}[1][proofname]{par
          pushQED{qed}%
          normalfont
          list{}{leftmargin=thmindent}
          item
          makebox[0pt][r]{makebox[thmindent][l]{itshape#1@addpunct{.}}}ignorespaces
          }{%
          popQEDendlist@endpefalse
          }
          renewcommand{qedsymbol}{textbullet}
          makeatother


          declaretheoremstyle[
          headpunct={},
          headfont=bfseries,
          bodyfont=normalfont,
          headindent=0pt,
          postheadspace=0pt,
          headformat={makebox[0pt][r]{makebox[thmindent][l]{NAME NUMBER.}}},
          ]{INDENTthm}

          xdeclaretheorem[
          within=section,
          style=INDENTthm,
          name=Theorem
          ]{thm}

          xdeclaretheorem[
          sibling=thm,
          style=INDENTthm,
          name=Lemma
          ]{lem}

          begin{document}

          begin{thm}
          lipsum*[2]
          begin{enumerate}
          item a
          item b
          end{enumerate}
          end{thm}

          begin{lem}
          lipsum*[2]
          begin{enumerate}
          item a
          item b
          end{enumerate}
          end{lem}

          begin{proof}
          lipsum*[2]
          end{proof}

          end{document}


          enter image description here






          share|improve this answer





















            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',
            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%2f461287%2findented-theorem-and-proof-environemnts%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








            up vote
            3
            down vote



            accepted










            I don't like ntheorem. Here's a modification of https://tex.stackexchange.com/a/106582/4427



            documentclass[a4paper]{article}
            usepackage{amsthm,thmtools}
            usepackage{etoolbox}

            usepackage{lipsum} % just for context
            usepackage{showframe} % for showing the margins

            makeatletter
            newlength{thmindent}
            AtBeginDocument{setlength{thmindent}{15em}}
            patchcmd@thm
            {trivlist}
            {list{}{leftmarginthmindent}}
            {}{}
            newcommand{xdeclaretheorem}[2]{%
            declaretheorem[#1]{#2}%
            expandafterpatchcmdcsname thmt@original@end#2endcsname
            {endtrivlist}{endlist}{}{}%
            }

            renewenvironment{proof}[1][proofname]{par
            pushQED{qed}%
            normalfont
            list{}{leftmargin=thmindent}
            item
            makebox[0pt][r]{makebox[thmindent][l]{itshape#1@addpunct{.}}}ignorespaces
            }{%
            popQEDendlist@endpefalse
            }
            renewcommand{qedsymbol}{textbullet}
            makeatother


            declaretheoremstyle[
            headpunct={},
            headfont=bfseries,
            bodyfont=normalfont,
            headindent=0pt,
            postheadspace=0pt,
            headformat={makebox[0pt][r]{makebox[thmindent][l]{NAME NUMBER.}}},
            ]{INDENTthm}

            xdeclaretheorem[
            within=section,
            style=INDENTthm,
            name=Theorem
            ]{thm}

            xdeclaretheorem[
            sibling=thm,
            style=INDENTthm,
            name=Lemma
            ]{lem}

            begin{document}

            begin{thm}
            lipsum*[2]
            begin{enumerate}
            item a
            item b
            end{enumerate}
            end{thm}

            begin{lem}
            lipsum*[2]
            begin{enumerate}
            item a
            item b
            end{enumerate}
            end{lem}

            begin{proof}
            lipsum*[2]
            end{proof}

            end{document}


            enter image description here






            share|improve this answer

























              up vote
              3
              down vote



              accepted










              I don't like ntheorem. Here's a modification of https://tex.stackexchange.com/a/106582/4427



              documentclass[a4paper]{article}
              usepackage{amsthm,thmtools}
              usepackage{etoolbox}

              usepackage{lipsum} % just for context
              usepackage{showframe} % for showing the margins

              makeatletter
              newlength{thmindent}
              AtBeginDocument{setlength{thmindent}{15em}}
              patchcmd@thm
              {trivlist}
              {list{}{leftmarginthmindent}}
              {}{}
              newcommand{xdeclaretheorem}[2]{%
              declaretheorem[#1]{#2}%
              expandafterpatchcmdcsname thmt@original@end#2endcsname
              {endtrivlist}{endlist}{}{}%
              }

              renewenvironment{proof}[1][proofname]{par
              pushQED{qed}%
              normalfont
              list{}{leftmargin=thmindent}
              item
              makebox[0pt][r]{makebox[thmindent][l]{itshape#1@addpunct{.}}}ignorespaces
              }{%
              popQEDendlist@endpefalse
              }
              renewcommand{qedsymbol}{textbullet}
              makeatother


              declaretheoremstyle[
              headpunct={},
              headfont=bfseries,
              bodyfont=normalfont,
              headindent=0pt,
              postheadspace=0pt,
              headformat={makebox[0pt][r]{makebox[thmindent][l]{NAME NUMBER.}}},
              ]{INDENTthm}

              xdeclaretheorem[
              within=section,
              style=INDENTthm,
              name=Theorem
              ]{thm}

              xdeclaretheorem[
              sibling=thm,
              style=INDENTthm,
              name=Lemma
              ]{lem}

              begin{document}

              begin{thm}
              lipsum*[2]
              begin{enumerate}
              item a
              item b
              end{enumerate}
              end{thm}

              begin{lem}
              lipsum*[2]
              begin{enumerate}
              item a
              item b
              end{enumerate}
              end{lem}

              begin{proof}
              lipsum*[2]
              end{proof}

              end{document}


              enter image description here






              share|improve this answer























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                I don't like ntheorem. Here's a modification of https://tex.stackexchange.com/a/106582/4427



                documentclass[a4paper]{article}
                usepackage{amsthm,thmtools}
                usepackage{etoolbox}

                usepackage{lipsum} % just for context
                usepackage{showframe} % for showing the margins

                makeatletter
                newlength{thmindent}
                AtBeginDocument{setlength{thmindent}{15em}}
                patchcmd@thm
                {trivlist}
                {list{}{leftmarginthmindent}}
                {}{}
                newcommand{xdeclaretheorem}[2]{%
                declaretheorem[#1]{#2}%
                expandafterpatchcmdcsname thmt@original@end#2endcsname
                {endtrivlist}{endlist}{}{}%
                }

                renewenvironment{proof}[1][proofname]{par
                pushQED{qed}%
                normalfont
                list{}{leftmargin=thmindent}
                item
                makebox[0pt][r]{makebox[thmindent][l]{itshape#1@addpunct{.}}}ignorespaces
                }{%
                popQEDendlist@endpefalse
                }
                renewcommand{qedsymbol}{textbullet}
                makeatother


                declaretheoremstyle[
                headpunct={},
                headfont=bfseries,
                bodyfont=normalfont,
                headindent=0pt,
                postheadspace=0pt,
                headformat={makebox[0pt][r]{makebox[thmindent][l]{NAME NUMBER.}}},
                ]{INDENTthm}

                xdeclaretheorem[
                within=section,
                style=INDENTthm,
                name=Theorem
                ]{thm}

                xdeclaretheorem[
                sibling=thm,
                style=INDENTthm,
                name=Lemma
                ]{lem}

                begin{document}

                begin{thm}
                lipsum*[2]
                begin{enumerate}
                item a
                item b
                end{enumerate}
                end{thm}

                begin{lem}
                lipsum*[2]
                begin{enumerate}
                item a
                item b
                end{enumerate}
                end{lem}

                begin{proof}
                lipsum*[2]
                end{proof}

                end{document}


                enter image description here






                share|improve this answer












                I don't like ntheorem. Here's a modification of https://tex.stackexchange.com/a/106582/4427



                documentclass[a4paper]{article}
                usepackage{amsthm,thmtools}
                usepackage{etoolbox}

                usepackage{lipsum} % just for context
                usepackage{showframe} % for showing the margins

                makeatletter
                newlength{thmindent}
                AtBeginDocument{setlength{thmindent}{15em}}
                patchcmd@thm
                {trivlist}
                {list{}{leftmarginthmindent}}
                {}{}
                newcommand{xdeclaretheorem}[2]{%
                declaretheorem[#1]{#2}%
                expandafterpatchcmdcsname thmt@original@end#2endcsname
                {endtrivlist}{endlist}{}{}%
                }

                renewenvironment{proof}[1][proofname]{par
                pushQED{qed}%
                normalfont
                list{}{leftmargin=thmindent}
                item
                makebox[0pt][r]{makebox[thmindent][l]{itshape#1@addpunct{.}}}ignorespaces
                }{%
                popQEDendlist@endpefalse
                }
                renewcommand{qedsymbol}{textbullet}
                makeatother


                declaretheoremstyle[
                headpunct={},
                headfont=bfseries,
                bodyfont=normalfont,
                headindent=0pt,
                postheadspace=0pt,
                headformat={makebox[0pt][r]{makebox[thmindent][l]{NAME NUMBER.}}},
                ]{INDENTthm}

                xdeclaretheorem[
                within=section,
                style=INDENTthm,
                name=Theorem
                ]{thm}

                xdeclaretheorem[
                sibling=thm,
                style=INDENTthm,
                name=Lemma
                ]{lem}

                begin{document}

                begin{thm}
                lipsum*[2]
                begin{enumerate}
                item a
                item b
                end{enumerate}
                end{thm}

                begin{lem}
                lipsum*[2]
                begin{enumerate}
                item a
                item b
                end{enumerate}
                end{lem}

                begin{proof}
                lipsum*[2]
                end{proof}

                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                egreg

                699k8518593129




                699k8518593129






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461287%2findented-theorem-and-proof-environemnts%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

                    サソリ

                    広島県道265号伴広島線

                    Accessing regular linux commands in Huawei's Dopra Linux