Make blocks of text invisible only if said so

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












6














Is there any command which allows me to make some blocks of text invisible only if initially I said so?



I.e., I would like to mark some lines throughout the text that would only appear in the compiled pdf if in the beggining of the document I said something like: "those blocks of text ON"; and I don't want them to appear if I said something like "those blocks of text OFF".



The purpose of this is to generate two different documents: one with more deitailed information and another one without those details.



Note that this is not the same as the phantom or comment commands.










share|improve this question





















  • Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
    – samcarter
    Dec 18 at 15:50











  • No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
    – AJHC
    Dec 18 at 15:55











  • I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
    – Rmano
    Dec 18 at 16:14















6














Is there any command which allows me to make some blocks of text invisible only if initially I said so?



I.e., I would like to mark some lines throughout the text that would only appear in the compiled pdf if in the beggining of the document I said something like: "those blocks of text ON"; and I don't want them to appear if I said something like "those blocks of text OFF".



The purpose of this is to generate two different documents: one with more deitailed information and another one without those details.



Note that this is not the same as the phantom or comment commands.










share|improve this question





















  • Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
    – samcarter
    Dec 18 at 15:50











  • No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
    – AJHC
    Dec 18 at 15:55











  • I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
    – Rmano
    Dec 18 at 16:14













6












6








6


3





Is there any command which allows me to make some blocks of text invisible only if initially I said so?



I.e., I would like to mark some lines throughout the text that would only appear in the compiled pdf if in the beggining of the document I said something like: "those blocks of text ON"; and I don't want them to appear if I said something like "those blocks of text OFF".



The purpose of this is to generate two different documents: one with more deitailed information and another one without those details.



Note that this is not the same as the phantom or comment commands.










share|improve this question













Is there any command which allows me to make some blocks of text invisible only if initially I said so?



I.e., I would like to mark some lines throughout the text that would only appear in the compiled pdf if in the beggining of the document I said something like: "those blocks of text ON"; and I don't want them to appear if I said something like "those blocks of text OFF".



The purpose of this is to generate two different documents: one with more deitailed information and another one without those details.



Note that this is not the same as the phantom or comment commands.







text text-manipulation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 18 at 15:36









AJHC

333




333











  • Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
    – samcarter
    Dec 18 at 15:50











  • No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
    – AJHC
    Dec 18 at 15:55











  • I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
    – Rmano
    Dec 18 at 16:14
















  • Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
    – samcarter
    Dec 18 at 15:50











  • No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
    – AJHC
    Dec 18 at 15:55











  • I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
    – Rmano
    Dec 18 at 16:14















Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
– samcarter
Dec 18 at 15:50





Should the space of such blocks be preserved ? Which documentclass do you use? Does these blocks contain things like labels which are necessary in the remaining text?
– samcarter
Dec 18 at 15:50













No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
– AJHC
Dec 18 at 15:55





No, the space should not be preserved, i.e., when I say that I don't want those lines to appear, I really don't want any trace of that text in the compiled document. Also: these blocks of text which I'm refering to are simple text lines: no labels, no pics, etc.
– AJHC
Dec 18 at 15:55













I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
– Rmano
Dec 18 at 16:14




I think that the comment package is perfect for this... osl.ugr.es/CTAN/macros/latex/contrib/comment/comment.pdf
– Rmano
Dec 18 at 16:14










4 Answers
4






active

oldest

votes


















3














The simplest way would be to do something like this in the preamble:



newcommandadditionalInfo[1]#1


and then put all of those lines into that macro like this:



additionalInfoI am additional


If you don't want the lines to show up just replace above macro definition with



newcommandadditionalInfo[1]


Not as elegant as the other answers but in my opinion the simplest solution...




documentclassarticle

% switch comment to disable additional info
newcommandadditionalInfo[1]#1
% newcommandadditionalInfo[1]

begindocument
I am always here

additionalInfoI am additional
enddocument





