summaryrefslogtreecommitdiff
path: root/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html')
-rw-r--r--Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html106
1 files changed, 106 insertions, 0 deletions
diff --git a/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html b/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html
new file mode 100644
index 00000000000..76c9bd845f2
--- /dev/null
+++ b/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/manual004.html
@@ -0,0 +1,106 @@
+<!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>First steps</TITLE>
+</HEAD>
+<BODY >
+<A HREF="manual003.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
+<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
+<A HREF="manual005.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
+<HR>
+<table width="80%" align="center" >
+ <tr>
+ <td><H2 CLASS="section"><A NAME="htoc7">3</A>  First steps</H2>
+<P>Let’s now see how to create a first document: for this you’ll need to type some text in the editor window of T<sub>E</sub>Xworks. (L<sup>A</sup>)T<sub>E</sub>X is not aWYSIWIG<A NAME="@default43"></A> software,<SUP><A NAME="text6" HREF="manual010.html#note6">5</A></SUP> so you’ll have to type the text and the instructions for formatting it and you’ll see the result only after “typesetting” the text. This looks a little bit dry, but one very quickly gets used to it and this is worth the effort.</P>
+<H3 CLASS="subsection"><A NAME="toc5"></A><A NAME="htoc8">3.1</A>  Interface<A NAME="@default44"></A> summary</H3><P>When one opens the editor, it shows a very sparse interface: a title bar, a menu bar, two small tool-bars<A NAME="@default45"></A>, a large typing zone (white) and, at the bottom, a status bar. We are in the <EM>source/editor</EM><A NAME="@default46"></A> window. If you already typeset the document, the resulting .pdf will be shown on the right in the <EM>preview</EM><A NAME="@default47"></A>
+window.
+<BR>
+</P><P>
+ <IMG SRC="TeXworks.PNG" width="960" height="748"></P>
+<P><IMG SRC="barreun.jpeg" width="124" height="36"> The first tool-bar has a button to typeset and an drop-down menu to choose the format for typesetting (we'll choose <CODE>pdfLaTeX</CODE>). Knowing that the keyboard short-cut for typesetting is <CODE>[Ctrl+</CODE>T] (Mac OS X: <CODE>[Cmd+</CODE>T]) and that we almost never change the format, we could even not show this tool-bar. The selection of a format for compiling can also be changed through the <EM><B>Typeset</B></EM><A NAME="@default48"></A> menu. <BR>
+</P>
+<P><IMG SRC="barredeux.jpeg" width="337" height="36"> The second toolbar provides the standard functions: New document, Open, Save | Undo, Redo | Cut, Copy, Paste | Search, Replace.</P>
+<DIV CLASS="center"></DIV>
+<H3 CLASS="subsection"><A NAME="toc6"></A><A NAME="htoc9">3.2</A>  Creating a document</H3><H4 CLASS="subsubsection"><A NAME="htoc10">3.2.1</A>  Writing the document</H4>
+<P>As an example of the use of T<sub>E</sub>Xworks we will work with L<sup>A</sup>T<sub>E</sub>X<A NAME="@default49"></A>, but any other T<sub>E</sub>X system is possible. In particular, if you need to use some special fonts – mandatory font for an official template, non latin alphabets – the XeTeX system is very powerful. <SUP><A NAME="text7" HREF="manual010.html#note7">6</A></SUP></P>
+<P>Let’s create now our first document<A NAME="@default50"></A>: enter the following text exactly as shown. To show some of the features of T<sub>E</sub>Xworks/L<sup>A</sup>T<sub>E</sub>X, it is intentionally in French.<SUP><A NAME="text8" HREF="manual010.html#note8">7</A></SUP></P><HR SIZE=2><PRE CLASS="verbatim">\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{geometry}
+\geometry{a4paper}
+
+\usepackage[francais]{babel}
+
+\title{Premier document}
+\author{Un TeXnicien}
+\date{}
+
+\begin{document}
+\maketitle
+
+Voici un texte accentué en français!
+
+\end{document}
+</PRE><HR SIZE=2><P>Save the file in a folder for test documents (for example: &lt;home&gt; TeXworks_tests); call the file <CODE>first.tex</CODE>, note that it should have a <CODE>.tex</CODE> extension<A NAME="@default51"></A>.</P><H4 CLASS="subsubsection"><A NAME="htoc11">3.2.2</A>  Typesetting the document and viewing it</H4>
+<P>Next we start typesetting<A NAME="@default52"></A><SUP><A NAME="text9" HREF="manual010.html#note9">8</A></SUP> by clicking the green button <IMG SRC="compo.jpeg" width="34" height="35"> or by <CODE>[Ctrl+T]</CODE><A NAME="@default53"></A> (Mac OS X <CODE>[Cmd+T]</CODE>).</P>
+<P>A new panel opens between the typing area and the status bar: the <EM>output panel</EM><A NAME="@default54"></A>, labelled <EM>Log</EM><A NAME="@default55"></A>; everything L<sup>A</sup>T<sub>E</sub>X is doing when it works is displayed here <SUP><A NAME="text10" HREF="manual010.html#note10">9</A></SUP>. When L<sup>A</sup>T<sub>E</sub>X finishes (if there is no error) this panel disappears and a new window will appear; in this new window, the <EM>Preview window</EM><A NAME="@default56"></A><A NAME="@default57"></A>, you can see a page with a title “Premier document” followed by the name of the author “Un TeXnicien”, both centred, the text frenchb“Voici un texte accentué en français!” and at the bottom centre a page number.</P><P>Notice that the mouse cursor is like a magnifier in the new window. If you push the left button of the mouse you can see the text under the magnifier much bigger (it is a magnifier, isn’t it!); you can move the magnifier and so inspect the text in detail.</P><P>To go back to the source, you can just click in its window or better do <CODE>[Ctrl+']</CODE><A NAME="@default58"></A> (Mac OS X <CODE>[Cmd+']</CODE>). This short-cut is a toggle between the two windows.<SUP><A NAME="text11" HREF="manual010.html#note11">10</A></SUP> See also section <A HREF="manual006.html#psourvue">5.1</A> to automatically move at a specified location of the view from the source or the inverse.</P><H4 CLASS="subsubsection"><A NAME="htoc12">3.2.3</A>  The work of L<sup>A</sup>T<sub>E</sub>X</H4><P>Let’s now shortly analyse the result to understand what L<sup>A</sup>T<sub>E</sub>X did and why. Introductions and full tutorials can be found on internet: see for example <EM>lshort</EM> which should be installed as part of your T<sub>E</sub>X distribution, and is also available from CTAN<A NAME="@default59"></A>.<SUP><A NAME="text12" HREF="manual010.html#note12">11</A></SUP>
+</P>
+<P>We ask to create a document of the<EM> article</EM> class: this defines the global layout of the document.</P>
+<P>Next we say that the input document (the source) is saved with the Unicode encoding <EM>utf-8</EM><A NAME="@default60"></A> and that it will then contain characters which are not present in the standard ASCII without accents. We also want to use an output encoding T1 (the modern T<sub>E</sub>X encoding); we also want an <EM>A4</EM> document and not the default <EM>US letter</EM> size. Finally we make it clear that the typography should follow the French rules using the <B><FONT COLOR=purple>babel</FONT></B> package. Those general instructions for the work are done by packages<A NAME="@default61"></A> called with options.</P>
+<P>Lastly, we finish the declaration part of the document, the <EM>preamble</EM>, giving the title, the author and the date of the document; here we specify no date.</P>
+<P>Next comes the body of the document, between the lines <CODE>\begin{document}</CODE> and <CODE>\end{document}</CODE> (commands). It is here where everything which will appear in the document will be.</P>
+<P>Let’s do some experiments to show the effect of these instructions. For this we put a % in front of the instructions; the % and everything after it will be considered as a comment<A NAME="@default62"></A>, which will be ignored by L<sup>A</sup>T<sub>E</sub>X.<SUP><A NAME="text13" HREF="manual010.html#note13">12</A></SUP></P>
+<P>Comment out the line <CODE>\usepackage[utf8]{inputenc}</CODE>, and typeset the file. You should see that the accented characters are now incorrect in the preview window. If you now comment out the line <CODE>\usepackage[francais]{babel}</CODE>, L<sup>A</sup>T<sub>E</sub>X will give an error. Just hit <CODE>[Enter]</CODE> to continue the typesetting.</P><P>After these experiments, let’s modify the text as follows:</P><HR SIZE=2><PRE CLASS="verbatim">\begin{document}
+\maketitle
+\tableofcontents
+
+\section{Petite démonstration}
+
+Voici un texte accentué en français!
+Suite du texte entré après avoir fait un retour chariot. Dans l'éditeur
+on peut demander un passage automatique à la ligne du texte saisi; mais
+le numéro de ligne n'est incrémenté que par un retour chariot.
+
+Nouvelle ligne en passant une ligne dans la source: c'est la manière
+d'indiquer un changement de paragraphe.
+
+\end{document}
+</PRE><HR SIZE=2><P>Redo the previous experiments and observe the changes which appear.</P><P>Note that entering only one carriage return doesn’t create a new paragraph. In L<sup>A</sup>T<sub>E</sub>X one has to have an empty line for that. In T<sub>E</sub>Xworks the line number of the source (on the right in the status bar) numbers the lines created with carriage return, not the wrapped lines.</P><H3 CLASS="subsection"><A NAME="toc7"></A><A NAME="htoc13">3.3</A>  And when errors<A NAME="@default63"></A> occur!</H3><P>When you create a document for typesetting with L<sup>A</sup>T<sub>E</sub>X, you cannot avoid making mistakes: forgetting a closing brace or an <CODE>\end{}</CODE> command to close an environment, using mathematical commands without switching to mathematical mode, <EM>etc</EM>. When you compile and there is an error, L<sup>A</sup>T<sub>E</sub>X stops, this is shown by scrolling actions in the output panel stopping, and an error message is displayed with L<sup>A</sup>T<sub>E</sub>X waiting for an instruction to know what it should do: one sees the <EM>typing cursor</EM><A NAME="@default64"></A> in the line between the output panel and the status bar: <EM>the console bar</EM><A NAME="@default65"></A>.</P><DIV CLASS="center"><A NAME="tw-error"></A>
+<IMG SRC="TW-error.PNG" width="480" height="213">
+
+</DIV>
+<P>The error message is on many lines, for example like this:
+<BR>
+</P><HR SIZE=2><PRE CLASS="verbatim">! Undefined control sequence.
+l.168 ... fermante ou d'une commande \veb
+ +\end{}+ de fermeture d'un...
+?
+</PRE><HR SIZE=2><P>L<sup>A</sup>T<sub>E</sub>X says that it doesn’t recognize the command name, sometimes suggests to see the manual or to type <CODE>h</CODE> (plus <CODE>[Return]</CODE>) for help, points to the line number (here 168) and shows the place of the error at the cut of the line (here at <CODE>\veb</CODE>) and finally with the question mark shows that it waits for an action from us.</P><P>There are different possible actions:
+</P><UL CLASS="itemize"><LI CLASS="li-itemize">
+Type <CODE>[Return]</CODE> and ask to continue as if nothing happened; sometimes this allows to finish compiling, but there will be an error in the result.
+</LI><LI CLASS="li-itemize">Type <CODE>h[Return]</CODE> to ask for help; this help in not always clearer than the error message, but often this gives a clue.
+</LI><LI CLASS="li-itemize">Type <CODE>i[Return]</CODE> to tell L<sup>A</sup>T<sub>E</sub>X that we will propose a replacement text. Enter the text followed by <CODE>[Return]</CODE>; it will be used, beginning at the start of the error, but you should correct the source afterwards. There is no correction in the source during compilation.
+</LI>
+<LI CLASS="li-itemize">Type <CODE>x[Return]</CODE> to stop compilation. This is the traditional (L<sup>A</sup>)T<sub>E</sub>X way to kill a typesetting process.
+ <P>We can also kill the typesetting by repeating the action used to start it: the green typesetting button will have changed to a red one with a white cross <IMG SRC="stop.PNG" width="34" height="36">. By clicking on that button or with <CODE>[Ctrl+T]</CODE> (Mac OS X <CODE>[Cmd+T]</CODE>), the L<sup>A</sup>T<sub>E</sub>X process is terminated. The output panel is still visible and so one can still see the error message.
+</P>
+</LI></UL>
+<P>You should note that sometimes an error appears far from its actual position. For example, when opening an environment but not closing it, L<sup>A</sup>T<sub>E</sub>X doesn’t see the error before it encounters another end of environment without closing of the first one. The error is often only picked up at the <CODE>\end{document}</CODE> command, which shows that another environment was not closed!</P><H3 CLASS="subsection"><A NAME="toc8"></A><A NAME="htoc14">3.4</A>  Changing T<sub>E</sub>Xworks parameters for convenience</H3><P>
+<A NAME="@default66"></A></P>
+<P>If the default font<A NAME="@default67"></A> of the editor doesn’t suit you, it is possible to change it from <I><FONT COLOR=maroon><B>Format / Font…</B></FONT></I> by selecting a new one in the dialogue box which appears. This change will apply only until T<sub>E</sub>Xworks is restarted.</P>
+<P>From the <I><FONT COLOR=maroon><B>Typeset</B></FONT></I> menu or from the drop-down on the <I><FONT COLOR=maroon><B>Typesetting tool bar</B></FONT></I>, you can change the compilation format. Again this change will only be temporary.</P><P>To have permanent changes, you need to change the <EM>Preferences</EM><A NAME="@default68"></A> through the <I><FONT COLOR=maroon><B>Edit/ Preferences…</B></FONT></I> menu, using the <I><FONT COLOR=maroon><B>Editor</B></FONT></I> tab for the font and <I><FONT COLOR=maroon><B>Typesetting</B></FONT></I> tab for the compilation format: the default format is at the bottom of the tab (let’s choose <TT>pdfLaTex</TT> for this one).</P>
+ </td>
+ </tr>
+</table>
+<HR>
+<A HREF="manual003.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
+<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
+<A HREF="manual005.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
+</BODY>
+</HTML>