make autotext hideable in writer?

I made a table in autotext which I use repeatedly for editorial purposes. Specifically, after I do my initial writing, when I review the rough draft, if I want to make an editorial comment, I go to autotext, and insert a preformatted two row table, which identifies that it is an editorial comment in the first row and provides the comment itself in the second. This autotext gets repeated everytime I want to enter an editorial comment, so there will be many rows in the end version of the editorial review.

The problem is, I want to make an editorial copy of the document, but also a regular copy of the document without the editorial commentaries. To do so, it would require the editorial autotext be turned off and hidden. Is there a way to hide the (embellished) autotext?

fwiw, I have looked at using variables and conditionals in terms of sections already, but I couldnt make much out of it (yet).

There is a much more convenient way of entering editorial comments. In addition it does not change the layout of the document.

  • Click where you want to make your remarks.
  • Insert>Comment or Ctrl+Alt+C
  • A kind of Post-It® flyer opens aside the text

The comments do not print unless you request explicitly so. The regular copy is printed as usual. To print comments, you need to select a “mode” in the LibreOffice Writer tab of the print dialog.

If your need is to send an electronic copy without the comments, first make a copy of the file. Open this copy. Click on the little down-arrow of any comment and Delete All Comments.

EDIT

There is a contorted way to achieve your requirement. In fact, there are two, depending on whether you really need borders around your cells.

As @Lupp points out, there is no way to hide completely a table, mainly because of the borders.

  • Suggestion A without table

Change your AutoText to insert two paragraphs. The first one contains your identification text I assume it is immutable. The second one is a template or even empty. With View>Formatting Marks enabled, it is easy to see that a second paragraph is present.

Both paragraphs are assigned a specific paragraph style with name Comment for example. If you need borders, enable them in the Borders tab. You can choose not to merge borders of adjacent identically styled paragraphs.

  • Suggestion B keeping table

Change your AutoText so that the table has no borders and style the paragraphs in the row with the same paragraph style as above. IMHO when borders are transferred to paragraph styles, the use of a table is not needed. Note that this supposes that your tables have a single column.

  • Common to both suggestions

Your Comment style is an ordinary style when you want to see your editorial comment.

When you want them hidden, change the Comment style definition for no spacing above and below, no borders and Font Effects Hidden. I used to set font size to 2pt but it doesn’t appear to be necessary to completely drop printing.

Nota: from experiment, it looks like a borderless table with hidden content prints nothing, though it may be visible on screen if “show hidden text” is enabled.

Note also as @Lupp rightfully pointed out your pagination will be different with editorail comments visible or not.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Thank you. I am aware of the post it method, but it is too limited for my workflow. I would rather use the method expressed in my original question, so please consider the original question as still open.

As far as I can see, you can’t hide a table - except you hide a complete section containing it. I never tried to create a (hidden) section as an AutoText entry.
A TextFrame can be set to ‘Print Off’, and you can choose in addition’Wrap Through’ to avoid afflicting the creation of pages. Unfortunately a TextFrame isn’t accepted as an AutoText entry.
I’m afraid therefore: If you insist on your very special way of commenting, you will need to use frames of an appropriate style, but to insert them, and to influence the prining with/without the comments by custom code. In addition you will have to accept that the pagination will depend on whether or not the comments are printed.
A raw version of “macros” for the purpose (and a rspective toolbar, and a frame style) is included with the attached example. Please note that all the needed adaptions / debugging / enhancemnets … will be your responsibility. If you aren’t sufficiently familiar with the LibO API, you should stick to a solution better supported “out of the box” as already suggested.
The mentioned example: ask316730specialWayOfCommenting.odt