LaTeX Page

# (La)TeX and Graphics

For graphics softwares, see the Helper applications.

## Coerence between text and formula (character and symbols)

Before check coerence between text and pictures, need to keep text coerent to the formula. In general, the picture as considered as additional elemento for document, but the formula are considered as part of document, requrering higjt coerence.
Note that not all fonts has symbols necessary to compose mathematical formulas. Thus need caution for this for document that use formulas. The default font for LaTex is Computer Modern and the AMS symbols (amssymb -- amsfonts is the part of it) is compatible with Computer Modern, as other large kind of additional symbol sets. For almost work, the Computer Modern plus AMS symbols are sufficient to produce text with formula, but remember that not all symbols are compatible with Computer Modcdern, such as Euler symbol fonts (note that the Knuth developed the Concrete font specially to use Euler symbol font).
In the case of times font included by default on LaTeX (PSNFSS), will produce basic formulas (equivalent as LaTeX without additional packages), but the AMS equivalent does not allowed. In way to solve this problem, the txfonts (times) and  pxfonts (palatino) has created, cantainning all characters and symbols equavalent to  Computer Modern + AMS + several additional symbol sets compatible for computer Modern.
Using this, the Computer Modern and Times/Palatino will used to produce any kind of documents, keepping very coerence between text and formulas.
In the other kind of font sets such as Concreta+Euler, will produce mathematical document, if specific symbols are not required. Several font sets available such as bookman, utopia, charter, etc does not included symbols necessary to produce mathematical formulas and it is substituted by Computer Modern or si ilar if necessary. These fonts is only suitable for non mathematical documents that require only simplest formulas. In way to discover if these fonts are suitable for your document, need to perform test, checking the font set used (text, formulas, symbols, etc). the  XeTeX permit to use fonts available on operationg systems and will use very large kind of additional fonts than normal LaTeX, but the caution is similar to the above comments.

## Coerence between pictures and text

### Minimal Exigence

Before thinking on the coerence, need to obtain minimal quality of picture itself. The minimal requirement is to have acpetable picture quality, independent of coerence telative to the text.
In way to obtain picture with quality, use vector graphics editor like inkscape (for illustrations) and dia (diagrams). To produce picture from datsa or expressions,
use apropraite apprications like gnuplot and SciDAVis. If possible, do not use the Office suite (keep in mind that objective of Office suite and scientific applications is very different).
Itf are using bitmap images, use around 600dpi for technical illustrations and 300dpi for pictures without sharpness of drawings 9such as photo realistic images).
The convention is to use solid curves to picture, dotted lines to auxiliar ones, and hatched lines for element in constructions. The importance of elements will differenciated using tickness or color, according to contrast rule. Is recomended to place text in horizontal or vertical without other angles.
The format accepted officially for DVI is the postscript (eps/ps) and for PDF (pdflatex) is the pdf/jpeg/png. In the case of using dvipdfm/dvipdfmx, the format is of the DVI/dvips ones (eps), not of the PDF ones (pdf/jpeg/png).
In way to insert jpeg image on DVI/PS, convert to eps using the imagemagick or similar, performing encapsulation to made acdeptable by LaTeX.
If use file name without extension on \includegraphics and keep picture in the format eps and pdf (or jpeg/png) at same time, will compile to DVI or PDF without problem.

### Standard Coerence

In general, the journal and publishers demands that the font size used inside picture is similar to the body text. When the font size inside picture is same of the document, keep scale change minor than 20%. Instead  the use of width/height, use the scale factor to have this control. In way to keep scale fasctor minor than 20% (0.8 to 1.2), made picture near to the desired size (use comparation with paper size that picture editor normally show) and same font size as the body text.

