## How to avoid "reinterpretation" of TEX fields

I am currently writing my thesis with SWP 5.5 and I have several problems with SWP reinterpreting the TeX fields I write into its own commands. It is some time usefull, but it is giving me several problems and I would like to know if there is a solution.

Some examples:

1) I need to use bracket in a short caption, but as I can't use the right bracket ']', i introduce a TeX field \rbrack. With this change it initially works. The problem is that when I close and reopen the file, the TeX field \rbrack has disappeared and there is a ']' character instead which causes an error that prevents properly saving the file.

So I would like for SWP to conserve the TeX fielt and not havig to correct it every single time I open the file.

2) I have to write the thesis abstract in two languages so I use:

TeX field: \selectlanguage{catalan}
TeX field: \begin{abstract}
Abstract in Catalan
TeX field: \end{abstract}
TeX field: \selectlanguage{english}
TeX field: \begin{abstract}
Abstract in English
TeX field: \end{abstract}

Which provides the expected result when compiling. However, when I reopen the document I find

TeX field: \selectlanguage{catalan}
TeX field: \selectlanguage{english}
Abstract in English

instead, and in the front matter there are two abstract tags, one with the text 'Abstract in Catalan' and the other with no text, and when I compile there appear two abstract pages, but none has the title translated to Catalan, and 'Abstract in English'

3)Similarly when I reopen the file the toc, lof and lot appear at the front matter instead of after the title page and they appera at the begining of the document when compile it, instead of where I had set it before closing the document, and in addition no contents appear after the title.

Probably there is some other problem I've encountered, but I think these three problems are example enough of my frustration, and I would really appreciate if somebody could give me a solution.

### When you enter a TeX field in

When you enter a TeX field in Scientific WorkPlace, you can click the Encapsulated Button. This ensures that the input filter does not reword or re-order any of the LaTeX commands.

### On the same topic - how is it

On the same topic - how is it possible to use custom (La)TeX commands such that they are displayed and be edited inside SWP/SW 5.5?

For example, I write

\mycommand{some text and math, one line or more paragraphs}

in the TEX file. If I open SWP, it displays mycommand in a TeX Field, followed by the text between { }. If I have the cursor inside that text, SWP displays a group tag in the dropdown list with text tags. How can this be done inside SWP, without editing the file directly? I even tried to force the group tag to appear in the list (by editing the .cst file) such that I can apply it to the argument of mycommand, but it had no effect (no { } where produceced in the TeX file).

I tried using (Encapsulated) Tex Fields inside SWP to protect the LaTeX command, but the problem is with { and } (try to create a (Encapsulated) TeX Filed in SWP containing only the closing } and see what happens (look inside the TeX file). I also tried to use \bgroup and \egroup or \begingroup \endgroup instead of { and } inside the TeX Field, but LaTeX does not compile the file.

Any suggestions? This would help alot with LaTeX custom commands there are not supported directly by SWP/SW.

Thank you!

### For your exact example you

For your exact example you can create a new tagged run.  See 342: Add new text tags for a discussion with examples.

### Thank you. I will try.

Thank you. I will try.

### Many, many thanks. It's such

Many, many thanks. It's such an easy solution now that I know what this button is for... And knowing what to look for, I've even found it in the manuals now.

Thanks again.

### Just found a working solution

Just found a working solution for example (1)!! Using the Tex field {]} instead of \rbrack