LaTeX/C3/Feedback-diagram-with-Maths/English-timed

From Script | Spoken-Tutorial
Revision as of 15:13, 27 December 2012 by Minal (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Time Narration
0:00 Welcome to the spoken tutorial on embedding mathematics in Xfig
0:05 In this tutorial, I shall explain how to Create this Figure
0:11 Observe the mathematical expression in the second block
0:16 You can embed any mathematical expression after learning this tutorial
0:23 We shall create the figure in the previous slide, starting from this figure which was created in the spoken tutorial on “Feedback Diagrams through Xfig”
0:36 You should learn this tutorial before starting the current one
0:42 Let me now explain what all you need to learn the material taught in this tutorial
0:48 I am using Xfig, Version 3.2, patch level 5
0:52 You also need LaTeX, and a familiarity with it
0:56 You also need image cropping software
1:01 pdfcrop works on Linux and Mac OS X .We will cover it in this tutorial
1:09 Briss is said to work on Windows also, but not covered in this tutorial
1:15 Let us go to Xfig
1:19 Let us choose file, then open.
1:26 If we scroll through the list, we will see the file “feedback.fig”, created in the spoken tutorial on “Feedback Diagrams through Xfig” .Let us click it
1:42 We will see the figure inside this box
1:45 Let us open it.
1:53 Let us bring it inside.
2:01 Let us also zoom it.
2:05 Using the “save as” option on “file”, we will save this figure as maths.
2:20 Let us save it.
2:24 We now have the file maths.fig
2:27 Let us select “Edit” and click the text “Plant”
2:34 Let me take the mouse here. Let me delete this and enter

$G(z) = \frac z{z-1}$

2:50 Make sure that the mouse stays within the box while typing
2:56 The default value for “Flag” is “normal” - change it to “special”
3:01 Click “done”
3:07 As the text is long, it overlaps with other entries
3:12 Let us move the text outside the box and work with it.
3:23 Let me click here.
3:26 Let me choose grid mode.
3:31 Once we are satisfied with any changes that we may want here, we can put it back inside the box.
3:39 Let us save the file.
3:44 Let us export using combined pdf and latex files.
3:51 File. Export. Combined pdf and LaTeX. .Let us export.
4:03 There is an error message I get. But let us not worry about this.
4:11 Let me go to the terminal.
4:13 Let me type “ls -lrt”
4:21 We get a list of files, with the last one being the most recent
4:26 The last two files are maths.pdf_t and maths.pdf
4:33 Let us give the command “open maths.pdf”
4:42 Let us bring it inside.
4:45 We can see the block diagram without the mathematical expression
4:50 Let me close this
4:52 Let us see maths.pdf_t in emacs editor that I have already opened
5:01 It is here. Let me open it.
5:14 Please note that you do NOT have to use emacs
5:17 You can use WHATEVER editor that you are comfortable with
5:22 You can see that the “picture” environment is used
5:26 It also makes use of “includegraphics” and “color” packages – we need to tell LaTeX to take care of this requirement
5:41 Let me now open the file maths-bp.tex,I have already created for this tutorial
5:59 I have used article class
6:02 I have used color and graphicx packages as these are used in the file pdf_t, the one we saw earlier.
6:15 I want empty pagestyle, as I do not want the page number
6:20 Finally, I want to include the file maths.pdf_t
6: 27 Let us invoke the command “pdflatex maths-bp” in the terminal
6:42 We get the message that the maths-bp.pdf is created.
6:48 Let us open it with the command “open maths-bp.pdf”
6:58 We have the file we want. Let me zoom it.
7:07 Now that we know that the mathematical expression is working, let us move the text inside the block
7:30 Let us save and export. It is already in the required language. Export.
7:38 Let us dismiss this warning.
7:41 Let me compile it again.
7:44 Let us click the pdf browser that has the file
7: 49 Now you see the mathematical expression inside the box, the way we want
7:56 Let us now see what happens if we do not choose the special flag.
8:01 Let me come here.
8:04 Let me edit the text, change the “Special Flag” to “normal”. Done.
8:25 File, save. Let me export
8:37 Let me compile. Let me come here.
8:41 The formula is no longer in the form we want
8:46 Let us change the “special flag” back to “special”
9:03 Save, export
9:12 Recompile. See that the file is in the form we want.
9:18 Let us now improve the appearance of this formula
9:22 In this case, the use of dfrac will make the fraction look better.
9:28 In view of this, let us change frac to dfrac.
9:38 Let me click here. Keep the mouse inside the box.
9:43 Put d here. Done. Save, export.
9:52 Let us compile once again using “pdflatex”
10:03 We get the error message “Undefined control sequence” \dfrac
10:11 LaTeX complains because the command \dfrac is defined in the package “Amsmath” but we have not included it.
10:21 We need to include it in the file maths-bp.tex.
10:27 Let us do it. Let us go to emacs.
10:35 Enter “\usepackage{amsmath}”
10:41 Let us save the file. Let us compile once again. Let me first exit.
10:49 Let me now recompile. Now it compiles.Let us click this.
10:59 We see that the fraction has now come out nicely.
11:03 We have now achieved our objective of learning how to embed mathematical expressions in Xfig
11:11 It is important to note that Xfig does not interpret the LaTeX commands at all.
11:16 The interpretation is done by the “pdflatex” command
11:20 The LaTeX commands have to be correct and consistent at the time of compilation.
11:25 We will now explain how to remove the white space around the figure.
11:31 Let me go to the terminal.
11:33 Let me type the command “pdfcrop maths-bp.pdf” - this is the file we created, into “maths-out.pdf”.
11:53 Pdfcrop says one page written on this file.
11:57 “pdfcrop” takes an input file, trims the space around the figure and writes out the cropped file in the output file.
12:09 “pdfcrop” is already installed in my system.
12:12 If you do not have it, you need to install it first.
12:15 Let us view this output file by the command, “open maths-out.pdf”.
12:29 Let me bring it inside.
12:31 The figure has now become extremely compact.
12:34 The white space that was here has been completely removed.
12:38 We can now insert this into documents.
12:42 Let me close this. Let me close this also. Let me close this also.
12:52 Let me come back to the slides.
12:57 The software “briss” can also be used to crop the white space.
13:01 It is supposed to work on Linux, Mac OS X and also on Windows.
13:08 I have checked its working on Mac OS X. But we will not demonstrate it here.
13:17 We have now come to the end of this tutorial
13:20 We have an assignment for you .Make the diagram created in this tutorial more symmetric and beautiful
13:27 Try out different mathematical expressions
13:30 Try out other options, such as flip and rotate, not covered in the spoken tutorial
13:36 Try to build different diagrams .Explore the library
13:41 Do an internet search and locate information relevant to Xfig
13:47 Useful learning material is available at spoken-tutorial.org. It is here.
14:02 The concept of spoken tutorials is explained in "What is a Spoken Tutorial"
14:09 You may learn LaTeX using the spoken tutorials available here, which I have downloaded in this tab.
14:19 The tutorial on Mathematical Typesetting explains how to create maths in LaTeX
14:29 The tutorial on Tables and Figures explains how to place figures, of the type created in this tutorial, into documents
14:38 This website has a lot of useful information, including, Xfig tutorials. Come back to the slides.
14:53 Spoken Tutorial is a part of the Talk to a Teacher project, supported by the National Mission on Education through ICT (NMEICT), MHRD, Government of India.
15:03 More information on this mission is available at spoken-tutorial.org/NMEICT-Intro
15:12 We welcome your participation and also feedback.
15:16 This is Kannan Moudgalya signing off. Thanks for joining. Goodbye

Contributors and Content Editors

Minal, Nancyvarkey, Pratik kamble, Sandhya.np14