I'd like to know how to insert Tikz code in Scientific Workplace tex file. Since SW doesn't support Tikz directly, now I just create Tikz code in another tex editor and export as pdf. Then I convert pdf to images, and import images into SW.
1 Answers
A simple web search finds instructions from SWP's developers. These are untested as I have no access to SWP, but, if they don't work, you should contact them to ask for updated information.
Ref.: http://www.sciword.co.uk/mailings/May2016.htm
TikZ: This Scientific WorkPlace v5.5 question started with an academic who's been on our mailing list since 2002 Emailing to say:
I hope you don’t mind me asking a quick question. I hoped that when I include the text below as an encapsulated TeX file in my SWP file that it would produce a figure for me. Instead it is giving me error messages. Is there any quick fix for this? What is the general advice if I want to include TeX (or otherwise) produced mathematical figures?
and including the code for a TikZ picture. In our replies we said:
If you want to include tikz pictures... you will need the tikz-cd package which is available at https://www.ctan.org/pkg/tikz-cd.
Have you added the tikz-cd package to your document (Typeset – Options & Packages – Package Options)? Because tikz-cd is not supplied with Scientific WorkPlace, you will need to GoNative to add it.</p>You also need to ensure that the tikz package is available on your computer, together with the packages it requires (xkeyval, pgf and everyshi). You can obtain any further packages you require from CTAN, but we have put the zip files you'll need here: tikz-cd, xkeyval, pgf and everyshi (right-click – SaveAs). Simply unzip these files, and save the folders they contain as
C:\sw[p]55\TCITeX\TeX\LaTeX\contrib\tikz-cd\etc; you should first delete the old version of PGF in the folderC:\sw[p]55\TCITeX\TeX\LaTeX\contrib\pgf. The sample.texfile here will then compile to produce this PDF. You can put the TikZ TeX field in a Display for centering and better spacing.The instructions above are for v5.5. For v6.0, the only package you need to add is tikz-cd; the sample
.scifile here will then compile to produce this PDF (intentionally showing a different graphic). When you add the TeX Field in v6.0, the dialog asks you which packages it requires; in this case, simply enter tikz-cd. You also need to make sure that tikz-cd is available on your TeX Live installation (see Item 4 below).Once you get our sample
.texor.scifiles working, why not try with your own TikZ graphics, or code obtained online? There are lots of fun examples available at http://www.texample.net/tikz/examples/ – though you'll need to remember than anything before the\begin{document}probably needs to go into the Preamble!Adding TeXLive packages (v6.0): Following on from Item 3 above, let's add the package tikz-cd as an example:
Windows – TeX Live Manager (instructions copied from our December 2015 mailing Item 4):
- Double click the executable file tlmgr-gui.exe in the
c:\TeXLive\2015\bin\win32folder or 2016 (or later)- Click the "Load default" button and wait
- Scroll through the list of Package names, locate whichever package is to be added and check the box (here adding the subfigure package)
- Click the "Install" button
You might need to update the TexLive Manager first.
Mac – TeX Live Utility:
- Use the Finder to navigate to
/Applications/MacKichan/local/bin/TeXLiveUtility- Click to open, and then click on Updates to see if any need installing
- Click on Packages, and scroll down to tikz-cd (or enter it in the Search box).
- Select the packages you wish to install using Cmd – Click (in our example, just tikz-cd)
- Right-click and select Install Selected Packages
- After a few seconds you will see the Install Succeeded message
Note that the suggestion to add the subfigure package is nonsense: this has been obsolete for ages. Use subcaption or, failing that, subfig. If SWP requires subfigure with a recent TeX installation, that's a bug on SWP's side and should be reported.
- 198,882
.texand then add in TikZ. – cfr Feb 03 '18 at 22:15