GeneralHiding a new environment

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jbruckman
Posts: 2
Joined: Wed Dec 16, 2009 10:55 am

Hiding a new environment

Post by jbruckman »

Assuming I've properly created a new environment, let's call it "fmeo" (for my eyes only), how would I create a command that would suppress this environment from showing up when running pdflatex?

The idea is that I'd like to be able to create the pdf file without the contents of fmeo if the command is present, and include them otherwise. I'd also accept a command that shows the environment when present, and hides them if the command isn't present. Either works.

Any help would be great.

~Jon

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Hiding a new environment

Post by woltan »

Hi jbruckman,
I did the same thing using TeXnicCenter. And if I understand you correctly you could try the following:
Define a new Compiler Profile (Alt+F7) where you insert this in the end:
"\newcommand{\fmeo}{} \input{%Pm}"

Then inside your preamble you could do this:

Code: Select all

\newenvironment{FMEO}
{
\ifthenelse{\isundefined{\fmeo}}
{}
{
%Do what you want here
}
}
{}	
You'll be in need of the ifthen package (\usepackage{ifthen}).
Now if you create a similar compiler profile with this at the end:
"\input{%Pm}"
(notice the missing '\newcommand{\fmeo}{}'
it should do the trick.

I hope I could help you here.
Have fun
cherio Woltan
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Hiding a new environment

Post by phi »

jbruckman
Posts: 2
Joined: Wed Dec 16, 2009 10:55 am

Re: Hiding a new environment

Post by jbruckman »

Thanks! That looks like precisely what I need. I'll have a chance to play with this more in a day or two, I'll let you know if it worked.
Post Reply