summaryrefslogtreecommitdiff
path: root/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html')
-rw-r--r--Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html77
1 files changed, 0 insertions, 77 deletions
diff --git a/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html b/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html
deleted file mode 100644
index acfd6358a1c..00000000000
--- a/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual005.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
-<HTML>
-<HEAD>
-
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<META name="GENERATOR" content="hevea 1.10">
-<LINK rel="stylesheet" type="text/css" href="manual.css">
-<TITLE>Going further: Editing tools</TITLE>
-</HEAD>
-<BODY >
-<A HREF="manual004.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
-<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
-<A HREF="manual006.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
-<HR>
-<table width="80%" align="center" >
- <tr>
- <td><H2 CLASS="section"><A NAME="htoc15">4</A>  Going further: Editing tools</H2>
-<P>When you have had some practise with T<sub>E</sub>Xworks, you’ll find the need for more effective tools. Many tools exist in T<sub>E</sub>Xworks. We are going to see them now.</P>
-<H3 CLASS="subsection"><A NAME="toc9"></A><A NAME="htoc16">4.1</A>  Creating a document from a template<A NAME="@default69"></A></H3><P>Most documents you will create will use the same instructions in the preamble, the same layout settings, similar heading and so on. You can use predefined templates or create your own with all of these settings already in place.</P><P>Use <I><FONT COLOR=maroon><B>File / New from template…</B></FONT></I> or <CODE>[Ctrl+Shift+N]</CODE> (Mac OS X <CODE>[Cmd+Shift+N]</CODE>). A dialogue box opens to allow selection of the template. After selection and <CODE>OK</CODE> a document is created and you can start to work.</P><P>If you want to create a personal template, you just have to create a suitable document with everything you always want to do (and perhaps marking places to fill in) and save it as a <CODE>.tex</CODE> file in the <CODE>&lt;home&gt;\TeXworks\templates</CODE> folder, or possibly a sub-folder of it.</P><H3 CLASS="subsection"><A NAME="toc10"></A><A NAME="htoc17">4.2</A>  Creating a project<A NAME="@default70"></A> using several source files</H3><P>When the source becomes long, it is sometimes difficult to navigate in it. It is then useful to split the source in different smaller files: one file will be the main document, with the preamble, the <CODE>document</CODE> environment, as well as calls to the “sub-documents”.<SUP><A NAME="text14" HREF="manual010.html#note14">13</A></SUP></P><P>But there might be a problem if, in a sub-document, you start typesetting/compilation: as there is no preamble nor <CODE>document</CODE> environment there is an immediate error stop.</P><P>To tell T<sub>E</sub>Xworks that it should typeset the main document one adds at the very beginning of the sub-document the instruction:</P><P>
-<CODE>% !TeX root = path/main_file.tex</CODE><A NAME="@default71"></A></P><P>for example:</P><P><CODE>% !TeX root = manual.tex</CODE></P><P>If the main file is in the same folder, its name is enough, as in the above example. Notice that the slash <CODE>/</CODE> and not the backslash <CODE>\</CODE> should be used even on Windows.</P>
-<P>Further, with MiKTeX, the call to a sub-document, <CODE>\input{name.tex}</CODE>, should include the extension <TT>.tex</TT> to have an active SyncTeX action.</P>
-<H3 CLASS="subsection"><A NAME="toc11"></A><A NAME="htoc18">4.3</A>  Spell-check</H3><P>You can turn on automatic spell-checking<A NAME="@default72"></A> of your source from <I><FONT COLOR=maroon><B>Edit / Spelling / &lt;language&gt;</B></FONT></I>: for example <TT>en-GB</TT> for UK English.</P><P>During typing, if there is an error, the word is underlined by a red wavy line. A right-click on the word opens a contextual menu in which there are some replacement suggestions. Click on the desired word to make the replacement.</P><P>Before using the spell-checker, you need to install dictionaries in the right folder of T<sub>E</sub>Xworks: <CODE>&lt;home&gt;\TeXworks\dictionaries</CODE>.</P><P>One can use the available dictionaries for OpenOffice and other free software;<SUP><A NAME="text15" HREF="manual010.html#note15">14</A></SUP>, if you have Thunderbird with spell-check, you can copy the <CODE>.aff</CODE> and <CODE>.dic</CODE> files<A NAME="@default73"></A><A NAME="@default74"></A>. It is possible to ask T<sub>E</sub>Xworks to use by default a dictionary by <I><FONT COLOR=maroon><B>Edit / Preferences…/ Editor</B></FONT></I> option <I><FONT COLOR=maroon><B>Spell-check language</B></FONT></I>.</P><H3 CLASS="subsection"><A NAME="toc12"></A><A NAME="htoc19">4.4</A>  Search and replace</H3><P>
-<A NAME="@default75"></A><A NAME="@default76"></A></P><H4 CLASS="subsubsection"><A NAME="htoc20">4.4.1</A>  Standard functions</H4><P>The options of the menu <I><FONT COLOR=maroon><B>Search</B></FONT></I>: <I><FONT COLOR=maroon><B>Find…</B></FONT></I>, <I><FONT COLOR=maroon><B>Find again</B></FONT></I>, <I><FONT COLOR=maroon><B>Replace…</B></FONT></I> and <I><FONT COLOR=maroon><B>Replace again</B></FONT></I> (<CODE>[Ctrl+F]</CODE>, <CODE>[Ctrl+G]</CODE>, <CODE>[Ctrl+R]</CODE> and <CODE>[Ctrl+Shift+R]</CODE>, respectively) are standard actions (Mac OS X <CODE>[Cmd+F]</CODE>, <CODE>[Cmd+G]</CODE>, <CODE>[Cmd+R]</CODE> and <CODE>[Cmd+Shift+R]</CODE>); the first and the third open a dialogue box: (replace)</P>
-<P>There are the usual options: <EM>Find backwards</EM>, <EM>Wrap around</EM> or <EM>Replace within selection</EM>. The following options are also usual: <EM>Case sensitive</EM> and <EM>Whole words</EM>. By default the search is forward, towards the end of the document.</P>
-<P>The option <EM>Replace in all open files</EM> is also a frequent choice, but not as much as the others; this allows, for example, replacement in all the files of a project – pay attention as this is very powerful.</P><P>The last option, <EM>Regular expression</EM>, is detailed in the next sub-section.</P>
-<DIV CLASS="center">
-<IMG SRC="findrepl.jpg" width="508" height="253"></DIV>
-<P>In the <I><FONT COLOR=maroon><B>Search</B></FONT></I> menu there are other options:
-</P><UL CLASS="itemize"><LI CLASS="li-itemize">
-<I><FONT COLOR=maroon><B>Copy to Find</B></FONT></I>, copies the currently selected text into the <I><FONT COLOR=maroon><B>Find</B></FONT></I> zone of the Find or Replace dialogue; you still need to open <I><FONT COLOR=maroon><B>Find</B></FONT></I> or <I><FONT COLOR=maroon><B>Replace</B></FONT></I> separately;
-</LI><LI CLASS="li-itemize"><I><FONT COLOR=maroon><B>Copy to Replace</B></FONT></I>, the same for the <I><FONT COLOR=maroon><B>Replace</B></FONT></I> dialogue;
-</LI><LI CLASS="li-itemize"><I><FONT COLOR=maroon><B>Find Selection</B></FONT></I>, uses the current selection for a search without opening the <I><FONT COLOR=maroon><B>Find</B></FONT></I> dialogue: very fast;
-</LI><LI CLASS="li-itemize"><I><FONT COLOR=maroon><B>Show selection</B></FONT></I>, scrolls the view to the currently selected text: useful if word wrapping is turned off and one moved in the document using the vertical scroll bar on the right.
-</LI></UL><H4 CLASS="subsubsection"><A NAME="htoc21">4.4.2</A>  Regular expressions<A NAME="@default77"></A></H4><P>The regular expressions provide a very powerful tool, but they require some effort to be well understood. To understand them fully would require a manual, so we’ll give some simple ideas of use: see also section <A HREF="manual007.html#regexp">6.2</A>.</P><P>Suppose we have the following text:
-</P><PRE CLASS="verbatim">Voici du texte pour tester les expressions régulières
-dans du texte accentué.
-Voici du texte pour tester les expressions régulières dans
-du texte accentué.
-Voici du texte pour tester les expressions régulières. Voici
-du texte pour tester les expressions régulières.
-truc truc
-tél.: 010-99-99-99
-tél.: 00.32.10.99.99.99
-tél.: 00/32-10/99.99.99
-</PRE><P>We want to 1) insert an empty line between the paragraphs after “accentué” (to create paragraphs in L<sup>A</sup>T<sub>E</sub>X) but not after the three telephone numbers; 2) replace each <I><FONT COLOR=maroon>tab</FONT></I> character between the two words “truc” of the fourth paragraph, by three spaces; and finally 3) make the telephone numbers consistent by replacing the various punctuation characters by spaces. </P><P>In the dialog box we have to select the option: <EM><B>Regular expression</B></EM>.</P><P>For 1) in the dialogue box <I><FONT COLOR=maroon><B>Replace</B></FONT></I> (<CODE>[Ctrl+R]</CODE>) for <EM>Find:</EM> we put <CODE>&gt;\n&lt;</CODE> <SUP><A NAME="text16" HREF="manual010.html#note16">15</A></SUP> and in <EM>With:</EM> <CODE>&gt;\n\n&lt;</CODE>. <CODE>&gt;\n&lt;</CODE> is the code to match or insert a line feed. You will need to select the first four paragraphs and the beginning of the fifth (first telephone number) and to tick the <EM>Replace within selection</EM>; if this was not done and an empty line has been inserted after each line, select the telephone lines and do the reverse action: replace <CODE>&gt;\n\n&lt;</CODE> by <CODE>&gt;\n&lt;</CODE>. So we replace one line feed by two, creating an empty line.</P>
-<P>For 2) use <CODE>&gt;\t&lt;</CODE> and “<CODE>&gt;___&lt;</CODE>. <CODE>&gt;\t&lt;</CODE> is the code which represent a tab, while a space is typed in literally (here represented as <CODE>_</CODE>).</P>
-<P>For 3) find <CODE>&gt;-|\.|/&lt;</CODE> and replace with “<CODE>&gt;_&lt;</CODE>. Here <CODE>&gt;|&lt;</CODE> provides different possibilities (<TT>- . /</TT>); for the point we have used <CODE>&gt;\.&lt;</CODE> because the dot alone is a regular expression code which represents any character and we would have replaced all the characters by a space!! we then use a code to get the point.</P><P>If one has strings of the same character but of different length (for example 2, 3, 4, 5 characters) and one wants to bring all strings to a string with less characters (for example 2), one can ask to replace the string <CODE>&gt;e{3,5}&lt;</CODE> by <CODE>&gt;ee&lt;</CODE>.</P><P>If one wants to insert at the beginning of some paragraphs separated or not by an empty line the same string, for example <CODE>&gt;\noindent_</CODE> or <CODE>&gt;\item_</CODE>, one can replace <CODE>&gt;\n\n&lt;</CODE> or <CODE>&gt;\n&lt;</CODE> by “<CODE>&gt;\n\n\\noindent_&lt;</CODE> or “<CODE>&gt;\n\\noindent_&lt;</CODE>. Pay attention, we have double <CODE>\</CODE> in front of <CODE>noindent</CODE> to get one (<CODE>\noindent</CODE>) because <CODE>\</CODE> is an ecape character in regular expressions!</P><P>If it was making sense, we could replace all the letters between “a” and “m” by “$” using <CODE>&gt;[a-m]&lt;</CODE> and <CODE>&gt;$&lt;</CODE>.</P>
-<H3 CLASS="subsection"><A NAME="toc13"></A><A NAME="htoc22">4.5</A>  Other tools for editing and error tracking<A NAME="@default78"></A></H3>
-<H4 CLASS="subsubsection"><A NAME="htoc23">4.5.1</A>  Standard tools</H4><P>It is always possible to undo<A NAME="@default79"></A> an action using <I><FONT COLOR=maroon><B>Edit / Undo</B></FONT></I> or <CODE>[Ctrl+Z]</CODE> (Mac OS X <CODE>[Cmd+Z]</CODE>): this way you can undo stepwise! The inverse action, redo, is available as <I><FONT COLOR=maroon><B>Edit / Redo</B></FONT></I><A NAME="@default80"></A> or <CODE>[Ctrl+Alt+Z]</CODE> (Mac OS X <CODE>[Cmd+Opt+Z]</CODE>).</P><P>T<sub>E</sub>Xworks also provides the standard editing tools such as the clipboard; therefore one can select, cut/copy and paste a piece of text.</P>
-<P>You can select with the mouse by dragging over the desired text, or by double-clicking to select a word. Using the keyboard, holding down <CODE>[Shift]</CODE> while moving using the arrow keys will select text. You can also move and select word by word moving left or right holding <CODE>[Ctrl+Shift]</CODE> down (<CODE>[Cmd+Shift]</CODE> on Mac OS X). The clipboard short-cuts are the ones you’ll finds in almost every program: <CODE>[Ctrl+X]</CODE> to cut, <CODE>[Ctrl+C]</CODE> to copy and <CODE>[Ctrl+V]</CODE> to paste (<CODE>[Cmd+X]</CODE>, <CODE>[Cmd+C]</CODE> and <CODE>[Cmd+V]</CODE>, respectively, on Mac OS X).</P>
-<P>You can easily change the case of<A NAME="@default81"></A> a selection — put everything upper case or lower case — using <I><FONT COLOR=maroon><B>Edit / Changer case /</B></FONT></I> and next, depending on the desired effect, <I><FONT COLOR=maroon><B>ALL UPPERCASE</B></FONT></I> or <I><FONT COLOR=maroon><B>all lowercase</B></FONT></I>.</P>
-<P>It is also convenient to show the line numbers<A NAME="@default82"></A>, as all errors messages refer to these numbers; you can toggle the line numbers, on the left of the editing panel, <TT>on/of</TT> by <EM><B>Format / Line Numbers</B></EM>.</P>
-<H4 CLASS="subsubsection"><A NAME="htoc24">4.5.2</A>  Commenting</H4><P>When preparing a document with (L<sup>A</sup>)T<sub>E</sub>X it is often useful to prevent compilation of a portion of text to be able to locate an error; you can do this piece by piece until you find a part which creates an error. To do this, commenting the source block by block is needed. </P>
-<P>We have seen that the symbol <TT>%</TT> marks the beginning of a comment. To comment<A NAME="@default83"></A> a big piece of text, it is sufficient to select it and ask to mark it as comment <I><FONT COLOR=maroon><B>Format / Comment</B></FONT></I> or “<CODE>Ctrl+Shift+]</CODE>” (Mac OS X “<CODE>Cmd+Shift+]</CODE>”). To remove the comment, select the lines and choose <I><FONT COLOR=maroon><B>Format / Uncomment</B></FONT></I><A NAME="@default84"></A> or “<CODE>Ctrl+Shift+[</CODE>” (Mac OS X “<CODE>Cmd+Shift+[</CODE>”) <SUP><A NAME="text17" HREF="manual010.html#note17">16</A></SUP>. </P><H4 CLASS="subsubsection"><A NAME="htoc25">4.5.3</A>  Matching delimiters</H4><P>A frequent error is to forget a closing symbol: parenthesis, bracket, square bracket, <EM>etc</EM>. T<sub>E</sub>Xworks helps with a tool to show the pairs of symbols: when the cursor moves over one of these symbols, its partner is briefly highlighted in orange. You can also select an entire block<A NAME="@default85"></A> using <I><FONT COLOR=maroon><B>Edit / Balance Delimiters</B></FONT></I> or by the short-cut <CODE>[Ctrl+B]</CODE> (Mac OS X <CODE>[Cmd+B]</CODE>). Thus you will immediately sees the scope of the block.</P><H4 CLASS="subsubsection"><A NAME="htoc26">4.5.4</A>  Smart quotes</H4><P>Another similar error, but this time semantic and having no influence on typesetting, is in the use of quotes when one wants to give focus to some text.</P>
-<P>There are two types of quotes, in English, the ‘single’ quotes and the “double” quotes. They are obtained by the <CODE>`</CODE> and <CODE>´</CODE>; these are not the quotes used in programming and found on the keyboard <CODE>"</CODE> and <CODE>'</CODE>. But using the T<sub>E</sub>Xworks smart quotes system, one can use the latter to automatically produce the single/double opening <B>and</B> close quotes.</P>
-<P>In a <CODE>.tex</CODE> document, select one of the smart quotes system: <I><FONT COLOR=maroon><B>Format / Smart Quotes / TeX Ligatures|TeX Commands|Unicode Characters</B></FONT></I>. Then in your text when you want to start a quoted text, let say double quotes, type <CODE>"</CODE> then the text to be focused on and finish again by <CODE>"</CODE>; T<sub>E</sub>Xworks will automatically insert the correct opening quotes <CODE>``</CODE> and later the correct closing ones <CODE>''</CODE>. The three options give the same result in the typeset document.</P>
-<P>Finally, it is possible to define personal quotes systems in the file containing the definitions (<CODE>smart-quotes-modes.txt</CODE> in the <CODE>configuration</CODE> folder of the resource folder).</P><H3 CLASS="subsection"><A NAME="toc14"></A><A NAME="htoc27">4.6</A>  Auto-completion<A NAME="@default86"></A></H3>
-<P>Another tool which rapidly becomes indispensable is auto-completion. Indeed, when you use (L<sup>A</sup>)T<sub>E</sub>X, you have to continuously enter codes to, for example, create environments; you also have to remember to close every group you open.</P>
-<P>Auto-completion allows you to type a keyword, hit <CODE>[Tab]</CODE> and have T<sub>E</sub>Xworks insert the (L<sup>A</sup>)T<sub>E</sub>X command or environment code automatically.</P>
-<P>As an example to insert “L<sup>A</sup>T<sub>E</sub>X”, we have to type <CODE>\LaTeX</CODE>. This is not difficult, but entering “<CODE>\</CODE>”<SUP><A NAME="text18" HREF="manual010.html#note18">17</A></SUP> followed by the word “<CODE>LaTeX</CODE>” with alternating capitals and lower case letters could become annoying after a while. With auto-completion you just enter <CODE>latex</CODE> and hit <CODE>[Tab]</CODE> to get <CODE>\LaTeX</CODE>. You just have to take care that there is no <EM>letter</EM> glued in front or after <CODE>latex</CODE>.</P><P>Another example is <CODE>bmin</CODE>, which gives gives:
-</P><PRE CLASS="verbatim">\begin{minipage}{}
-•
-\end{minipage}•
-</PRE><P>with the cursor between the empty pair of brackets where you need to enter the size of the minipage. See the section <A HREF="manual007.html#autoc">6.3</A> for a list of the keywords for auto-completion. Notice the “•” in the minipage environment. They are place holders which can be reached by <CODE>[Ctrl+Tab]</CODE> (<CODE>[Option+Tab]</CODE> on the Mac), repeating this short-cut goes forward in the created structure and by <CODE>[Ctrl+Shift+Tab]</CODE> (<CODE>[Option+Shift+Tab]</CODE>) one goes backward.</P><P>If a partial keyword is given, repeatedly hitting <CODE>[Tab]</CODE> will cycle through possible completions. For example, <CODE>bali</CODE> (the <CODE>b</CODE> means the beginning of an environment <CODE>\begin{}</CODE>) creates the <CODE>align</CODE> environment after one <CODE>[Tab]</CODE>, next <CODE>align*</CODE>, and after, in succession, <CODE>alignat</CODE>, <CODE>alignat*</CODE>, <CODE>aligned</CODE>, <CODE>alignedat</CODE>, <CODE>alignedat</CODE> with option; these last environments have their own code which starts by <CODE>bali</CODE> (<CODE>balis</CODE>, <CODE>baliat</CODE>, <CODE>baliats</CODE>, <CODE>balied</CODE>, <CODE>baliedat</CODE> and <CODE>baliedato</CODE>).</P><P>If you want to create your own keywords, you can add a <CODE>.txt</CODE> file in the <CODE>completion</CODE> folder inside <CODE>&lt;home&gt;\TeXworks</CODE>. The entries in the file should have the following format:
-</P><PRE CLASS="verbatim">bfigo:=\begin{figure}[#INS#]#RET##RET#\end{figure}•
-\bibliography{#INS#}•
-</PRE><P>In the first case, <CODE>bfigo</CODE> is the assigned keyword (with <CODE>:=</CODE>) to be converted into a <TT>figure</TT> environment with an optional argument; there is a carriage return after the <CODE>begin</CODE>, one empty and the cursor is between the square brackets. The codes <CODE>#INS#</CODE> and <CODE>#RET#</CODE> represent the cursor insertion point and line returns, respectively, “•” is a place holder.</P><P>In the second case we give ourselves a short-cut, which will let us type the first part of <CODE>\bibliography{}</CODE> and have T<sub>E</sub>Xworks convert it to the full name plus braces (with the cursor between them). The keyword is the instruction itself.</P><P>Of course it is always possible to use “•”!</P>
-<P>The <TT>.txt</TT> file containing the auto-completion information needs to be UTF-8 encoded: it can be created with T<sub>E</sub>Xworks.</P>
- </td>
- </tr>
-</table><HR>
-<A HREF="manual004.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
-<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
-<A HREF="manual006.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
-</BODY>
-</HTML>