LaTeX: Difference between revisions

From miki
Jump to navigation Jump to search
 
Line 1: Line 1:
== Importing MS Visio Graphics in LaTeX ==
== Importing MS Visio Graphics in LaTeX ==
=== Method 1: Using OpenOffice Draw ===
This procedure creates from a '''Visio''' drawing, a '''PDF''' file that has the correct page dimension in order to be directly imported in a LaTeX document. This procedure requires to have '''OpenOffice Draw''' installed.
This procedure creates from a '''Visio''' drawing, a '''PDF''' file that has the correct page dimension in order to be directly imported in a LaTeX document. This procedure requires to have '''OpenOffice Draw''' installed.
* In Visio, '''File → Save As''', select type '''Enhanced Metafile (.emf)''', enter a file name, click '''Save'''.
* In Visio, '''File → Save As''', select type '''Enhanced Metafile (.emf)''', enter a file name, click '''Save'''.
Line 5: Line 6:
* '''Check the box ''Selection''''', select format '''EPS - Encapsulated PostScript (.eps)''', save the file.
* '''Check the box ''Selection''''', select format '''EPS - Encapsulated PostScript (.eps)''', save the file.
* '''Press OK''', to accept all default options (''no preview, Level 2, Grayscale, no compression'')
* '''Press OK''', to accept all default options (''no preview, Level 2, Grayscale, no compression'')
* In a shell, type the command
* In a shell, type the LaTeX command
<source lang="bash">
<source lang="bash">
epstopdf <filename.eps>
epstopdf <filename.eps>
</source>
</source>
which will create a file <tt><filename.pdf></tt> with the correct page size.
which will create a file <tt><filename.pdf></tt> with the correct page size.

;Limitations
:Some line formats are not correctly rendered by ''OpenOffice Draw'' when exporting to '''EPS''' format.

=== Method 2: Using Custom PostScript Page Size ===
This procedure can be used to solve problem in the 1st method where some line formats are not correctly rendered in the EPS. This procedure requires to have a PDF printer installed, such as [http://www.primopdf.com/ PrimoPDF].
* In Visio, select the drawing to print, and '''copy-paste it into a new document'''.
* Go to menu '''File &rarr; Page Setup'''
** Go to '''Page Size''' panel
** Select '''Size to fit drawing contents''', and note the page size as computed by Visio
* Go to '''Print Setup''' panel
** Click on Printer Paper '''Setup'''
** Click on '''Printer...'''
** '''Select''' the PDF printer, and click on '''Properties...'''
** Click on '''Advanced...'''
** For Paper size, select '''PostScript Custom Page Size''', then click on '''Edit Custom Page Size'''
** Select unit '''Millimeter''', and then in '''Width''' and '''Height''', enter the same size as computed by Visio, '''plus 1 or 2mm'''.
* Click '''Ok''' buttons until back in the '''Print Setup''' dialog. Set '''Left''', '''Right''', '''Top''' and '''Bottom margin''' to be '''0mm''', and select '''Center horizontally''' and '''Center vertically'''.
* If necessary, '''move the drawing''' so that it fits perfectly in the middle of the page.
* '''Print''' the document.
The result is a PDF document with the best output quality and the correct dimension.

;Limitations
:Sometimes text police are rasterized.

Revision as of 21:21, 23 October 2008

Importing MS Visio Graphics in LaTeX

Method 1: Using OpenOffice Draw

This procedure creates from a Visio drawing, a PDF file that has the correct page dimension in order to be directly imported in a LaTeX document. This procedure requires to have OpenOffice Draw installed.

  • In Visio, File → Save As, select type Enhanced Metafile (.emf), enter a file name, click Save.
  • In OpenOffice Draw, Open the newly saved file, Select the drawing with the mouse, and then go to menu File → Export.
  • Check the box Selection, select format EPS - Encapsulated PostScript (.eps), save the file.
  • Press OK, to accept all default options (no preview, Level 2, Grayscale, no compression)
  • In a shell, type the LaTeX command
epstopdf <filename.eps>

which will create a file <filename.pdf> with the correct page size.

Limitations
Some line formats are not correctly rendered by OpenOffice Draw when exporting to EPS format.

Method 2: Using Custom PostScript Page Size

This procedure can be used to solve problem in the 1st method where some line formats are not correctly rendered in the EPS. This procedure requires to have a PDF printer installed, such as PrimoPDF.

  • In Visio, select the drawing to print, and copy-paste it into a new document.
  • Go to menu File → Page Setup
    • Go to Page Size panel
    • Select Size to fit drawing contents, and note the page size as computed by Visio
  • Go to Print Setup panel
    • Click on Printer Paper Setup
    • Click on Printer...
    • Select the PDF printer, and click on Properties...
    • Click on Advanced...
    • For Paper size, select PostScript Custom Page Size, then click on Edit Custom Page Size
    • Select unit Millimeter, and then in Width and Height, enter the same size as computed by Visio, plus 1 or 2mm.
  • Click Ok buttons until back in the Print Setup dialog. Set Left, Right, Top and Bottom margin to be 0mm, and select Center horizontally and Center vertically.
  • If necessary, move the drawing so that it fits perfectly in the middle of the page.
  • Print the document.

The result is a PDF document with the best output quality and the correct dimension.

Limitations
Sometimes text police are rasterized.