Make blocks of text invisible only if said so
Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
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
add a comment |
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
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
text text-manipulation
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
add a comment |
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
add a comment |
4 Answers
4
active
oldest
votes
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
add a comment |
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
add a comment |
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
add a comment |
I usually do this using new if
s:
documentclassarticle
newififprintsolution
printsolutiontrue
begindocument
Assignment.
ifprintsolution
Solution.
fi
enddocument
See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited Dec 18 at 16:21
answered Dec 18 at 16:01
Raven
825111
825111
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Dec 18 at 16:00
samcarter
85.7k794275
85.7k794275
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Dec 18 at 16:00
Uwe Ziegenhagen
9,26743980
9,26743980
add a comment |
add a comment |
I usually do this using new if
s:
documentclassarticle
newififprintsolution
printsolutiontrue
begindocument
Assignment.
ifprintsolution
Solution.
fi
enddocument
See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/
add a comment |
I usually do this using new if
s:
documentclassarticle
newififprintsolution
printsolutiontrue
begindocument
Assignment.
ifprintsolution
Solution.
fi
enddocument
See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/
add a comment |
I usually do this using new if
s:
documentclassarticle
newififprintsolution
printsolutiontrue
begindocument
Assignment.
ifprintsolution
Solution.
fi
enddocument
See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/
I usually do this using new if
s:
documentclassarticle
newififprintsolution
printsolutiontrue
begindocument
Assignment.
ifprintsolution
Solution.
fi
enddocument
See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/
answered Dec 18 at 16:11
Bubaya
38119
38119
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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