LyXRemoving comments

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Removing comments

Post by thedreamshaper »

I have inserted alot of comments in my LyX file, now I need to be able to control if they are preinted or not. In my preamle I have put:

Code: Select all

\RequirePackage{colortbl, tabularx}
\@ifundefined{comment}{}% do nothing if the comment environment is not defined
  {% redefine the comment environment if it is defined
   \renewenvironment{comment}
    {% replaces \begin{comment}
     \par\medskip\noindent
     \tabularx{\textwidth}{|>{\columncolor[gray]{0.9}}X|}
     \hline
     \emph{\textbf{Kommentar:}}% You can use any other text instead of "Comment:" or leave it
    }
    {replaces \end{comment}
     \endtabularx\hrule\par\medskip
    }
  }%
%
So I can get them in a nice box. But is there a way to adopt the code so they arent shown at all ?

Thanks in advance! :)

Recommended reading 2024:

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

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

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Removing comments

Post by Johannes_B »

I would think commenting the whole block should do what you want.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Re: Removing comments

Post by thedreamshaper »

You are quite right!

I had actually tried this, but i had posted the code twice in my preamble ^^

Thanks for the help :)
Post Reply