share|improve this answer






























    7














    One possibility is the multiaudience package:



    documentclassarticle

    % remove comment from the following line for the long version
    %defCurrentAudiencelong



    usepackagemultiaudience
    SetNewAudiencelong
    begindocument

    normal text
    beginshowntolong
    Text for execs
    endshownto
    normal text

    enddocument





    share|improve this answer




























      5














      You could use the ifthen package to implement this:



      documentclassminimal

      usepackageifthen
      newbooleansomevariable
      setbooleansomevariablefalse

      begindocument

      ifthenelsebooleansomevariableText if somevariable is true.Text if somevariable is false.

      enddocument





      share|improve this answer




























        4














        I usually do this using new ifs:



        documentclassarticle
        newififprintsolution
        printsolutiontrue
        begindocument
        Assignment.

        ifprintsolution
        Solution.
        fi
        enddocument


        See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/






        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',
          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%2f466380%2fmake-blocks-of-text-invisible-only-if-said-so%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          The simplest way would be to do something like this in the preamble:



          newcommandadditionalInfo[1]#1


          and then put all of those lines into that macro like this:



          additionalInfoI am additional


          If you don't want the lines to show up just replace above macro definition with



          newcommandadditionalInfo[1]


          Not as elegant as the other answers but in my opinion the simplest solution...




          documentclassarticle

          % switch comment to disable additional info
          newcommandadditionalInfo[1]#1
          % newcommandadditionalInfo[1]

          begindocument
          I am always here

          additionalInfoI am additional
          enddocument





          share|improve this answer



























            3














            The simplest way would be to do something like this in the preamble:



            newcommandadditionalInfo[1]#1


            and then put all of those lines into that macro like this:



            additionalInfoI am additional


            If you don't want the lines to show up just replace above macro definition with



            newcommandadditionalInfo[1]


            Not as elegant as the other answers but in my opinion the simplest solution...




            documentclassarticle

            % switch comment to disable additional info
            newcommandadditionalInfo[1]#1
            % newcommandadditionalInfo[1]

            begindocument
            I am always here

            additionalInfoI am additional
            enddocument





            share|improve this answer

























              3












              3








              3






              The simplest way would be to do something like this in the preamble:



              newcommandadditionalInfo[1]#1


              and then put all of those lines into that macro like this:



              additionalInfoI am additional


              If you don't want the lines to show up just replace above macro definition with



              newcommandadditionalInfo[1]


              Not as elegant as the other answers but in my opinion the simplest solution...




              documentclassarticle

              % switch comment to disable additional info
              newcommandadditionalInfo[1]#1
              % newcommandadditionalInfo[1]

              begindocument
              I am always here

              additionalInfoI am additional
              enddocument





              share|improve this answer














              The simplest way would be to do something like this in the preamble:



              newcommandadditionalInfo[1]#1


              and then put all of those lines into that macro like this:



              additionalInfoI am additional


              If you don't want the lines to show up just replace above macro definition with



              newcommandadditionalInfo[1]


              Not as elegant as the other answers but in my opinion the simplest solution...




              documentclassarticle

              % switch comment to disable additional info
              newcommandadditionalInfo[1]#1
              % newcommandadditionalInfo[1]

              begindocument
              I am always here

              additionalInfoI am additional
              enddocument






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Dec 18 at 16:21

























              answered Dec 18 at 16:01









              Raven

              825111




              825111





















                  7














                  One possibility is the multiaudience package:



                  documentclassarticle

                  % remove comment from the following line for the long version
                  %defCurrentAudiencelong



                  usepackagemultiaudience
                  SetNewAudiencelong
                  begindocument

                  normal text
                  beginshowntolong
                  Text for execs
                  endshownto
                  normal text

                  enddocument





                  share|improve this answer

























                    7














                    One possibility is the multiaudience package:



                    documentclassarticle

                    % remove comment from the following line for the long version
                    %defCurrentAudiencelong



                    usepackagemultiaudience
                    SetNewAudiencelong
                    begindocument

                    normal text
                    beginshowntolong
                    Text for execs
                    endshownto
                    normal text

                    enddocument





                    share|improve this answer























                      7












                      7








                      7






                      One possibility is the multiaudience package:



                      documentclassarticle

                      % remove comment from the following line for the long version
                      %defCurrentAudiencelong



                      usepackagemultiaudience
                      SetNewAudiencelong
                      begindocument

                      normal text
                      beginshowntolong
                      Text for execs
                      endshownto
                      normal text

                      enddocument





                      share|improve this answer












                      One possibility is the multiaudience package:



                      documentclassarticle

                      % remove comment from the following line for the long version
                      %defCurrentAudiencelong



                      usepackagemultiaudience
                      SetNewAudiencelong
                      begindocument

                      normal text
                      beginshowntolong
                      Text for execs
                      endshownto
                      normal text

                      enddocument






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 18 at 16:00









                      samcarter

                      85.7k794275




                      85.7k794275





















                          5














                          You could use the ifthen package to implement this:



                          documentclassminimal

                          usepackageifthen
                          newbooleansomevariable
                          setbooleansomevariablefalse

                          begindocument

                          ifthenelsebooleansomevariableText if somevariable is true.Text if somevariable is false.

                          enddocument





                          share|improve this answer

























                            5














                            You could use the ifthen package to implement this:



                            documentclassminimal

                            usepackageifthen
                            newbooleansomevariable
                            setbooleansomevariablefalse

                            begindocument

                            ifthenelsebooleansomevariableText if somevariable is true.Text if somevariable is false.

                            enddocument





                            share|improve this answer























                              5












                              5








                              5






                              You could use the ifthen package to implement this:



                              documentclassminimal

                              usepackageifthen
                              newbooleansomevariable
                              setbooleansomevariablefalse

                              begindocument

                              ifthenelsebooleansomevariableText if somevariable is true.Text if somevariable is false.

                              enddocument





                              share|improve this answer












                              You could use the ifthen package to implement this:



                              documentclassminimal

                              usepackageifthen
                              newbooleansomevariable
                              setbooleansomevariablefalse

                              begindocument

                              ifthenelsebooleansomevariableText if somevariable is true.Text if somevariable is false.

                              enddocument






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Dec 18 at 16:00









                              Uwe Ziegenhagen

                              9,26743980




                              9,26743980





















                                  4














                                  I usually do this using new ifs:



                                  documentclassarticle
                                  newififprintsolution
                                  printsolutiontrue
                                  begindocument
                                  Assignment.

                                  ifprintsolution
                                  Solution.
                                  fi
                                  enddocument


                                  See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/






                                  share|improve this answer

























                                    4














                                    I usually do this using new ifs:



                                    documentclassarticle
                                    newififprintsolution
                                    printsolutiontrue
                                    begindocument
                                    Assignment.

                                    ifprintsolution
                                    Solution.
                                    fi
                                    enddocument


                                    See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/






                                    share|improve this answer























                                      4












                                      4








                                      4






                                      I usually do this using new ifs:



                                      documentclassarticle
                                      newififprintsolution
                                      printsolutiontrue
                                      begindocument
                                      Assignment.

                                      ifprintsolution
                                      Solution.
                                      fi
                                      enddocument


                                      See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/






                                      share|improve this answer












                                      I usually do this using new ifs:



                                      documentclassarticle
                                      newififprintsolution
                                      printsolutiontrue
                                      begindocument
                                      Assignment.

                                      ifprintsolution
                                      Solution.
                                      fi
                                      enddocument


                                      See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Dec 18 at 16:11









                                      Bubaya

                                      38119




                                      38119



























                                          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%2f466380%2fmake-blocks-of-text-invisible-only-if-said-so%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

                                          How to check contact read email or not when send email to Individual?

                                          Bahrain

                                          Postfix configuration issue with fips on centos 7; mailgun relay