La. Te. X/Importing Graphics - Wikibooks, open books for an open world. There are two possibilities to include graphics in your document. Either create them with some special code, a topic which will be discussed in the Creating Graphics part, (see Introducing Procedural Graphics) or import productions from third party tools, which is what we will be discussing here. Strictly speaking, La. Te. X cannot manage pictures directly: in order to introduce graphics within documents, La. Te. X just creates a box with the same size as the image you want to include and embeds the picture, without any other processing. This means you will have to take care that the images you want to include are in the right format to be included. This is not such a hard task because La. Te. X supports the most common picture formats around. Raster graphics vs. Please also visit my page of useful and free TeX/LaTeX utilities. Note that dvii does not alter the dvi file in any way. You can download the file dvii.c. LaTeX Tutorial Introduction. In order to create a document in LaTeX, a.tex file must be created using some form of text editor. Texmaker, free cross-platform latex. Build Profiles 'LaTeX -> HTML' and. I could not locate a file or folder called texmf. LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt. The result may be even worse once printed. Most drawing tools (e. So you should always prefer PDF or EPS to PNG or JPG. The graphicx package. Still, just in case you want to understand better how it works, here are the possible options you can pass to the package: dvips (default if compiling with latex), if you are compiling with latex to get a DVI and you want to see your document with a DVI or PS viewer. LaTeX Equations and Graphics in PHP. TeX free TeX software available. Download not only the. Posting your dvi or tex file on the web is not. DVI that you want to convert to PDF using dvipdfm, to see your document with any PDF viewer. PDF that you will see with any PDF viewer. But, again, you don't need to pass any option to the package because the default settings are fine in most of the cases. In many respects, importing your images into your document using La. Te. X is fairly simple.. Therefore, I fear for many people the biggest effort will be the process of converting their graphics files. Now we will see which formats we can include and then we will see how to do it. The number printed by this file is the total memory free; it is usually best to tell Dvips that. Dvips will not download. Document Options. Using final will result in the image being placed in the output file. The default is final. Supported image formats. Now you want to compile it in DVI, you run latex and you get a lot of errors.. This is true, as long as you don't use particular packages, and graphicx is one of those. In any case, you can still use both compilers with documents with pictures as well, as long as you always remember to provide the pictures in two formats (EPS and one of JPG, PNG or PDF). Compiling with latex. Because an EPS file declares the size of the image, it makes it easy for systems like La. Te. X to arrange the text and the graphics in the best way. EPS is a vector format. It is also possible to store bit- map pictures within EPS, but they will need a lot of disk space. Compiling with pdflatex. You can insert: JPG, widely used on Internet, digital cameras, etc. They are the best choice if you want to insert photos. PNG, a very common format (even if not as much as JPG); it's a lossless format and it's the best choice for diagrams (if you were not able to generate a vector version) and screenshots. PDF, it is widely used for documents but can be used to store images as well. It supports both vector and bit- map images, but it's not recommended for the latter, as JPG or PNG will provide the same result using less disk space. EPS can be used with the help of the epstopdf package. Depending on your installation. Additionally, since epstopdf will need to convert the EPS file into a PDF file and store it, you need to give . This is done by adding an option to the compiling command, e. La. Te. X editor, they usually allow to modify the command in the configuration options). Check the epstopdf documentation for other compilers. Including graphics. After you have loaded the graphicx package in your preamble, you can include images with \includegraphics, whose syntax is the following: \includegraphics. Write it without the extension. This way the La. Te. X compiler will look for any supported image format in that directory and will take the best one (EPS if the output is DVI; JPEG, PNG or PDF if the output is PDF). Images can be saved in multiple formats for different purposes. For example, a directory can have . You can specify which image file is to be used by pdflatex through the preamble command: \Declare. Graphics. Extensions. Only specifying either width or height will scale the image while maintaining the aspect ratio. Specify the preferred height of the imported image to xx. This can be set to either true or false. When true, it will scale the image according to both height and width, but will not distort the image, so that neither width nor height are exceeded. Scales the image by the desired scale factor. Where l, b, r and t are lengths. For the trim option to work, you must set clip=true. If the image file is a pdf file with multiple pages, this parameter allows you to use a different page than the first. Specify image resolution in dpi. In order to use more than one option at a time, simply separate each with a comma. The order you give the options matters. E. g you should first rotate your graphic (with angle) and then specify its width. Included graphics will be inserted just there, where you placed the code, and the compiler will handle them as . As we will see in the floats section, this can disrupt the layout; you'll probably want to place graphics inside floating objects. Also note that the trim option does not work with Xe. La. Tex. Be careful using any options, if you are working with the chemnum- package. The labels defined by \cmpdref. Scaling the image for instance may be done by \scalebox instead. The star version of the command will work for . For a more portable solution, the standard way should take precedence. The star command will take the crop dimension as extra parameter: \includegraphics*. Here are some examples. Say you had a file 'chick. This simply imports the image, without any other processing. However, it is very large (so we won't give an example of how it would look here!) So, let's scale it down: \includegraphics. If you wish to be more specific and give actual lengths of the image dimensions, this is how to go about it: \includegraphics. You can control the thickness of the border by adjusting the \setlength\fboxrule. The \graphicspath command takes one argument, which specifies the additional paths you want to be searched when the \includegraphics command is used. Here are some examples (trailing / is required): \graphicspath. In the third example shown there should be a directory named . The fourth example uses the . Again, ensure file names do not contain spaces or alternatively if you are using PDFLa. Te. X, you can use the package grffile which will allow you to use spaces in file names. Note that you cannot make the graphicx package search directories recursively. Under Linux/Unix, you can achieve a recursive search using the environment variable TEXINPUTS, e. TEXINPUTS=./images//./Snapshots//. Te. X- IDE. We will only give a short preview of figures here. More information on the figure environment and how to use it can be found in Floats, Figures and Captions. There are many scenarios where you might want to accompany an image with a caption and possibly a cross- reference. This is done using the figure environment. The following code sample shows the bare minimum required to use an image as a figure.\begin. The following code sample shows an extended use of the figure environment which is almost universally useful, offering a caption and label, centering the image and scaling it to 8. There are still some workarounds though. The easiest solution is to use the picture environment and then simply use the . For example: \setlength. See #Third- party graphics tools. For a perfect integration of graphics, you might consider procedural graphics capabilities of some La. Te. X packages like Tik. Z or PSTricks. It lets you draw from within a document source. While the learning curve is steeper, it is worth it most of the time. Including full PDF pages. It is capable of inserting entire pages as is and more pages per one page in any layout (e. The package has several options: \usepackage. This is the default. Does not insert pages, but prints a box and the filename instead. Activates survey functionalities. The argument is a comma separated list, containing page numbers (pages=. To insert empty pages use . Page ranges are specified by the following syntax: m - n. This selects all pages from m to n. Omitting m defaults to the first page; omitting n defaults to the last page of the document. Another way to select the last page of the document, is to use the keyword last. Example: angle=9. Adds an entry to the list of figures, the list of tables, or any other list (e. This option requires four arguments, separated by commas. This label can be referred to with \ref and \pageref. Like addtotoc, addtolist accepts multiple sets of the above mentioned four arguments, all separated by commas. The proper recursive definition is: addtolist=. See more information in its documentation. Converting graphics. This tool is actually called by pdflatex to convert EPS files to PDF in the background when the graphicx package is loaded. This process is completely invisible to the user. You can batch convert files using the command- line. In Bourne Shell (Unix) this can be done by. However, on the downside, the fonts are NOT converted to lines, but instead to bitmaps, which reduces the quality of the fonts. JPG, PNG, ..) and EPS/PS files. Inkscape. Inkscape can also convert files from and to several formats, either from the GUI or from the command- line. For instance, to obtain a PDF from a SVG image you can do. D - -file=input. svg - -export- pdf=output. It is possible to run this from within a La. Te. X file, the Template: La. Te. X/package package (when running (pdf)latex with the - -shell- escape option) can do this using Inkscape's pdf+tex export option, or a simple macro can be used. See How to include SVG diagrams in La. Te. X? For instance, to get an Xfig- editable file, do. And to get an SVG file (editable with any vector graphics tool like Inkscape) you can do. La. Te. X/Export To Other Formats - Wikibooks, open books for an open world. Strictly speaking, La. Te. X source can be used to directly generate two formats: DVI using latex, the first one to be supported; PDF using pdflatex, more recent. Using other software freely available on Internet, you can easily convert DVI and PDF to other document formats. In particular, you can obtain the Post. Script version using software which is included in your La. Te. X distribution. Some La. Te. X IDE will give you the possibility to generate the Post. Script version directly (even if it uses internally a DVI mid- step, e. It is also possible to create PDF from DVI and vice versa. It doesn't seem logical to create a file with two steps when you can create it straight away, but some users might need it because, as you remember from the first chapters, the format you can generate depends upon the formats of the images you want to include (EPS for DVI, PNG and JPG for PDF). Here you will find sections about different formats with description about how to get it. Other formats can be produced, such as RTF (which can be used in Microsoft Word) and HTML. However, these documents are produced from software that parses and interprets the La. Te. X files, and do not implement all the features available for the primary DVI and PDF outputs. Nonetheless, they do work, and can be crucial tools for collaboration with colleagues who do not edit documents with La. Te. X. Tools installation. If you have the choice, it is often easier with Unix systems for command line tools. Some tools may already be installed. For instance, you can check if dvipng is installed and ready to use (Unix only). Most of these tools are installable using your package manager or portage tree (Unix only). Preview mode. Screenshots are useful, for example, if you want to include a La. Te. X generated formula on a presentation using you favorite slideware like Powerpoint, Keynote or Libre. Office Impress. First, start by making sure you have preview. See Installing Extra Packages. Say you want to take a screenshot of. Without any of these two, you won't get any output. This package is also very useful to export specific parts to other format, or to produce graphics (e. You can also automate the previewing of specific environments: \usepackage. Another way is to pass through PS generation. You need to have Ghostscript installed: Using Windows. This program may be avaliable in your Linux distribution's repository. Another option to check out is pdftk (or PDF toolkit), which is a command- line tool that can manipulate PDFs in many ways. To merge one or more files, use. Using pdf. La. Te. X. They include options to merge several pdf files (pdfjoin), put several pages in one physical sheet (pdfnup) and rotate pages (pdf. See also Modular Documents. You can also use Xe. Te. X (or, more precisely, Xe. La. Te. X), which works in the same way as pdflatex: it creates a PDF file directly from La. Te. X source. One advantage of Xe. Te. X over standard La. Te. X is support for Unicode and modern typography. See its Wikipedia entry for more details. Customization of PDF output in Xe. Te. X (setting document title, author, keywords etc.) is done using the configuration of hyperref package. PDF. pdf. 2ps my. This conversion is done through latex. Windows, Linux and BSD, with the last mac update being from 2. The program operates by reading the La. Te. X source, and mimicking the behaviour of the La. Te. X program. As well, it has some limited support for packages, such as varioref, and natbib. However, many other packages are not supported. The Windows version has a GUI (l. The command- line version is offered for all platforms, and can be used on an example mypaper. Both latex and (if needed) bibtex commands need to be run beforelatex. The result of this conversion will create myfile. Microsoft Word or Libre. Office. Convert to HTML. Some of them use an intermediate file which then will be converted to the destination format. HEVEA. hevea mylatexfile. It is designed as a general PDF to HTML converter, not only restricted to the PDF generated by La. Te. X source. La. Te. X users can compile the La. Te. X source code to PDF, and then convert the PDF to HTML via pdf. EX. Some introductions of pdf. EX can be found on its own wiki page. More technical details can be found on the paper published on TUGboat: Online publishing via pdf. EXHTML / PDF. The Figure 3 of the paper gives different work- flows of publishing HTML online. Te. X4ht. Te. X4ht is a very powerful conversion program, but its configuration is not straightforward. Basically a configuration file has to be prepared, and then the program is called. Te. X4ht does not convert the source files directly but processes the . For exporting the Bib. Te. X file only. SVG is a vector format. Raster graphics define every pixel explicitly. PNG is a raster format. So vector graphics are usually preferred. There is still some cases where raster graphics are used: The target system does not handle vector graphics, only raster graphics are supported. SVG can not embed fonts. So either the font will be rendered using a local . This last method makes the SVG big and slow. If the input La. Te. X file contains a lot of text which formatting must be preserved, SVG is not that great. So SVG is great for drawings and a small amount of text. JPG is a well known raster formats, however it is usually not as good as PNG for text. In some cases it may be sufficient to simply copy a region of a PDF (or PS) file using the tools available in a PDF viewer (for example using La. Te. X to typeset a formula for pasting into a presentation). This however will not generally have sufficient resolution for whole pages or large areas. Multiple formats. It will ask you which page you want to convert, whether you want to use anti- aliasing (choose strong if you want to get something similar to what you see on the screen). Try different resolutions to fit your needs, but 1. Once you have the image within GIMP, you can post- process it as you like and save it to any format supported by GIMP, as PNG for example. A method for DVI files is dvipng. Usage is the same as dvipdfm. Run latex as usual to generate the dvi file. Now, we want an X font size formula, where X is measure in pixels. You need to convert this, to dots per inch (dpi). The formula is: < dpi> = < font. If you want, for instance, X = 3. This value will be passed to dvipng using the flag - D. To generate the desired png file run the command as follows. T tight - D 2. 31. The flag - T sets the size of the image. The option tight will only include all ink put on the page. The option - o sends the output to the file name foo. Image. Magick. The convert command from the Image. Magick suite can convert both DVI and PDF files to PNG. It can handle multi- file projects, so all you need is to give one command. This will output result to standard output. If you want the plain text go to a file, use. If the output from detex does not satisfy you, you can try a newer version available on Google Code, or use HTML conversion first and then copy text from your browser. If you want to keep the formating, you can use a DVI- to- plain text converter, like catdvi. Example. catdvi yourfile.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |