\ifnotswp

iaw4's picture

 

I would like to have some macros executed only if we are *not* running in scientific word.

\ifnot\swp

  \usepackage{all-my-tough-to-understand-macros}

  \usepackage{tcilatex}

\fi

probably could use \makeatletter and \@ifundefined{\swp}{\usepackage{mystuff}}{}

so, I need something that only swp defines, and preferably not in tcilatex (because I will load this later, too, even if I am typsetting my document with latex)

how would I do this?

 

Unless you pick out something

Unless you pick out something that's defined only in tcilatex.tex, you will have to create your own switch.  There isn't anything special in the LaTeX files that SW creates besides adding tcilatex.tex when the document is saved with the SWP/SW/SN file type.  If you save using the Portable LaTeX file type, then there wouldn't be even tcilatex.tex around.  The only distinguishing items would be comments in the file, which aren't seen by the LaTeX compiler.

After all, SW doesn't do the LaTeX compile.  SW gives you the visual interface, but the .tex files generated could be compiled by any LaTeX implementation.

I received a direct reply

I received a direct reply from a forum user: "hi george---al that swd would have to do is invoke latex with an argument, ala 'pdflatex "\def\swp{1}"`.  having the ability to pretest in a latex file would make it much easier to write a latex file that is a little more collaborative."

Adding the \def\swp{1} macro can be done when invoking LaTeX from inside SW.  This would require modification of the appropriate dialog after selecting Typeset, Expert Settings.  While I still don't understand the benefit, it is possible to set up the system to make the requested modification.