Sysquake for Latex User Manual
Total Page:16
File Type:pdf, Size:1020Kb
Calerga Sysquake for LaTeX User Manual Embedding numerical results and graphics in LaTeX January 2017 2 Sysquake for LaTeX Copyright 1999-2017, Calerga Sàrl. No part of this publication may be reproduced, transmitted or stored in any form or by any means including electronic, mechanical, recording or oth- erwise, without the express written permission of Calerga Sàrl. The information provided in this manual is for reference and information use only, and Calerga assumes no responsibility or liability for any inaccura- cies or errors that may appear in this documentation. Sysquake, LME, Calerga, the Calerga logo, and icons are copyrighted and are protected under the Swiss and international laws. Copying this software for any reason beyond archival purposes is a violation of copyright, and viola- tors may be subject to civil and criminal penalties. Sysquake, LME, and Calerga are trademarks of Calerga Sàrl. All other trademarks are the property of their respective owners. Sysquake for LaTeX User Manual, January 2017. Calerga Sàrl, La Tour-de-Peilz, Switzerland. Most of the material in Sysquake for LaTeX User Manual has first been writ- ten as a set of XHTML files, with lots of cross-reference links. Since (X)HTML is not very well suited for printing, it has been converted to LaTeX with the help of a home-made conversion utility. Additional XML tags have been used to benefit from LaTeX features: e.g. raster images have been replaced with EPS images, equations have been converted from text to real mathematic no- tation, and a table of contents and an index have been added. The same method has been used to create the material for the help command. Thanks to the make utility, the whole process is completely automatic. This system has proved to be very flexible to maintain three useful formats in parallel: two for on-line help, and one for high-quality printing. World Wide Web: http://www.calerga.com E-mail: [email protected] Mail: Calerga Sàrl Ch. des Murs Blancs 25 1814 La Tour-de-Peilz Switzerland Typesetting: 2017-1-19 Contents 1 Introduction 7 2 Installing Sysquake for LaTeX 9 2.1 Windows . 10 2.2 macOS . 11 2.3 Ubuntu, Debian or Linux Mint . 12 2.4 Manual installation on Linux . 12 3 Sysquake for LaTeX Tutorial 15 3.1 Creating a LaTeX file . 15 3.2 Add the Sysquake package . 16 3.3 Your first Sysquake computation . 16 3.4 Formatted results . 17 3.5 Programs . 17 3.6 Graphics . 19 3.7 Functions and libraries . 19 4 LME Tutorial 21 4.1 Simple operations . 21 4.2 Complex Numbers . 22 4.3 Vectors and Matrices . 24 4.4 Polynomials . 27 4.5 Strings . 28 4.6 Variables . 28 4.7 Loops and Conditional Execution . 29 4.8 Functions . 29 4.9 Local and Global Variables . 32 5 LaTeX Package Reference 35 5.1 Package options . 35 5.2 Other packages . 37 5.3 Commands . 37 5.4 Environment . 39 4 Sysquake for LaTeX 6 LME Reference 41 6.1 Program format . 41 6.2 Function Call . 43 6.3 Named input arguments . 43 6.4 Command syntax . 44 6.5 Libraries . 44 6.6 Types . 45 6.7 Input and Output . 55 6.8 Error Messages . 56 6.9 Character Set . 61 6.10 Formatted text . 62 6.11 List of Commands, Functions, and Operators . 68 6.12 Variable Assignment and Subscripting . 79 6.13 Programming Constructs . 87 6.14 Miscellaneous Functions . 104 6.15 Sandbox Function . 135 6.16 Operators . 137 6.17 Mathematical Functions . 170 6.18 Linear Algebra . 233 6.19 Array Functions . 284 6.20 Triangulation Functions . 326 6.21 Integer Functions . 333 6.22 Non-Linear Numerical Functions . 337 6.23 String Functions . 360 6.24 Quaternions . 389 6.25 List Functions . 399 6.26 Structure Functions . 404 6.27 Object Functions . 412 6.28 Logical Functions . 417 6.29 Dynamical System Functions . 429 6.30 Input/Output Functions . 439 6.31 File System Functions . 456 6.32 Path Manipulation Functions . 458 6.33 XML Functions . 461 6.34 Time Functions . 469 6.35 Date Functions . 472 6.36 MAT-files . 474 6.37 Shell . 476 6.38 Graphics . 482 6.39 Remarks on graphics . 483 6.40 Base Graphical Functions . 487 6.41 3D Graphics . 525 6.42 Graphical Functions for Dynamical Systems . 541 6.43 Sysquake for LaTeX Functions . 577 Contents 5 7 Libraries 581 7.1 stdlib . 582 7.2 stat . 594 7.3 probdist . 605 7.4 polynom . 611 7.5 ratio . 621 7.6 bitfield . 624 7.7 filter . 631 7.8 lti . 641 7.9 lti (graphics) . 675 7.10 sigenc . 683 7.11 wav . 689 7.12 date . 691 7.13 constants . 694 7.14 colormaps . 695 7.15 polyhedra . 704 7.16 solids . 709 Index 717 Chapter 1 Introduction LaTeX is a typesetting environment for generating high-quality docu- ments, for reading on-screen (typically as PDF) or for printing. Devel- oped by Leslie Lamport with the support of many other contributors and the American Mathematics Society (AMS), LaTeX is extremely pop- ular for scientific publications. LaTeX is a set of macros for TeX. From TeX, it inherits the high quality of text layout and equation formatting, and implementations on most computer platforms; it adds facilities for sections, page layout, table of contents, index, etc. Like TeX, LaTeX takes as input a text file which contains the text to typeset and commands introduced with an escape character. To create a document, the author typically writes this file in a text editor, processes it with latex (a command-line tool), displays the result in a viewer, and continues with more iterations until a satisfactory result is obtained. Numerical results and graphics come usually from other applications such as Sysquake. Sysquake for LaTeX is a LaTeX package and a command tool which let you embed Sysquake commands directly in LaTeX source files. With it, no need to copy and format numerical results or generate EPS file by hand; the package takes care of cumbersome tasks, letting you focus on the creative work. Sysquake for LaTeX uses the same language and libraries as Sysquake and other products of Calerga. Chapter 2 Installing Sysquake for LaTeX Installing Sysquake for LaTeX consists in three steps: – Copy all Sysquake for LaTeX files to your hard disk. The default location is /opt/SysquakeLx on unix systems, and C: Program Files SysquakeForLaTeX on Windows. n n – Update environment variables so that sysquakelatextool is found by the operating system and finds library files. This consists in adding the path of the directory containing sysquakelatextool to PATH, and setting a new environment variable SYSQUAKELXPATH to the semicolon-separated list of paths to library directories. – Make your TeX distribution able to load the sysquake.sty pack- age. In TDS-based distributions (TeX Live, teTex, MiKTeX, etc.), this means adding the path of TexFiles to the list of TDS roots. LaTeX must also be able to execute external programs with write18. Depending on the platform, this may require to add an optionn argu- ment to pdflatex, such as -shell-escape or -enable-write18. Caution: enabling external programs can be dangerous if you typeset tex files from dubious origin. Depending on your needs, you may prefer a separate configuration to typeset tex files which use Sysquake for LaTeX, keeping the standard, more secure configuration for other files. Sysquake for LaTeX should be used only with tex files you trust. 10 Sysquake for LaTeX 2.1 Windows MiKTeX Install the latest release of MiKTeX (e.g. MiKTeX 2.9.6161). Then run the installer of Sysquake for LaTeX and follow the instructions. The last steps, as explained in the installer, are manual: – Make your TeX distribution aware of Sysquake for LaTeX. You should add a new root directory to the list of TDS directories. In the Start menu, submenu MiKTeX 2.9 (or equivalent), MiKTeX Settings (or MiKTeX Settings (Admin)) and select the Roots tab. Click the Add button, select directory TexFiles of Sysquake for LaTeX, and confirm, clicking the main OK button of the MiKTeX Options window. – Configure your LaTeX editor to run pdflatex.exe with the argument -shell-escape. In TeXworks, for instance, in menu Edit>Preferences, Typesetting tab, double-click pdfLaTeX+MakeIndex+BibTeX in the Processing tool list, click the "+" button, type -tex-option=-shell-escape, then click the up arrow button to move the new option before $fullname$. TeX Live Install the latest release of TeX Live (e.g. TeX Live 2016), then run Sysquake for LaTeX installer and follow the instructions. The last steps are manual: – Make sure sysquakelatextool.exe is in the search path. Open the Command Prompt application (e.g. by entering cmd in menu Start>Run), and type sysquakelatextool. You should read a few lines beginning with a percent. If you get an error message instead (e.g. ’sysquakelatextool’ is not recognized...), you should add its path to the PATH environment variable. Select menu Start>Control Panel, then System, Advanced tab, Environment Variables button, double-click the User.