This shows you the differences between two versions of the page.

3.1.1:formula_editor [2009/12/16 15:14]
Stephan Tittel
3.1.1:formula_editor [2010/09/16 13:13] (current)
Line 1: Line 1:
 +====== Formula Editor ======
 +<box 230px right round blue>{{.:screenshots:formula_editor.png?200|formula editor}}</box|Screenshot: Formula Editor>
 +The formula editor lets you make use of the typesetting language [[wp>LaTeX]] to generate arbitrary images. In fact, generating mathematical formulas is just a subset of the possibilities offered by LaTeX. It is also possible e.g. to create flowcharts, tables or even vector graphics - see the examples below for example code and the resulting images. To use the formula editor you don't need to have a LaTeX distribution installed on your computer since the docendo server takes care of interpreting the code.
 +Please see the [[#external_links|external links]] section on this page to get a more in-depth documentation and tutorials about LaTeX itself.
 +===== Document structure =====
 +LaTeX structures an input document into a "preamble" and the content part of the document. Within the preamble, the interpreter is configured e.g. to import specific stylesheets for content generation or to set metadata about the document. Because docendo generates the preamble for you, you can just enter the content part of the document in the editor's text box. For the sake of completeness, here is what the generated preamble looks like:
 +--> the code from the editor's textbox comes here <--
 +The foreground and background color definitions are read from your docendo installation's content layout settings and put into the preamble so that the generated image visually aligns with other content.
 +===== Image resolution =====
 +The exact size of the generated image can not be configured from the formula editor - it is completely up to the LaTeX interpreter to decide on the concrete image dimensions based on the given image resolution. The image resolution parameter's unit is [[wp>Dots_per_inch|DPI]] (dots per inch) which will influence the image size. The higher the value the larger will be the generated image. The default value of 120 is suited for most applications, but you may vary the value to get a satisfying result.
 +===== Toolbar =====
 +<box 312px left round blue|Formula Editor: Toolbar>
 +|  {{.:icons:save.gif}}  | Save formula |
 +|  {{.:icons:save_exit.gif}}  | Save formula and exit formula editor |
 +|  {{.:icons:dont_save_exit.gif}}  | Exit formula editor without saving |
 +|  {{.:icons:preview_plus.gif}}  | Preview resulting image |
 +===== Example 1: Formula =====
 +=== Code: ===
 +{\frac {d}{dx}}\arctan(\sin({x}^{2}))=-2\,{\frac {\cos({x}^{2})x}{-2+
 +\left (\cos({x}^{2})\right )^{2}}}
 +=== Resulting image: ===
 +<box 324px left round blue>{{.:screenshots:formula_editor_example1.png}}</box>
 +===== Example 2: Flowchart =====
 +=== Code: ===
 +\setlength {\unitlength}{1cm}
 +\begin{picture}(14,17) %Grösse des Diagramms, hier 14x17cm
 +\put(3,15){\makebox(0,0) {\bfseries Material and Thermal Properties}}
 +\put(3,14.6){\makebox(0,0) {\bfseries (Rate of Heat Gain/Loss within Volume Element)}}
 +\put(3,14.2){\makebox(0,0) {density $\rho$}}
 +\put(3,13.8){\makebox(0,0) {specific heat $c_p$}}
 +\put(13,15){\makebox(0,0) {\bfseries Net Heat Flow In or Out of Volume Element}}
 +\put(13,14.6){\makebox(0,0) {\bfseries  (Gain/Loss of Heat per Unit Volume)}}
 +\put(1,12){\framebox(4,1){\large $q=c_p a \rho \frac{\delta T}{\delta t} \delta z$ }}
 +\put(11,12){\framebox(4,1){\large $q=-a\frac{\partial q}{\partial z}\delta z$ }}
 +\put(13,12){\vector(-3,-1) {4}}
 +\put(4,9.5){\framebox(8,1 ){$c_p a \rho \frac{\delta T}{\delta t} \delta z = -a\frac{\partial q}{\partial z}\delta z$ }}
 +\put(8,9.5){\vector(0,-1) {2}}
 +\put(8.7,8.5){\vector(-1,0) {.5}}
 +\put(11,8.7){\makebox(0,0) {cancel $a \delta z$ on both sides}}
 +\put(11,8.3){\makebox(0,0) {limiting case ($\delta t, \delta z \rightarrow 0$)}}
 +\put(4,6.4){\framebox(8,1 ){$c_p \rho \frac{\partial T}{\partial t} = -\frac{\partial q}{\partial z}$ }}
 +\put(8,6.4){\vector(0,-1) {2}}
 +\put(8.7,5.4){\vector(-1,0) {.5}}
 +\put(11,5.4){\makebox(0,0) {Fourier's law $q(z)=-k\frac{\partial T}{\partial z}$}}
 +\put(4,3.3){\makebox(8,1 ){$c_p \rho \frac{\partial T}{\partial t} = k \frac{\partial^2 T}{\partial z^2}$ }}
 +\put(4,2){\framebox(8,1 ){\Large $\frac{\partial T}{\partial t} = \frac{k}{c_p \rho} \frac{\partial^2 T}{\partial z^2}=\kappa \frac{\partial^2 T}{\partial z^2} $ }}
 +\put(4,1){\makebox(8,1 ){\large \bfseries one-dimensional heat conduction equation }}
 +=== Resulting image: ===
 +<box 878px left round blue>{{.:screenshots:formula_editor_example2.png}}</box>
 +===== Example 3: Table =====
 +=== Code: ===
 + &Heat Generation in $\mu~\mathrm{W~m^{-3}}$ \\
 +\textbf{Granite} & 2.5\\
 +\textbf{Tholeiitic Basalt} & 0.08\\
 +\textbf{Alkali Basalt} & 0.5\\
 +\textbf{Peridotite} & 0.006\\
 +Average Continental Upper Crust & 1.8\\
 +Average \textbf{Continental Crust} & 0.7\\
 +Average \textbf{Oceanic Crust} & 0.5\\
 +\textbf{Undepleted Mantle} & 0.02\\
 +From \emph{Fowler 2005}
 +=== Resulting image: ===
 +<box 525px left round blue>{{.:screenshots:formula_editor_example3.png}}</box>
 +===== External links =====
 +  * [[http://www.latex-project.org/|LaTeX home page]]
 +  * [[wp>LaTeX|Wikipedia about LaTeX]]
 +  * [[http://crab.rutgers.edu/~karel/latex/class4/class4.html|Tutorial: Mathematics in LaTeX]]
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki