Paul Kiddie

Including Visio diagrams in LyX documents

March 03, 2010

If you want to be able to include Visio drawings within your LyX documents, the process is relatively painless as you can export the drawing as a PDF and embed the PDF directly into the document.

First, create your diagram in Visio as normal. Then, click File > Page Setup, select the Page Size tab and click the radio button entitled ‘Size to fit drawing contents’:

visio-size-to-fit-drawing-contents

The bounding box will shrink to fit your drawing, which makes for easier positioning within LyX as you won’t have any whitespace issues arising from borders from your drawing.

If you are using Visio 2007, and have the Save as PDF or XPS plugin installed, you may go directly to File > Publish as PDF or XPS and save the diagram as a PDF. If you are using Visio 2003, or 2007 but do not have the plugin, then you can install a PDF printer, such as CutePDF (just go for whatever you’re most comfortable with) and File > Print directly to the PDF printer.

Within LyX, the process of embedding this PDF into your document is really easy. Click Insert > Graphics, browse for the PDF file and optionally set the scale or width and height to suit. LyX will render a preview of the image within the document and when you compile it to a DVI/PDF, you should see the Visio drawing output inline with the text.


👋 I'm Paul Kiddie, a software engineer working in London. I'm currently working as a Principal Engineer at trainline.