1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>TeXstudio : user manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css"><!--
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
.command { font-family: monospace; }
.scripting_help th {padding-top: 4em}
--></style>
</head>
<body>
<h1 align=center><A NAME="top">TeXstudio : User manual</a></h1>
<h2><a name="sommaire">Contents </a>:</h2>
<ul>
<li><a href="#SECTIONNEW">0. What's new</a></li>
<ul>
<li><a href="#SECTIONNEW19">0.1 Version 1.8.1 -> Version 1.9</a></li>
<li><a href="#SECTIONNEW199">0.2 Version 1.9.3 -> Version 1.9.9</a></li>
<li><a href="#SECTIONNEW199a">0.3 Version 1.9.9 -> Version 1.9.9a</a></li>
<li><a href="#SECTIONNEW20">0.4 Version 1.9.9a -> Version 2.0</a></li>
<li><a href="#SECTIONNEW201">0.5 Version 2.0 -> Version 2.1</a></li>
<li><a href="#SECTIONNEW22">0.6 Version 2.1 -> Version 2.2</a></li>
<li><a href="#SECTIONNEW23">0.7 Version 2.2 -> Version 2.3</a></li>
</ul>
<li><a href="#SECTION0">1. Configuring TeXstudio</a></li>
<ul>
<li><a href="#SECTION01">1.1 Configuring the editor</a></li>
<li><a href="#SECTION02">1.2 Configuring the latex related commands</a></li>
<li><a href="#SECTION030">1.3 Configuring some general issues</a></li>
<li><a href="#SECTION03">1.3.1 Configuring the spell checker</a></li>
<li><a href="#SECTION04">1.3.2 Configuring the thesaurus</a></li>
<li><a href="#SECTION041">1.3.3 Configuring the latex syntax checker</a></li>
<li><a href="#SECTION040">1.4 Configuring the autocompletion</a></li>
<li><a href="#SECTION05">1.5 Configuring shortcuts</a></li>
<li><a href="#SECTION06">1.6 Configuring the Latex/Math-Menu</a></li>
<li><a href="#SECTION07">1.7 Configuring the Custom Toolbar</a></li>
<li><a href="#SECTION08">1.8 Configuring SVN support</a></li>
</ul>
</ul>
<ul>
<li><a href="#SECTION1">2. Editing a TeX document</a></li>
<ul>
<li><a href="#SECTION11">2.1 Usual commands</a></li>
<li><a href="#SECTION12">2.2.1 Setting the preamble of a TeX document</a></li>
<li><a href="#SECTION12a">2.2.2 Using Templates to start a new document</a></li>
<li><a href="#SECTION13">2.3 Structure of a document</a></li>
<li><a href="#SECTION14">2.4 Browsing your document</a></li>
<li><a href="#SECTION15">2.5 Formatting your text</a></li>
<li><a href="#SECTION16">2.6 Spacings</a></li>
<li><a href="#SECTION17">2.7 Inserting a list</a></li>
<li><a href="#SECTION18">2.8 Inserting a table</a></li>
<li><a href="#SECTION18a">2.8.1 Manipulating a table</a></li>
<li><a href="#SECTION19">2.9 Inserting a "tabbing" environment</a></li>
<li><a href="#SECTION110">2.10 Inserting a picture</a></li>
<li><a href="#SECTION110a">2.10.1 Inserting a picture using a "wizard"</a></li>
<li><a href="#SECTION111">2.11 Cross References and notes</a></li>
<li><a href="#SECTION112">2.12 Inserting math formulae</a></li>
<li><a href="#SECTION113">2.13 Auto completion</a></li>
<li><a href="#SECTION114">2.14 Thesaurus</a></li>
<li><a href="#SECTION115">2.15 Special Commands</a></li>
</ul>
</ul>
<ul>
<li><a href="#SECTION2">3. Compiling a document</a></li>
<ul>
<li><a href="#SECTION22">3.1 Compiling</a></li>
<li><a href="#SECTION23">3.2 The log files</a></li>
</ul>
</ul>
<ul>
<li><a href="#SECTION3">4. Other features</a></li>
<ul>
<li><a href="#SECTION31">4.1 About documents separated in several files</a></li>
<li><a href="#SECTION32a">4.2 Syntax Check</a></li>
<li><a href="#SECTION32">4.3 Bibliography</a></li>
<li><a href="#SECTION33a">4.4 SVN Support</a></li>
<li><a href="#SECTION33">4.5 Personal tags and tools</a></li>
<li><a href="#SECTION34">4.6 Pstricks support</a></li>
<li><a href="#SECTION35">4.7 Metapost support</a></li>
<li><a href="#SECTION36">4.8 The "Convert to Html" command</a></li>
<li><a href="#SECTION37">4.9 "Forward/Inverse search" with TeXstudio</a></li>
<li><a href="#SECTION38">4.10 Synopsis of the TeXstudio command</a></li>
<li><a href="#SECTION39">4.11 Keyboard shortcuts</a></li>
<li><a href="#CWLDESCRIPTION">4.12 Description of the cwl format</a></li>
</ul>
</ul>
<hr>
<h1><a name="SECTIONNEW">0. What's new</a></h1>
<h2><a name="SECTIONNEW19">0.1 Version 1.8.1 -> Version 1.9</a></h2>
<P>TeXstudio has been diligently extended for the last months. The
subsequent list gives a probably incomplete overview of new and
changed functionality:</P>
<ul>
<LI><P>First steps for dynamic syntax highlighting have been
implemented. For example references in in commands like \label or
\ref are checked and are marked especially if the reference does not
exist (in case of referencing) or if it has been defined multiple
times.</P>
<LI><P>The word completion system has been extended. It now uses
“kile”-word lists which extend the number of known
commands considerably. The key Tab can be used to complete common word bases in the present suggestion list like it is done in bash shells.
Furthermore it can also complete normal text
by proposing earlier used text parts. The two modes are
distinguished by a backslash as starting letter. And finally “User
Tags” (user defined text blocks) can be inserted by using
user defined abbreviations which replaced in the completion process.
The old behavior of using key sequences for inserting user tags
certainly is still available. And lastly user defined latex commands
are automatically scanned and can be used for command completion.</P>
<LI><P>Apart from using wizards, new documents can be created by
using templates. User can add own templates which can be edited or
removed later on if necessary.</P>
<LI><P>The symbol panel was extended. It was also extended by “kile”
symbol list. It also can insert “tags” from textual
lists. And finally the column count automatically adapts to the
available horizontal space. Not to mention that unwanted symbol
lists can be hidden.</P>
<LI><P>The symbol list selector was moved to the left edge to give
more room for the symbols, like it was done in texmaker.</P>
<LI><P>Hover help was implemented. Hovering the cursor over standard
latex commands will present tool tip help. If it is hovers over
references, the corresponding text passage which contains the label
is shown as tool tip.</P>
<LI><P>A preview for selected text can be shown either in the status
panel or as tool tip.</P>
<LI><P>The status/log/error panel can also be used in a tabbed
manner if desired.</P>
<LI><P>The online spell checker handles escaped chars like “a
or \”{a} now correctly. It also refrain from spell checking in
(some) latex command options like \ref{label} and some more.</P>
<LI><P>The context menu of the structure view gives some useful
option like selecting a complete section or indenting a section
which means changing \section to \subsection and accordingly all
included headings as well.</P>
<li><p>A thesaurus was added. It allows search for word parts as well.</p>
<LI><P>For sure, lots of bugs have been squashed !</P>
</ul>
<h2><a name="SECTIONNEW199">0.2 Version 1.9.3 -> Version 1.9.9</a></h2>
<ul>
<LI><p>User Tags can use java script to manipulate the current document. The manipulation is done via direct cursor handling. If further functionality is needed, feel free to open a feature request.</p>
<li><p>some performance issues on mac have been addressed. Still not perfect, but it should feel much faster on mac.</p>
<li><p>math constructs can be previewed with mouse hover over the expression limit ($, begin{equation},...)</p>
<li><p>a customizable tool bar is available</p>
<li><p>the latex expressions in the Math/Latex-Menus can be changed to user preferred versions.</p>
<li><p>global find over all open documents improved</p>
<li><p>support of transparent versioning of text documents via svn</p>
<li><p>structure view and custom command completer are updated as you type</p>
<li><p>the structure view marks some aspects with colours like being part of the appendix or missing include files</p>
<li><p>if a master document is defined, references and labels from open (!) subdocuments can be used for completion as well as for interactive label checking</p>
<li><p>dde commands can be modified to start a corresponding program if it is not running</p>
<li><p>if a started latex freezes up, you can kill it by pressing escape after 2 seconds</p>
<li><p>the folding is now actually useful: mismatched brackets will not disturb it anymore and folded blocks can be edited</p>
<li><p>lots of bugs removed after user feedback</p>
</ul>
<h2><a name="SECTIONNEW199a">0.3 Version 1.9.9 -> Version 1.9.9a</a></h2>
<ul>
<li><p>some performance issues on mac have been adressed. It should feel faster for long sible lines on mac.</p>
<li><p>more than one overlay can be shown at the same time e.g. for syntax highlighting and spell checking</p>
<li><p>command replacement in completed commands was added</p>
<li><p>a cut buffer was added. If selected text is replaced with a command via completion, the removed text is used as argument for the inserted command (if applicable)</p>
<li><p>tool tip in completer shows the surrounding of the label to which the selected reference is pointing</p>
<li><p>profiles containing predefined short cuts, menu redefinition, editor settings can be imported from a file</p>
<li><p>when waiting with text cursor on an environment name, a mirror cursor is generated which allows the renaming of the environment (\begin and \end simultaneously)</p>
<li><p>delete word, a command or an environment by typing ALT-del</p>
<li><p>spell checking is only done in known text commands</p>
<li><p>some dialogs adapted to cope better with small screen sizes</p>
<li><p>lots of bugs removed after user feedback</p>
</ul>
<h2><a name="SECTIONNEW20">0.4 Version 1.9.9a -> Version 2.0</a></h2>
<ul>
<li><p>integrated pdf viewer with forward/reverse search</p>
<li><p>online latex syntax check (for simple errors)</p>
<li><p>support to manipulate tables (add/remove lines,columns or \hline)</p>
<li><p>inserted brackets are automatically closed</p>
<li><p>option to limit line length with hard wraps</p>
<li><p>word repetitions are marked as possible style error</p>
<li><p>as always, bug fixes and small improvements</p>
</ul>
<h2><a name="SECTIONNEW201">0.5 Version 2.0 -> Version 2.1</a></h2>
<ul>
<li><p>online latex syntax check has been extended
<ul>
<li><p>number of columns is checked in tabulars</p>
<li><p>\usepackage and \documentclass are interpreted to decide which commands are valid in the document</p>
<li><p>new commands added</p></li>
</ul>
</p>
<li><p>TXS automatically detects parent/child relation in loaded documents and acts accordingly. So normally no master mode is needed anymore.</p>
<li><p>improved preview:
<ul><li><p>Pdf viewer can show multiple pages</li>
<li><p>Pdf viewer supports a presentation mode and multiple views</li>
<li><p>Pdf viewer has a new overview and clock dock</p></li>
<li><p>Selection preview become faster and is shown within the text</li>
</ul></p>
</li>
<li>easy parenthesis selection</li>
<li><p>as always, bug fixes and small improvements</p>
</ul>
<h2><a name="SECTIONNEW22">0.6 Version 2.1 -> Version 2.2</a></h2>
<ul>
<li><p>improved preview:
<ul><li><p>Pdf viewer can show multiple pages in continous fashion</li>
<li><p>Pdf viewer works non-blocking (multi-threaded)</li>
<li><p>preview works with included files</p></li>
</ul></p>
</li>
<li><p>key replacements can trigger arbitrary user macros</p></li>
<li><p>double quote replacement can easily be selected from predefined list</p></li>
<li><p>completer distinguishes between usual, most often used and all possible commands</p></li>
<li><p>saving/loading profiles working
<li><p>more environments are syntax highlighted</p></li>
<li><p>as always, bug fixes and small improvements</p></li>
</ul>
<h2><a name="SECTIONNEW23">0.7 Version 2.2 -> Version 2.3</a></h2>
<ul>
<li><p>list of commands accepting \ref/\cite-references can be changed</p></li>
<li><p>remember search history</p></li>
<li><p>support for different dictionaries per document</p></li>
<li><p>find-invalid-bracket feature</p></li>
<li><p>almost word level inverse pdf search</p></li>
<li><p>complete file names in graphic including macros</p></li>
<li><p>improved BibTeX auto calling</p></li>
<li><p>more methods available for scripting </p></li>
<li><p>several bug fix (especially crashs in the pdf viewer/syntax check/structure view) and minor improvements</p></li>
</ul>
<h1><a name="SECTION0">1. Configuring TeXstudio</a></h1>
Before using TeXstudio, you should configure the editor and latex related commands via the "Configure TeXstudio" command in the "Options" menu ("Preferences" under macosx).
<h2><a name="SECTION01">1.1 Configuring the editor</a></h2>
<p>
You can should set the default encoding for new files ("Configure TeXstudio" -> "Editor" -> "Editor Font Encoding") if you don't want utf8 as encoding. Don't forget to set the same encoding in the preamble of your documents. (e.g. \usepackage[utf8]{inputenc}, if you use utf-8).<br>
TeXstudio can auto detect utf-8 and latin1 encoded files, but if you use a different encoding in your existing documents you have to specify it in the configuration dialog before opening them. (and then you also have to disable the auto detection)
</p>
<p>
<ul>
<li>"Show Line State Change" sets yellow markers left to the text to show which lines have been changed and are still unsaved. That marker turns grreen if they are saved.
<li>"Show modify time" prints the time since the last key stroke in the status panel.
<li>The selection box "Keep indentation" let you select, wether indented lines are followed by lines of the same indentation after pressing Enter or letting TeXstudio do automatic indentation.
</ul>
</p>
<p><IMG src="configure_editor.png" border="1"></p>
<h2><a name="SECTION02">1.2 Configuring the latex related commands</a></h2>
<p>TeXstudio can't compile yours documents if the paths to the LaTeX related commands are wrong.<br>
The default settings should work with the recent and standard LaTeX distributions, but you could have to modify them ("Configure TeXstudio" -> "Commands"). To change a command, just click on the button at the end of the corresponding line and select the command in the file browser : TeXstudio will adapt automatically the syntax of the command.<br>
The <strong>%</strong> character represents the name of the file without the extension and the <strong>@</strong> character will be replaced by the current line number. If you need more options (e.g. absolute paths) use ? and look at the instruction on the bottom of the configuration dialog. <br>
Section <a href="#SECTION37">Forward/Inverse search</a> gives some example commands for common viewers.
</p>
<p><IMG src="doc14.png" border="1"></p>
<h2><a name="SECTION030">1.3 Configuring some general issues</a></h2>
This panel allows the setting of some general aspects.
<ul>
<li>The "style" and "color scheme" of TeXstudio can be selected. The modern variant is closer to texmaker 1.9.
<li>The symbol list can either appear "tabbed" (old behaviour, tabbed activated) or can have small symbol tabs besides the symbol lists which leaves more room for the symbols.
<li>Also the log viewer can appear tabbed which allows faster change between error table, log view and previewer ...
<li>The language of the menus can be changed directly to ignore system settings.
</ul>
<p><IMG src="configure_general.png" border="1"></p>
<h2><a name="SECTION03">1.3.1 Configuring the spell checker</a></h2>
<p>
TeXstudio checks the spelling while you type. If the typed text is within a LaTeX-command, TeXstudio takes information from the command-completion-list to determine whether the text is natural language which needs to be checked or just command options which are left alone. Only known LaTeX-commands are considered to be checked in its options!
Therefore make sure that all used packages are activated in the option/completion menu, see the corresponding <a href="#SECTION040">section</a> <br>
The spell checker uses the OpenOffice.org dictionaries. Only GPL French and British dictionaries are distributed with TeXstudio.<br>
Users can download others dictionaries here : <A href="http://wiki.services.openoffice.org/wiki/Dictionaries" target="_blank">http://wiki.services.openoffice.org/wiki/Dictionaries</A><br>
To configure the spell checker : "Configure TeXstudio" -> "Editor" -> "Spelling dictionary" -> click on the button at the end of the line to select the dictionary with the file browser. If you specify a non existing file the edit gets red.<br>
Warning : spell checking with Ctrl+Shift+F7 starts at the cursor position and not at the beginning of the document.<br><br>
If the interactive spell checker is enabled (default), any wrong spelled word is underlined with a red wave. Click on it with the right mouse to open an menu with a list of possible corrections. There you can also move it to the ignore list. If your dictionary is very large (> 5MB), opening the context menu and showing possible suggestions can take some seconds. If you don't need the suggestion, you can press shift while right clicking and don't have to wait.<br><br>
The ignore list is normally saved in the same directory as the dictionary with the extension .ign. If this isn't possible (e.g. missing access) the list is stored in the user configuration directory.
</p>
<h2><a name="SECTION04">1.3.2 Configuring the thesaurus</a></h2>
<p>
The thesaurus uses OpenOffice.org 2.x databases. Only GPL French and US-English and German databases are distributed with TeXstudio.<br>
Users can download others databases here : <A href="http://wiki.services.openoffice.org/wiki/Dictionaries" target="_blank">http://wiki.services.openoffice.org/wiki/Dictionaries</A><br>
</p>
<h2><a name="SECTION041">1.3.3 Configuring latex syntax checker</a></h2>
The latex syntax checker takes the list of possible completion commands to determine if a command is correct.
Furthermore the completion list contains partially additional information to determine in which context a command is valid, whether it is valid only in math-mode or only in tabular-mode.<br>
<h2><a name="SECTION040">1.4 Configuring the autocompletion</a></h2>
<p>
TeXstudio has taken up completion word list from kile which extended the number of known commands for completion considerably.
TeXstudio understands the use of \documentclass and \usepackage in order to select valid lists of commands for completion as well as syntax checking.
However TeXstudio allows to select the additional word lists under
"Configure TeXstudio" -> "Editor" -> "". The names of the word lists corresponds to the package for which they are made. The list latex.cwl contains the standard latex commands. <br>
Concerning auto completion, TeXstudio allows to adapt the behaviour to your liking.
Following options are available:
<ul>
<li>Completion enabled: self explanatory
<li>Case sensitive: let's you complete e.g. \Large from \la ...
<li>in first character: ?
<li>Auto Complete Common Prefix: if only one item is in the list or all items in the completion list share common starting characters, the common characters are directly inserted, like pressing the key Tab.
<li>Complete selected text when non-word character is pressed: when in completion mode, pressing a non-word character like space, leads to accepting the selected word. This may speed up typing.
<li>Enable ToolTip-Help: show tool tips on selected latex commands in the completion list.
<li>Use Placeholders: if the completed commands have options which need to be filled out, "place holder" are put at this positions and they can be jumped to by using Ctrl+Right/Ctrl+Left.
</ul>
If your favorite package is not yet present for completion (and then as well not for syntax check), you can provide a list of your own by placing a file "packagename.cwl" in the config directory. This directory is placed in ~/.config/benibela under linux and usually "c:\Documents and Settings/User/AppData/Roaming/benibela" under windows. Basically the file contains a list of valid commands. A Description of the exact format and an example are given in the <a href="#CWLDESCRIPTION">appendix</a>.
</p>
<p><IMG src="configure_completion.png" border="1"></p>
<h2><a name="SECTION05">1.5 Configuring shortcuts</a></h2>
<p>
Shortcuts can be changed by double clicking on "Current Shortcut" or "Additional Shortcut".
A shortcut can be selected from the drop down list or put in as text directly.
If a shortcut should be set to default value or removed completely, the items "<default>" or "<none>" at the top of the list can be selected.
</p>
<p><IMG src="configure_shortcuts.png" border="1"></p>
<h2><a name="SECTION06">1.6 Configuring the Latex/Math-Menu</a></h2>
<p>The Math/Latex-Menu can be adapted to user likings.
For this menu items can be renamed and a new Latex-Code can be placed. The apropriate item can be be directly edited by doubleclicking on them.
</p>
<p><IMG src="configure_customizeMenu.png" border="1"></p>
<h2><a name="SECTION07">1.7 Configuring the Custom Toolbar</a></h2>
<p>One Custom Toolbar is present in TMX. This toolbar can be filled with actions from the Latex-, Math- and User-Menu.
Since many of those item don't have icons, user icons can be loaded as well. This is achieved by applying "load other icon" from the context menu on a item in the custom toolbar list in the configure dialog.
</p>
<p><IMG src="configure_customToolbar.png" border="1"></p>
<h2><a name="SECTION08">1.8 Configuring SVN support</a></h2>
<p>To provide documenten versioning, TeXstudio makes use of SVN (subversion). To make use of it, the SVN commandline tools need to be installed.
Linux and Mac OSX normally provide already svn tools, for Windows, the installation of "SlikSVN" is recommended.
</p>
<p>
The complete path to the command "svn" and "svnadmin" need to be adjusted in the aprioriate field of the svn configure page, see below.
Furthermore the user can choose the degree of automation, which TeXstudio provides.
</p>
<p>
"Automatically check in after save" allows TeXstudio to perform an svn check in after every save of a document, thus providing a very complete history of the creation of a document.
Since text documents are rather small compared to disk spaces, size of the svn database should not be a problem.
In addition newly saved files (save as) are automatically added to svn control,provided that the directory is alredy under svn control.
If that is not the case, TeXstudio searches in "SVN Directory Search Depth" directory above the current diorectory for a svn controlled directory to which the subdirectories and the TeX-Document will be added.
If no appropriate directory is found, a repository is automatically generated in a directory called "./repo" and the document is added.
Thus the user does not need to look up the necessary commands to set up a repository. This functionality is only activated when "Auto checkin in" is enabled !
</p>
<p>
With "User SVN revisions to undo before last save" TeXstudio will perform undo as usually, but if there are no further undoable commands in the internal storage, the document will be changed to the previous version in svn history.
Further undo commands allows to back further to older revisions, whereas a redo goes forward to more recent versions.
This is a more interactive approach than choosing svn revisions directly via a menu command, see <a href="#SECTION33a">section 4.3</a>
</p>
<p><IMG src="configure_svn.png" border="1"></p>
<h1><a name="SECTION1">2. Editing a TeX document</a></h1>
<h2><a name="SECTION11">2.1 Usual commands</a></h2>
<p>The standard commands (cut, copy, find...) can be launched via the "Edit" menu and the "Edit" tool bar.</p>
<p><IMG src="doc1.png" border="1"></p>
<h2><a name="SECTION12">2.2.1 Setting the preamble of a TeX document</a></h2>
<p>To define the preamble of your document, you can use the "Quick start" wizard ("Wizard" menu).</p>
<p><IMG src="doc2.png" border="1"></p>
<p>This dialog allows you to set the main features of your document (class, paper size, encoding...).<br>Note : You can add other options by clicking the "+" buttons. All yours settings are recorded.</p>
<p>You can also type your own preamble model in the editor : with the "Copy/paste" or "Save As" commands, you can use it for a new document.</p>
<h2><a name="SECTION12a">2.2.2 Using Templates to start a new document</a></h2>
For new documents, templates can be used by using the command "File/New from template".
A dialogue gives a selection of templates.
<p><IMG src="template.png" border="1"></p>
New templates can be added by using the command "File/Make Template" on a opened document which you like to have has a template.
User added templates can be edited or deleted by using the context menu in the template selection dialogue.
Built-in templates can not be changed.
<h2><a name="SECTION13">2.3 Structure of a document</a></h2>
<p>To define a new part (section,subsection...) in your document with TeXstudio, just use this combo box in the tool bar :</p>
<p><IMG src="doc3.png" border="1"></p>
<p>This will cause a dialog to pop up which allows you to define the style of the part (section,subsection...).<br>Note : the "Structure View" is automatically updated.</p>
<p><IMG src="doc4.png" border="1"></p>
<h2><a name="SECTION14">2.4 Browsing your document</a></h2>
<p>The "Structure View" (left panel) lets you quickly reach any part of your document. All you need to do is to click on any item (label, section...) and you will be taken to the beginning of the corresponding area in the editor. The mechanism for jumping to a line does not anymore only consider line numbers but really remembers text lines. Thus adding and removing lines will not lead to jumps to wrong locations.</p>
<p>A grey background shows the present cursor position in the text in the structure view as well. A greenish background denotes sections which are in the appendix.</p>
<p><IMG src="doc5.png" border="1"></p>
<p>The "Structure View" is automatically updated as you type. You can also use the "Refresh Structure" ("Edit" menu) command at any moment.</p>
<p>Apart from labels,sections,includes and beamer blocks, comments starting with %TODO are also scanned for and presented as section of its own in the structure view.
This can be used to create a kind of permanent bookmark in the text or just to note where some changes are still necessary.
</p>
<p>
The structure view also offers a context menu which allows to copy/cut all text which belongs to a section (including subsection) and paste it before or after a section.
Section can be indented/unindented which means that the hierarchy level is changed by one, i.e. \section is changed to \subsection, and all subsections are treated accordingly
</p>
<p>For each file, three bookmarks can be used to speed up navigation : just click on a line number to add or remove a bookmark. When you have already defined three bookmarks, you must remove one of them to add a new bookmark. To jump to the line corresponding to a bookmark in the editor, just click on the buttons in the status bar.</p>
<p><IMG src="doc20.png" border="1"></p>
<h2><a name="SECTION15">2.5 Formatting your text</a></h2>
<p>You can quickly set the format of a part of your text with this tool bar :</p>
<p><IMG src="doc6.png" border="1"></p>
<p><b>Additional option:</b> a selected text can be directly framed by certain environments. Example: while clicking on the button "Bold" after having selected the word "Hello" , you will obtain the code: \textbf{Hello}.<br>This option is available for all the environments indicated by "[selection]" in the "LaTeX" menu.</p>
<h2><a name="SECTION16">2.6 Spacings</a></h2>
<p>The usual "spacing" commands are available in the "LaTeX" and "Math" menus. To insert quickly the "new line" LaTeX command, you can use the corresponding command in the toolbar (shortcut : Ctrl+Alt+return) </p>
<h2><a name="SECTION17">2.7 Inserting a list</a></h2>
<p>The usual list environments code can be insert quickly via the "LaTeX-List" menu.<br>Note : the shortcut for the \item command is Ctrl+Alt+H.</p>
<h2><a name="SECTION18">2.8 Inserting a table</a></h2>
<p>With the "Tabular" wizard ("Wizard" menu), the LaTeX code for a tabular environment can be quickly inserted :</p>
<p><IMG src="doc7.png" border="1"></p>
<p>You can set the main features of your table.<br>Note : this dialog allows you to type directly the code in the cells.<br>The corresponding LaTeX code is automatically inserted in the editor.</p>
<h2><a name="SECTION18a">2.8.1 Manipulating tables</a></h2>
TeXstudio provides some commands to ease handling of tables. For this a toolbar "tables" is offered which gives easy access to these commands.
Please be aware that some unexpected results may arise, if the table constructing commands get to complex.
Following commands are offered:
<ul>
<li>add row after the current row</li>
<li>remove row: removes the table row in which the cursor </li>
<li>add column: add a column in the complete table after current cursor position. If the cursor is positioned at start of line,first column, the column is added as new first column.</li>
<li>remove column: remove current column</li>
<li>add/remove \hline: add/remove \hline in all rows following the current row. If already a command \hline is present, no second command is placed.</li>
</ul>
<h2><a name="SECTION19">2.9 Inserting a "tabbing" environment</a></h2>
<p>To help you to insert a "tabbing" code, you can use the "Tabbing" wizard ("Wizard" menu) :</p>
<p><IMG src="doc8.png" border="1"></p>
<h2><a name="SECTION110">2.10 Inserting a picture</a></h2>
<p>To insert a picture in your document, just use the "\includegraphics" command in the "LaTeX" menu. Then, click on the "browser" button in the dialog to select the graphic file.<br>Note : you can insert a "figure" LaTeX environment ("LaTeX - Environments" menu) before inserting the picture.</p>
<p><IMG src="doc9.png" border="1"></p>
<h2><a name="SECTION110a">2.10.1 Inserting a picture using a "wizard"</a></h2>
<p>TeXstudio offers a wizard for picture insertion in your document. Apart from selecting a file, you can also have TeXstudio include an appropriate figure-environment with label and caption correctly set.</p>
<p><IMG src="wizard_figure.png" border="1"></p>
<h2><a name="SECTION111">2.11 Cross References and notes</a></h2>
<p>This toolbox in the toolbar allows you to insert quickly the label, cite, ref, footnote... code.<br>Note : the labels used in your documents are displayed in the "Structure View".</p>
<p><IMG src="doc10.png" border="1"></p>
<p><b>Additional option:</b>for the \ref command, a dialog box allows you to select directly the label.</p>
<h2><a name="SECTION112">2.12 Inserting math formula</a></h2>
<p>You can toggle in the "in-line math" environment with the "f(x)" button in the toolbar (shortcut : Ctrl+Alt+M) or with the "Math" menu. The shortcut for the "display math" environment is : Alt+Shift+M.<br> The "Math" toolbar allows you to insert the most currents mathematical forms (frac, sqrt...) like the \left and \right tags.</p>
<p><IMG src="doc11.png" border="1"></p>
<p>With the "symbols panels" in the structure view, you can insert the code of 400 mathematical symbols.</p>
<p><IMG src="doc12.png" border="1"></p>
<p>You can also define the format of your mathematical text via the "Math" menu.<br>For the "array" environments, a wizard (like the "Tabular" wizard) is available in the "Wizard" menu. With this wizard, you can select the environment : array, matrix, pmatrix.... The cells can be directly completed.</p>
<p><IMG src="doc13.png" border="1"></p>
<h2><a name="SECTION113">2.13 Auto Completion</a></h2>
<p>Whenever you press \ followed by a letter, a list of possible LaTex tags is shown where you select the right one. If you write additional letters the list is filtered, so that only the tags starting with the already written text are shown.
If the list contains words which all start with the same letter combination, you can press Tab to complete all common letters. If only one element is present in the list, Tab selects this one to do the completion, like Enter. This behaviour is similar to tab completion in bash shells.
You can also press Ctrl+Space to open this list whenever you want.<br>
If a tag has different options, a short descriptive text is inserted into your text, telling you the meaning of each option. You can press Ctrl+Left, Ctrl+Right to select all positions.<br>
Furthermore normal text can be completed by starting to type a word and pressing Ctrl+Space. All apropriate words in the current document are used as possible suggestions.<br>
If a enviroment is to be inserted, typing in the beginning of the environment name and pressing Ctrl+Alt+Space gives suggestions for adequate enviroments which are inserted completely with \begin{env}..\end{env}<br>
And finally user tags can be assigned a abbreviation which can also be used with completion. Just type in the start of the abbreviation and start the completion with Ctrl+Space. The abbreviation should show up in the completion list, especially marked with “abbreviation (template)”.<br>
If you change a command by completing a new command, only the command name is substituted. The same is true for environments, where the environment is changed in the \begin- and \end-command.
</p>
<h2><a name="SECTION114">2.14 Thesaurus</a></h2>
TeXstudio has integrated a simple thesaurus. OpenOffice 2.x databases are used for this.
By placing the cursor on a word and activating the thesaurus (Ctrl+Shift+F8 or Edit/Thesaurus), it tries to find synonyms for this word. Please be patient if you start the thesaurus at first time since loading the database just occurs then and can take a few moments.
<p><IMG src="thesaurus.png" border="1"></p>
The first line to the left contains the word, for which a synonym is searched for.
The list below gives a list of word classes. The can be chosen to reduce the number of suggestions.
The column to the right contains the list of suggested synonyms.
A selected word from this list apears in the first line to the right as proposition for replacement of the text.
This word can be changed manually. It is also used to do further investigations for words and their synonyms which "start with" or "contain" that word. With "lookup" it can be directly used to look for a synonym for that word.
<h2><a name="SECTION115">2.15 Special Commands</a></h2>
<h3>Delete word/command/environment</h3>
With the shortcut Alt+Del, the word under the cursor is deleted.
If it is a command, the command is deleted including opening and closing braces.
E.g. "\textbf{text}" leave "text".
If it is an environment, the enclosing bengin/end are removed.
<h3>Rename environment</h3>
If you place the cursor on an environment name or the corresponding begin- or end-command, after a moment a mirror-cursor is activated on the environment name which allows synchronous change of the environment name in the begin- and end-command.
So if you want to change a "\begin{tabular}...\end{tabular}" construction to "\begin{tabularx}...\end{tabularx}", place the text cursor on "tabular", wait for a second and then, after the mirror-cursor appears, change "tabular" to "tabularx".
<h3>Cut Buffer</h3>
If you select something and then start to type in a command and complete it, the selection is put in as first argument.
E.g. you have a "text", select it and start typing "\textbf", command which is completed. The resulting text is "\textbf{text}"
<h1><a name="SECTION2">3. Compiling a document</a></h1>
<h2><a name="SECTION22">3.1 Compiling</a></h2>
<p>The easiest way to compile a document is to use the "Quick Build" command ("Quick" button - shortcut : F1). You can define the sequence of commands used by the "Quick Build" command via the "Configure TeXstudio" dialog.<br>You can also launch each command one by one (shortcuts : F2...F12 - see the "Tools" menu).<br> Note : the "Clean" command in the "Tools menu" allows you to erase the files (dvi, toc, aux...) generated by a LaTeX compilation (except the ps and pdf files).<br>
<b>Warning : all yours files must have an extension and you can't compile an "untitled" file or a file with a space in his name</b>.</p>
<h2><a name="SECTION23">3.2 The log files</a></h2>
<p>With the "Quick Build" command, the log file is automatically displayed in the "Messages / Log file" pannel. While clicking on a number in the "Line" column, the cursor is placed on the corresponding line in the editor and the error is displayed. <br>
Remark : a summary of the latex errors and warnings is displayed before the full log file.</p>
<p><IMG src="doc15.png" border="1"></p>
<p>The "Next Latex Error"and "Previous LaTeX Error" commands allow to get to the errors detected during compilation.</p>
<p>Lines with errors, warnings, bad boxes will be highlighted with red, yellow or blue background and you can jump between them using Ctrl+Up/Down. (Ctrl+Shift for errors only, Ctrl+Alt for warnings only, Alt+Shift for bad boxes only)<br>
A tool tip will show more details of the mistake if you jump to a line (it is also shown if you move the mouse over the mark left from the line numbers).</p>
<h1><a name="SECTION3">4. Other features</a></h1>
<h2><a name="SECTION31">4.1 About documents separated in several files</a></h2>
<p>TeXstudio allows you to work onto documents separated in several files.<br>
To include a TeX file into your document, just use the "\include{file}" command in the "LaTeX" menu. The file will appear in the "Structure View". With a click on his name, TeXstudio will open it.</p>
<p>TeXstudio now understands parent/child relations of loaded documents (1 level only !). Therefor, as in "master document mode", only the parent document is compiled if compilation is tarted while working on a child document. Likewise labels and usercommands are known in all corresponding documents.</p>
<p>You can still define your "master document" with the "Options" menu. All the commands of the "Tools" menu will apply only to this document even when working on the "children" documents (you can even close the "master" document).<br>
If a master document is set, labels and usercommands which are defined in any open document, can be used for completion in any open document. Thus you can insert easily a reference to a label which is defined in another subdocument, as long as that document is open in TeXstudio.
<br>Note : you can leave the "master" mode with the "Options" menu.</p>
<h2><a name="SECTION32a">4.2 Syntax Check</a></h2>
The latex syntax checker takes the list of possible completion commands to determine if a command is correct.
The completion list contains partially additional information to determine in which context a command is valid, whether it is valid only in math-mode or only in tabular-mode.<br>
Furthermore the correctness of tabulars is checked in a little more detail.
The number of columns is analyzed and checked in the subsequent rows. If more or less columns are given in a row, a warning maker is shown.<br>
<h2><a name="SECTION32">4.3 Bibliography</a></h2>
<p>For the "bib" files , the "Bibliography" menu enables you to directly insert the entries corresponding to the standard types of document.<br>Note: the optional fields can be automatically deleted with the "Clean" command of the "Bibliography" menu.</p>
<p><IMG src="doc16.png" border="1"></p>
<h2><a name="SECTION33a">4.4 SVN Support</a></h2>
<p>
Apart from the supported svn features already describes in section 1.8, TeXstudio supports two more commands.
</p>
<p>
"File/chekin" performs an explicit save and check in, with a input dialog which asks for an checkin in message which is stored in the svn history.
</p>
<p>
"File/Show old Revisions" pops up a dialog, which shows all alvailable revisions. A selection of an older revision leads to instatanious change of the current document to that older revision.
You can can select and copy old parts to transfer them to the most recent version of your document, by copying the parts and then going back to most recent version. If you start editing that document directly, the dialog is closed and the present text is your new
most recent version though yet unsaved.
</p>
<h2><a name="SECTION33">4.5 Personals tags and tools</a></h2>
<p>TeXstudio allows you to insert your own tags (shortcuts : Shift+F1...Shift+F10). These tags are defined with the "User - User Tags" menu.<br>Note : if the code of the menu is "%environment", TeXstudio will directly insert:<br>
\begin{environment }<br>
<br>
\end{environment }<br>
<br>
If you write %| somewhere the cursor will be placed at that place in the inserted text. (A second %| will select everything between them).<br>
Write %<something%> to mark it as descriptive text which can be selected by Ctrl+Left/Right.
<br>
The option %(<i>filefilter</i>%) will be replaced by a filename which is asked for in a file dialog. The file filter is the standard Qt-Filefilterformat.
For example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)", see also <a href="http://doc.trolltech.com/4.6/qfiledialog.html#getOpenFileName">Qt-Doc</a>
</p>
<p><IMG src="doc17.png" border="1"></p>
<p>
Instead of using code snippets, you can also make use of javascript.
To do so, put "%SCRIPT" in the first line. The following code will be interpreted as javascript.
The language is based on <a href="http://doc.trolltech.com/4.5/ecmascript.html">ECMAScript</a>.
To access the document these objects are introduced:
<ul>
<li>"editor" allows some top level operations like searching/save/load. in the current document</li>
<li>"cursor" gives access to cursor operations like moving, inserting and deleting texts.</li>
<li>"fileChooser" gives access to the filechooser dialog, a very simple file selection dialog</li>
<li>"app" to access application wide things like the clipboard or the menus</li>
</ul>
The following table gives an overview on the possible commands.
<table border="1" class="scripting_help">
<tr>
<td> <b>Command</b> </td>
<td> <b>Description</b> </td>
</tr>
<tr>
<th colspan=2>Global scope</th>
</tr>
<tr>
<td> alert(str), information(str), warning(str) or critical(str) </td>
<td> shows str in a messagebox with a certain icon</td>
</tr>
<tr>
<td> confirm(str) or confirmWarning(str)</td>
<td> shows str as a yes/no question in a messagebox </td>
</tr>
<tr>
<td> debug(str) </td>
<td> prints str to stdout </td>
</tr>
<tr><td> writeFile(name, value) </td> <td> Writes value to file name (requires write privileges) </td></tr>
<tr><td> readFile(name) </td> <td> Reads the entire file name (requires read privileges) </td></tr>
<tr><td> system(cmd) </td> <td> Calls cmd and returns a ProcessX object which has this methodes:
<ul>
<li>waitForFinished: Wait until the process is finished</li>
<li>readAllStandardOutputStr: Returns the stdout</li>
<li>readAllStandardErrorStr: Returns the stderr</li>
<li>exitCode: The exit code</li>
<li>exitStatus: The qt exit status</li>
<li>terminate or kill: Stops the process</li>
</ul> </td></tr>
<tr><td> setGlobal(name, value) </td> <td> Sets a temporary, global variable </td></tr>
<tr><td> getGlobal(name) </td> <td> Reads a global variable </td></tr>
<tr><td> hasGlobal(name) </td> <td> Checks for the existence of a global variable </td></tr>
<tr><td> setGlobal(name, value) </td> <td> Sets a global configuration variable. (can change the values of the ini file, requires write privileges) </td></tr>
<tr><td> getGlobal(name) </td> <td> Reads a global configuration variable. (can read all values of the ini file, requires read privileges) </td></tr>
<tr><td> hasGlobal(name) </td> <td> Checks if a global configuration variable exists. (requires read privileges) </td></tr>
<tr><td> hasReadPrivileges() </td> <td> Checks if the script has read privileges </td></tr>
<tr><td> hasWritePrivileges() </td> <td> Checks if the script has write privileges </td></tr>
<tr><th colspan=2>Editor object</th></tr>
<tr>
<td> editor.search(searchFor, [options], [scope], [callback]) </td>
<td> Searchs something in the editor.
<ul>
<li>searchFor is the text which is searched. It can be either a string (e.g. "..") or a regexp (e.g. /[.]{2}/). </li>
<li>options is a string and a combination of "i", "g", "w" to specify a case-<em>i</em>nsensitive search, a <em>g</em>lobal search (continue after the first match) or a whole-<em>w</em>ord-only search. </li>
<li>scope is a cursor constraining the search scope (see editor.document().cursor).</li>
<li>callback is a function which is called for every match. A cursor describing the position of the match is passed as first argument.</li>
</ul>
All arguments except searchFor are optional, and the order may be changed (which may not be future compatible). The function returns the number of found matches.
</td>
</tr>
<tr>
<td> editor.replace(searchFor, [options], [scope], [replaceWith]) </td>
<td> This function searches and replaces something in the editor. It behaves like editor.search apart from the replaceWith argument which can be a simple string or a callback function. If it is a function the return value of replaceWith is used to replace the match described by the cursor passed to replaceWith. </td>
</tr>
<tr>
<td> editor.undo();
<td>undo last command in editor
</tr>
<tr>
<td> editor.redo();
<td> redo last command in editor
</tr>
<tr>
<td> editor.cut();
<td> cut selection to clipboard
</tr>
<tr>
<td> editor.copy();
<td> copy selection to clipboard
</tr>
<tr>
<td> editor.paste();
<td> paste clipboard contents
</tr>
<tr>
<td> editor.selectAll();
<td> select all
</tr>
<tr>
<td> editor.selectNothing();
<td> select nothing (clear selections)
</tr>
<tr>
<td> editor.find();
<td> activate "find panel"
</tr>
<tr>
<td> editor.find(QString text, bool highlight, bool regex, bool word=false, bool caseSensitive=false);
<td> activate "find panel" with predefined values
</tr>
<tr>
<td> editor.find(QString text, bool highlight, bool regex, bool word, bool caseSensitive, bool fromCursor, bool selection);
<td> activate "find panel" with predefined values
</tr>
<tr>
<td> editor.findNext();
<td> find next
</tr>
<tr>
<td> editor.replacePanel();
<td> replace (if find panel open and something is selected)
<tr>
<td> editor.gotoLine();
<td> activate "goto line panel"
</tr>
<tr>
<td> editor.indentSelection();
<td> indent selection
</tr>
<tr>
<td> editor.unindentSelection();
<td> unindent selection
</tr>
<tr>
<td> editor.commentSelection();
<td> comment selection
</tr>
<tr>
<td> editor.uncommentSelection();
<td> uncomment selection
</tr>
<tr>
<td> editor.clearPlaceHolders();
<td> clear place holders
</tr>
<tr>
<td> editor.nextPlaceHolder();
<td> jump to next place holder
</tr>
<tr>
<td> editor.previousPlaceHolder()
<td> jump to previous place holder
</tr>
<tr>
<td> editor.setPlaceHolder(int i, bool selectCursors=true);
<td> set Placeholder
</tr>
<tr>
<td> editor.setFileName(f);
<td> set filename to <i>f</i>
</tr>
<tr>
<td> editor.write(str) </td>
<td> inserts str at the current cursors position (if there are cursor mirrors, str will be inserted by all of them) </td>
<tr>
<tr>
<td> editor.insertText(str) </td>
<td> inserts str at the current cursor position (cursor mirrors are ignored)</td>
<tr><!--
<tr>
<td> editor.insertText(cursor, str) </td>
<td> inserts str at the position of cursor </td>
<tr>-->
<tr>
<td> editor.setText(<i>text</i>) </td>
<td> replace the whole text of the current document by <i>text</i> </td>
</tr>
<tr>
<td> editor.text()
<td> return the text of the complete document
</tr>
<tr>
<td> editor.text(int line)
<td> return text of <i>line</i>
</tr>
<th colspan=2>Document object</th>
</tr>
<tr><td>editor.document().lineCount() </td><td> Returns the number of lines </td></tr>
<tr><td>editor.document().visualLineCount() </td><td> Returns the number of visual lines (counting wrapped lines) </td></tr>
<tr><td>editor.document().cursor(line, [column = 0], [lineTo = -1], [columnTo = length of lineTo]) </td><td> Returns a cursor object. If lineTo is given the cursor has a selection from line:column to lineTo:columnTo, otherwise not. </td></tr>
<tr><td>editor.document().text([removeTrailing = false], [preserveIndent = true]) </td><td> Returns the complete text of the document </td></tr>
<tr><td>editor.document().textLines() </td><td> Returns an array of all text lines </td></tr>
<tr><td>editor.document().lineEndingString() </td><td> Returns a string containing the ending of a line (\n or \n\r) </td></tr>
<tr><td>editor.document().canUndo() </td><td> Returns true if undo is possible </td></tr>
<tr><td>editor.document().canRedo() </td><td> Returns true if redo is possible </td></tr>
<tr><td>editor.document().expand(lineNr)</td><td> Expands the line </td></tr>
<tr><td>editor.document().collapse(lineNr)</td><td> Collapse the line </td></tr>
<tr><td>editor.document().expandParents(lineNr)</td><td> Expand all parents of the line until it is visible </td></tr>
<tr><td>editor.document().foldBlockAt(bool unFold, lineNr);</td><td> Collapses or expands the first block before lineNr </td></tr>
</tr>
<tr>
<th colspan=2>Cursor object</th>
</tr>
<tr>
<td> cursor.atEnd()
<td> returns whether the cursor is at the end of the document
</tr>
<tr>
<td> cursor.atStart()
<td> returns whether the cursor is at the start of the document
</tr>
<tr>
<td> cursor.atBlockEnd()
<td> returns whether the cursor is at the end of a block
</tr>
<tr>
<td> cursor.atBlockStart()
<td> returns whether the cursor is at the start of a block
</tr>
<tr>
<td> cursor.atLineEnd()
<td> returns whether the cursor is at the end of a line
</tr>
<tr>
<td> cursor.atLineStart()
<td> returns whether the cursor is at the start of a line
</tr>
<tr>
<td> cursor.hasSelection()
<td> return whether the cursor has a selection
</tr>
<tr>
<td> cursor.lineNumber()
<td> returns the line number of the cursor
</tr>
<tr>
<td> cursor.columnNumber()
<td> returns the column of the cursor
</tr>
<tr>
<td> cursor.anchorLineNumber()
<td> returns the line number of the anchor.
</tr>
<tr>
<td> cursor.anchorColumnNumber()
<td> returns the column of the anchor.
</tr>
<tr>
<td> cursor.shift(int offset)
<td>Shift cursor position (text column) by a number of columns (characters)
</tr>
<tr>
<td> cursor.setPosition(int pos, MoveMode m = MoveAnchor)
<td> set the cursor position after pos-characters counted from document start (very slow)
</tr>
<tr>
<td> cursor.movePosition(int offset, MoveOperation op = NextCharacter, MoveMode m = MoveAnchor);
<td> move cursor <i>offset</i> times. MoveOperations may be:
<ul>
<li>cursorEnums.NoMove
<li>cursorEnums.Up
<li>cursorEnums.Down
<li>cursorEnums.Left
<li>cursorEnums.PreviousCharacter = Left
<li>cursorEnums.Right
<li>cursorEnums.NextCharacter = Right
<li>cursorEnums.Start
<li>cursorEnums.StartOfLine
<li>cursorEnums.StartOfBlock = StartOfLine
<li>cursorEnums.StartOfWord
<li>cursorEnums.PreviousBlock
<li>cursorEnums.PreviousLine = PreviousBlock
<li>cursorEnums.PreviousWord
<li>cursorEnums.WordLeft
<li>cursorEnums.WordRight
<li>cursorEnums.End
<li>cursorEnums.EndOfLine
<li>cursorEnums.EndOfBlock = EndOfLine
<li>cursorEnums.EndOfWord
<li>cursorEnums.NextWord
<li>cursorEnums.NextBlock
<li>cursorEnums.NextLine = NextBlock
</ul>
Options for MoveMode are:
<ul>
<li>cursorEnums.MoveAnchor
<li>cursorEnums.KeepAnchor
<li>cursorEnums.ThroughWrap
</ul>
</tr>
<tr>
<td> cursor.moveTo(int line, int column);
<td> move cursor to <i>line</i> and <i>column</i>
</tr>
<tr>
<td> cursor.eraseLine();
<td> remove current line
</tr>
<tr>
<td> cursor.insertLine(bool keepAnchor = false);
<td> insert empty line
</tr>
<tr>
<td> cursor.insertText(text, bool keepAnchor = false)
<td> insert <i>text</i> text at cursor (this function will ignore indentations and mirrors, see editor.write and editor.insertText)
</tr>
<tr>
<td> cursor.selectedText()
<td>return the selected text
</tr>
<tr>
<td> cursor.clearSelection();
<td>clears selection
</tr>
<tr>
<td> cursor.removeSelectedText();
<td> removes selected text
</tr>
<tr>
<td> cursor.replaceSelectedText(text);
<td> replace selected text with <i>text</i>
</tr>
<tr>
<td> cursor.deleteChar();
<td> removes char right to the cursor
</tr>
<tr>
<td> cursor.deletePreviousChar();
<td> removes char left to the cursor
</tr>
<tr>
<td> cursor.beginEditBlock();
<td> begins a new edit block. All cursor operations encapsulated in an edit block are undone/redone at once.
</tr>
<tr>
<td> cursor.endEditBlock();
<td> ends an edit block
</tr>
<tr><th colspan=2>App object</th></tr>
<tr><td>app.getVersion</td><td>Current version (0xMMmm00)</td>
<tr><td>app.clipboard</td><td>Property to read/write to the clipboard</td>
<tr><td>app.getCurrentFileName()</td><td>File name of currently edited file</td>
<tr><td>app.getAbsoluteFilePath(rel, ext = "")</td><td>Converts a relative filename to an absolute one</td>
<tr><td>app.load(file)</td><td>Loads an file </td>
<tr><td>app.fileOpen/Save/Close/.../editUndo/.../QuickBuild/... </td><td>All menu commands (i.e. all slots in the texmaker.h file)</td>
<tr><th colspan=2>FileChooser object</th></tr>
<tr>
<td> fileChooser.exec()
<td> show dialog and wait until it is closed again
</tr>
<tr>
<td> fileChooser.setDir(dir)
<td> set directory in the dialog to <i>dir</i>
</tr>
<tr>
<td> fileChooser.setFilter(filter)
<td> set file filter to <i>filter</i>, using the QT-format, see above
</tr>
<tr>
<td> fileChooser.fileName()
<td> return selected filename (after exec)
</tr>
</table>
<br><br>
Some examples:
<ul>
<li>Copy current file name to clipboard: <pre>
%SCRIPT
app.clipboard = editor.fileName();</pre>
</li>
<li>Execution of editor text: <pre>
%SCRIPT
eval(editor.text());</pre>
</li>
<li>Calculator:<pre>
%SCRIPT
currentLine=editor.text(cursor.lineNumber());
from=currentLine.lastIndexOf("%")+1;
to=currentLine.lastIndexOf("=");
if (from>=0 && to > from) {
toEvaluate = currentLine.substring(from, to);
with (Math) { value = eval(toEvaluate);}
cursor.eraseLine();
cursor.insertText(currentLine.substring(0, from)+toEvaluate+"="+value);
cursor.insertLine();
cursor.movePosition(1,cursorEnums.Left );
}
</pre>
This will evaluate everything between % and = and write the result after the =. You can use it like a calculator if you write %5+3= in the tex file.
<li>(tikz) Coordinate pair mover:
<pre>
%SCRIPT
var doit = function(){
var mytext=cursor.selectedText();
var regExNumberPre = " *[0-9]+([.][0-9]*)? *";
var regExDigit = /[0-9]/;
var regExSpace = / /g;
var regExPairPre = " *(-?"+regExNumberPre+")";
var regExPair = new RegExp("()[(]"+regExPairPre+","+regExPairPre+"[)]"); ;
//read first coordinate pair
var regExFirstPairPre = regExPairPre + " *([+-]"+regExNumberPre+")?";
var regExFirstPair = new RegExp("()[(]"+regExFirstPairPre+","+regExFirstPairPre+"[)]");
//extract offsets (start regex search from first digit, to allow -x - y)
var matches = regExFirstPair.exec(mytext);
if (matches == null) throw "missing";
//throw matches;
var offsetXPre = matches[4];
var offsetYPre = matches[8];
if (offsetXPre == "" && offsetYPre == "") throw "abc";
var offsetX = offsetXPre == ""?0.0:offsetXPre.replace(regExSpace, "")*1.0;
var offsetY = offsetYPre == ""?0.0:offsetYPre.replace(regExSpace, "")*1.0;
//move first pair
var matchpos = mytext.search(regExFirstPair);
editor.write(mytext.slice(0,matchpos));
editor.write("("+(matches[2].replace(regExSpace, "")*1.0+offsetX));
editor.write(", "+(matches[6].replace(regExSpace, "")*1.0+offsetY)+")");
//move other pairs
var remaining = mytext.slice(matchpos+matches[0].length);
while (remaining != ""){
matches = regExPair.exec(remaining);
if (matches == null) break;
matchpos = remaining.search(regExPair);
editor.write(remaining.slice(0,matchpos));
remaining = remaining.slice(matchpos+matches[0].length);
editor.write("(" + ((matches[2].replace(regExSpace, "")*1.0)+offsetX) + ", "+ ((matches[4].replace(regExSpace, "")*1.0)+offsetY) + ")");
}
editor.write(remaining);
}
doit();
</pre>
This will add to all selected coordinate pairs the offset of the first pair which translates all pairs in a given direction. E.g. if you have (1 + 1, 2 - 1.5) (3, 4) it will change it to (2, 0.5) (4, 2.5).
</ul>
</p>
<p>You can also launch your own commands (shortcuts : Alt+Shift+F1...Alt+Shift+F5). These commands are defined with the "User - User Commands" menu.</p>
<h2><a name="SECTION34">4.6 Pstricks support</a></h2>
<p>The main pstricks commands can be inserted with the "Pstricks" panel in the "Structure View".</p>
<h2><a name="SECTION35">4.7 Metapost support</a></h2>
<p>The metapost keywords can be inserted with the "Metapost" panel in the "Structure View" and the "mpost" command can be launched via the "Tools" menu.</p>
<h2><a name="SECTION36">4.8 The "Convert to Html" command</a></h2>
<p>This command (from the "Tools" menu ) produces a set of html pages from a LaTeX source file with one image for each html page. Each page in the slide presentation corresponds to one of the postscript pages you would obtain running LaTeX.<br>
The command also produces an index page corresponding to the table of contents you would obtain with LaTeX. Each item of the index page includes a link to the corresponding html page.</p>
<p>You can create links in the html pages by using the \ttwplink{}{} command in the tex file.<br>
Synopsis :<br>
\ttwplink{http://www.mylink.com}{my text} (external link)<br>
\ttwplink{page3.html}{my text} (internal link)<br>
\ttwplink{name_of_a_label}{my text} (internal link)<br>
<b>Warning : </b>You can't use this command with the hyperref package (and some others packages). This command can only be used with the "Convert to html" tool.</p>
<p><IMG src="doc18.png" border="1"></p>
<p><IMG src="doc19.png" border="1"></p>
<h2><a name="SECTION37">4.9 "Forward/Inverse search" with TeXstudio</a></h2>
<p>
<h3>Integrated pdf-viewer</h3>
TeXstudio provides an integarted pdf-viewer which offers forward- and inverse-search. Make sure that synctex is activated in the pdflatex command (option -synctex=1 needs to be added), though TeXstudio will ask you if it can correct the command itself if it is not set correctly.<br>
Forward search is automatically done every time the pdf-viewer is opened. TeXstudio will jump to the position where your cursor is currentyl positioned.
Inverse can be activated by clicking in the pdf with CTRL+left mouse button or by slecting "jump to source" in the context menu, which is activated with a right mouse button click.
Furthermore it is possible to enable "Scrolling follows Cursor" in pdf-viewer/configure. This will keep the pdf-viewer position synchronous to your cursor oposition in the editor.
Likewise "Cursor follows Scrolling" keeps the editor position synchronous to pdf-viewer position.
<h3>General Set-up for external viewers</h3>
Some (dvi) viewers can jump to (and visually highlight) a position in the DVI file that corresponds to a certain line number in the (La)TeX source file.<br>
To enable this forward search, you can enter the command line of the corresponding viewer either as command line for an user tool in the User menu (User/User Commands/Edit...) or in the viewer command line in the config dialog ("Options/Configure TeXstudio" -> "Commands").
When the viewer is launched, the <b>@</b>-placeholder will be replaced by the current line number and <b>?c:ame</b> by the complete absolute filename of the current file.<br><br>
On Windows, you can execute DDE commands by inserting a command of the form: <span class="command">dde://service/control/[commands...]</span> or (since TeXstudio 1.9.9) also <span class="command">dde://programpath:service/control/[commands...]</span> to start the program if necessary.
<br><br>
Below you can find a list of commands for some common viewers. Of course, you have to replace <i>(your program path)</i> with the path of the program on your computer, if you want to use a command.<br>
<h3>Sumatra</h3>
To launch Sumatra from TeXstudio and configure Sumatra for inverse search: <span class="command">"<i>(your sumatra path)</i>" -reuse-instance -inverse-search """"<i>(your TeXstudio path)</i>""" """%%f""" -line %%l" "?am.pdf"</span><br><br>
To jump to a line in a running Sumatra (Windows only): <span class="command">dde://SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]</span><br><br>
To launch Sumatra if it is not running and jump to a line in it (Windows only): <span class="command">dde://<i>(your sumatra path)</i>:SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]</span><br><br>
To launch TeXstudio from Sumatra: <span class="command">"<i>(your TeXstudio path)</i>" "%f" -line %l </span><br><br>
A possible value for <i>(your Sumatra path)</i> is <span class="command">C:/Program Files/SumatraPDF/SumatraPDF.exe</span>
<h3>Foxit Reader</h3>
To launch Foxit Reader from TeXstudio: <span class="command">"<i>(your Reader path)"</i> "?am.pdf"</span><br><br>
<h3>Acrobat Reader</h3>
To launch Acrobat Reader from TeXstudio: <span class="command">"<i>(your Reader path)"</i> "?am.pdf"</span><br><br>
To jump to a position in a running Acrobat Reader (Windows only): <span class="command">dde://acroview/control/[DocOpen("?am.pdf")][FileOpen("?am.pdf")][DocGotoNameDest("?am.pdf","jump-position")]</span> <i>jump-position can be defined with the hyperref package</i><br><br>
To close the document in a running Acrobat Reader (Windows only): <span class="command">dde://acroview/control/[DocOpen("?am.pdf")][FileOpen("?am.pdf")][DocClose("?am.pdf")]</span><br><br>
<h3>Yap (Yet Another Previewer)</h3>
To launch Yap from TeXstudio : <span class="command">"<i>(your Yap path)</i>" -1 -s @?c:m.tex %.dvi</span>
<br><br>
To launch TeXstudio from Yap: <span class="command">"<i>(your TeXstudio path)</i>" "%f" -line %l </span><br><br>
A possible value for <i>(your Yap path)</i> is <span class="command">C:/Program Files/MiKTeX 2.7/miktex/bin/yap.exe</span>
<h3>xdvi</h3>
To launch xdvi from TeXstudio : <span class="command">xdvi %.dvi -sourceposition @:?c:m.tex</span><br><br>
To launch xdvi from TeXstudio and enable inverse search : <span class="command">xdvi -editor "texstudio %f -line" %.dvi -sourceposition @:%.tex</span>
<h3>kdvi</h3>
To launch kdvi from TeXstudio : <span class="command">kdvi "file:%.dvi#src:@ ?c:m.tex"</span>
<h3>Okular</h3>
To launch okular from TeXstudio: <span class="command">okular --unique %.dvi#src:@?c:m.tex</span><br><br>
To launch TeXstudio from Okular: <span class="command">texstudio %f -line %l</span>
<h3>Skim</h3>
To launch Skim from TeXstudio: <span class="command">(your Skim path)/Contents/SharedSupport/displayline @ ?am.pdf ?c:ame</span><br><br>
To launch TeXstudio from skim : Command: <span class="command">/applications/texstudio.app/contents/macos/texstudio</span> with arguments: <span class="command">"%file" -line %line </span><br><br>
A possible value for <i>(your Skim path)</i> is <span class="command">/Applications/Skim.app</span>
<h2><a name="SECTION38">4.10 Synopsis of the TeXstudio command</a></h2>
<p>
TeXstudio file [--master] [--line xx] [--start-always] [--pdf-viewer-only] [--page yy]<br>
With the "--master" option, the document will be automatically defined as a "master" document.<br>
With the "--line xx" option, TeXstudio will ask you if you want to jump to the xx line after loading the document.<br>
With the "--start-always" option, TeXstudio will start, even if another instance of it is already running.<br>
With the "--pdf-viewer-only" option, TeXstudio will open as standalone pdf viewer without editor<br>
With the "--page" option, TeXstudio displays a certain page if used as pdf viewer<br>
</p>
<h2><a name="SECTION39">4.11 Keyboard shortcuts</a></h2>
<p>
Defaults keyboard shortcuts <!--(*:can be modified - "Configure TeXstudio" -> "Editor") -->:
<ul>
<li> "File" menu :
<ul>
<li>New : Ctrl+N</li>
<li>Open : Ctrl+O</li>
<li>Save : Ctrl+S</li>
<li>Save as: Ctrl+Alt+S</li>
<li>Save all: Ctrl+Shift+Alt+S</li>
<li>Close : Ctrl+W</li>
<li>Print : Ctrl+P</li>
<li>Exit : Ctrl+Q</li>
</ul>
</li>
<li> "Edit" menu :
<ul>
<li>Undo : Ctrl+Z</li>
<li>Redo : Ctrl+Y</li>
<li>Copy : Ctrl+C</li>
<li>Cut : Ctrl+X</li>
<li>Paste : Ctrl+V</li>
<li>Paste as latex: Ctrl+Shift+V</li>
<li>Select all : Ctrl+A</li>
<li>Remove line : Ctrl+K</li>
<li>Show preview : Alt+P</li>
<li>Find : Ctrl+F</li>
<li>Find next : Ctrl+M</li>
<li>Replace : CTrl+R</li>
<li>Goto line : Ctrl+G</li>
<li>Jump to last change: Ctrl+H</li>
<li>Jump to previous change: Ctrl+Shift+H</li>
<li>Set Bookmark 0..9: Ctrl+Shift+0..9</li>
<li>Jump to Bookmark 0..9: Ctrl+0..9</li>
<li>Next Marker: Ctrl+Down</li>
<li>Previous Marker: Ctrl+Shift+Up</li>
<li>Next Latex Error: Ctrl+Shift+Down</li>
<li>Previous Latex Error: Ctrl+Shift+Up</li>
<li>Next Latex Warning: Ctrl+Alt+Down</li>
<li>Previous Latex Warning: Ctrl+Alt+Up</li>
<li>Next Latex Bad Box: Shift+Alt+Down</li>
<li>Previous Latex Bad Box: Shift+Alt+Up</li>
<li>Go to definition: Ctrl+Alt+F</li>
<li>Check spelling (from cursor) : Ctrl+Shift+F7</li>
<li>Open Thesaurus : Ctrl+Shift+F8</li>
<li>Refresh Structure View : F12</li>
<li>Remove placeholders : Ctrl+Shift+K</li>
</ul>
</li>
<li> "Tools" menu :
<ul>
<li>Quick build : F1</li>
<li>Latex : F2</li>
<li>View dvi : F3</li>
<li>Dvi->PS : F4</li>
<li>View PS : F5</li>
<li>Pdflatex : F6</li>
<li>View Pdf : F7</li>
<li>PS->Pdf : F8</li>
<li>Dvi->Pdf : F9</li>
<li>Bibtex : F11</li>
<li>Make index : F12</li>
</ul>
</li>
<li> * "LaTeX" menu :
<ul>
<li>* item : Ctrl+Shift+I</li>
<li>* Italic : Ctrl+I</li>
<li>* Slanted : Ctrl+Shift+S</li>
<li>* Bold : Ctrl+O</li>
<li>* Typewriter : Ctrl+Shift+T</li>
<li>* Small caps : Ctrl+Shift+C</li>
<li>* Emphasis : Ctrl+Shift+E</li>
<li>* New line : Ctrl+Return</li>
<li>* begin{environment} : Ctrl+E</li>
<li>* Insert reference to next label : Ctrl+Alt+R</li>
</ul>
</li>
<li> * "Math" menu :
<ul>
<li>* Inline math mode : Ctrl+Shift+M</li>
<li>* Display math mode : Alt+Shift+M</li>
<li>* Numbered equations : Ctrl+Shift+N</li>
<li>* Subscript : Ctrl+Shift+D</li>
<li>* Superscript : CTrl+Shift+U</li>
<li>* Frac : Alt+Shift+F</li>
<li>* Dfrac : Ctrl+Shift+F</li>
<li>* Sqrt : Ctrl+Shift+Q</li>
<li>* Left : Ctrl+Shift+L</li>
<li>* Right : Ctrl+Shift+R</li>
</ul>
</li>
<li> "User" menu :
<ul>
<li>User tags : Shift+F1...Shift+F10</li>
<li>User commands : Shift+Alt+F1...Shift+Alt+F10</li>
</ul>
</li>
<li> "View" menu :
<ul>
<li>Next Document : Alt+PgUp</li>
<li>Previous Document : Alt+PgDown</li>
<li>View log : F10</li>
</ul>
</li>
</ul>
</p>
<h2><a name="CWLDESCRIPTION">4.12 Description of the cwl format</a></h2>
<p>
Basically a cwl file is a list of valid commands which contains one command per line.
If no further information is given, the command is considered valid at any position in a latex document.
The following characters have special meanings:
<ul>
<li># (at start of line):comment</li>
<li># (later):separator for command classifications</li>
</ul>
Follwing classifications are known to TXS:
<ul>
<li>*: unusual command which is used for completion only in with the "all" tab</li>
<li>m:valid only in math environment</li>
<li>t:valid only in tabular environment (or similar)</li>
<li>T:valid only in tabbing environment</li>
<li>n:valid only in text environment (i.e. not math env)</li>
<li>/env1,env2,...:valid only in environment env1 or env2 etc.</li>
<li>\env:environment alias, means that the environment is handled like the "env" environment. This is useful for env=math or tabular.</li>
</ul>
Simple example:<br>
# test <- comment<br>
\typein{msg}#* <- unusual command which is only shown in completion "all"<br>
\sqrt{arg}#m <- only in math mode valid<br>
\vector(xslope,yslope){length}#*/picture <- unusual command which is only in the picture environment valid<br>
\begin{align}#\math <- declares that the "align"-environment is handled like a math-env, concerning command validity and syntax highlighting!<br>
</p>
</body></html>
|