inserting mathematical formula and/or keepping font coerent: The almost publisher acept the font family of picture different of the body text, the coerence of font family will solved in the same manner to insert formula insidxe picture.
The some of most used ones to perform this is the ise of insscape with textext plugin and the use of psfrag.
• The textext is the additional plugin for inkscape that pwrmit to insert LaTeX text/formula directly into the picture. Using this, will keep same font as the document body and will insert formula and symbol in the esay way. The picture will be exported as eps or pdf. The standard font size used by plugin textext is the 10pt, but will scale as equivalent to 12pt setting scale factor as 1.2. the plugin has option to select preamble file that will contain \usepackage, \newcommand, etc that is inserted on the preamble when create temporary file to pass for LaTeX. After this file is compiled, is converted to apropriate format and inserted directly into the picture. Note that if change picture size when inserting into LaTeX document, the font size change too.
• psfrag: the use psfrag does not depend of the choice of editor vecause it is inserted by LaTeX. For this, put key text inside picture and save as eps, and the command \psfrag{key text}{latex text/formula} inside LaTex document  before \includegraphics perform replacement when convert dvi to ps. The psfrag will used to replace text generated by some applications capable to output postscript, to the apropriate text/formula. Note that some these applications will draw text instead of inserting text, that wlack use of psfrag. One of major advantage of psfrag use, relative to inkscape+textext is the font size that are keeped same as the body document independent of the scale factor used when insert picutre. but remember that the strong scale factor change will change significantly the line tickness. Note that the alignment of text/formula is maded by left botton corner of key text. Noramally the PDF is obtained from latex=>dvips->ps2pdf, but if wanto to compile directly to PDF using pdflatex, wil performed by help of package pstool. The popular xfig for linux use the psfrag solution to insert formula directly into picture (it does not showed as  compiled as in textext of inkscape but will write raw laTex code inside picture), but the use of psfrag inside LaTex document is recomended due to performance and flexibility.
• Others: Use of LaTex command to overwrite picture (using picture environmento) will used for any kind of graphics, but require manual adjustment. Other form is to use picture editor that export directly to LaTex code as the LaTeXDraw (with pstrick package) ou jpgfDraw (for pgf package) that permit to set laTex code inside picture (as in xfig with psfrag). In the case of adding text/formula in generic picture, the easyller ones is to import inside inkscape (more easyller than use of overlapping by picture environment). In the case of esp, use of psfrag will be more suitable than use of inkscape if want only to remove/replace text.

### Hight Coerence

the standard line tickness is the 1pt=1/72 inch that is aproximatelly 0.35mm. In way to keep coerence with text and other pictures, need to keep line tickness. In general, the "scale tools" of picture editor for ilustrations such as inkscape, Adobe Illustrator (comercial), Corel Draw (comercial), etc. change the line tichness too. In the scientific ilustrations, is is the diagram like, isto é., the line tickness is depend of the importance of the element and not of the size of the picture. Thus, the size change need to be performed using only the "node tools", but it is not easy to perform on complex drawings. By this, need to create the apropriate size when drawings. The diagram editor like dia and xfig lack or dificult the use of tols that change line tickness in inapropriate way. The specialized editor for LaTeX such as LaTeXDraw and jpgfDraw permit scale change of element without changing the line tickness, but not all of the editor that export LaTeX code works in this form. Some of this is created to insert mathematical formula inside picture and use LaTex for this. In this case, the coerence of line tickness is not the case.
If want all control, will want to generate picture in the LaTex code. In this case, expected thsat the picture generated by editor is almost human readable/editable. Since large kind of scientific applications support LaTeX code with pstrick, the use of LaTeXDraw help these persons. If understand the pstrick package, will edit the generated code. For example, some apropriate adjustment  of LaTeXDraw's output produce full scalable picture keepping line tickness.

## Graphical package for LaTeX

Depending of the illustrations, need to use apropriate package due to their complexity. Other case is to keep only one source file (no separate picture). Note that the use of graphical package keep hight coerence of picture and body text, but it will prodeuced by use of eps/pdf if performed by cautin.
• picture environment of LaTeX (portability): Is suitable for illustrations that is not much complex. It is compatible with any Tex systems. The picture environment support linhas, circles, rectangles, text, etc. Spport the line tickness too, but not the dotted or hatched ones. The major problem of picture environment in the decade of 1990 is the restriction imposed on radious of circle and line depth. This problem is solved in 2002 by official inclusion of pict2e (before 2002, only virtual ones without functionality is included). The use of pict2e on any TeX after dezember of 2002 produce circles and lines without restrictions. Note that the other kind of picture packages are optional and will not included in small TeX systemas (like commercial PCTeX).
• pstrick (traditional): This is most traditional and very powerfull graphical packages for LaTeX. The large kind of cientific applications will export good code of LaTeX with pstrick. Thus the person that know the pstrick will perform adjustment of theses pictures. Since it is implemented using postscript, the PDF is produced by workflow LaTeX=>DVIPS=>PS2PDF, but will produce PDF directly using pdflatex by help of pstool package. The LaTeXDraw support core set of pstrick package.
• TikZ/pgf (modern):Actually, it is most powerfull package to produce complex illustrations. It is very structured and will compiled by LaTeX (DVI/PS) or by pdflatex (PDF). Has several advanced features to produce illustrations and diagrams. For example, is more powerfull and easy to produce diagram than traditional xypic. In way to produce geometric illustrations, will use intersections like in dynamic geometry applications. Thus, the use of Tikz/pdf is recomended than the pstrick and xypic. Note that the jpgfDraw create picture using only the very small amount of TikZ/pgf.
For graphics softwares, see the Helper Applications.