Edit Links |
Tips /
UseDrawioFilesDirectlyInLyXCategories: Tips << | Page list | >>How to use an external template to include draw.io files in LyX. Table of contents (hide)
1. Descriptiondraw.io(approve sites) is a free, open-source, and secure web-based diagramming software used to create flowcharts, network diagrams, UML, and organizational charts. It operates in browsers or as a desktop app. This page explains the way to integrate LyX with a desktop version of draw.io which can be downloaded from here. 2. Preparation2.1 Install an external templateOpen an editor to fill in the following contents and save it as #
# Draw.io External Template
#
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# author Koji Yokota
#
# Full author contact details are available in file CREDITS.
Template Draw.io
GuiName "Draw.io diagram"
HelpText
Draw.io diagram.
Draw.io provided as a browser-based and also as a stand-alone application.
This template uses a stand-alone program so please make it ready before using this template.
Included file will be cropped to the size of the diagram.
HelpTextEnd
InputFormat drawio
FileFilter "*.drawio"
AutomaticProduction true
# LyX has hard-coded support for these transformations
Transform Rotate
Transform Resize
Transform Clip
Transform Extra
Preview Graphics
Format LaTeX
TransformOption Rotate RotationLatexOption
TransformOption Resize ResizeLatexOption
TransformOption Clip ClipLatexOption
TransformOption Extra ExtraOption
Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
# This string is what is output to the LaTeX file.
Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
UpdateFormat pdf6
UpdateResult "$$AbsPath$$Basename.pdf"
Requirement "graphicx"
ReferencedFile latex "$$AbsPath$$Basename.pdf"
ReferencedFile dvi "$$AbsPath$$Basename.pdf"
FormatEnd
Format PDFLaTeX
TransformOption Rotate RotationLatexOption
TransformOption Resize ResizeLatexOption
TransformOption Clip ClipLatexOption
TransformOption Extra ExtraOption
Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
UpdateFormat pdf6
UpdateResult "$$AbsPath$$Basename.pdf"
Requirement "graphicx"
ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
FormatEnd
Format Ascii
Product "[Draw.io: $$FName]"
FormatEnd
Format DocBook
Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.png\"></graphic>"
UpdateFormat eps
UpdateResult "$$AbsPath$$Basename.png"
ReferencedFile docbook "$$AbsPath$$Basename.png"
ReferencedFile docbook-xml "$$AbsPath$$Basename.png"
FormatEnd
Format XHTML
Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
UpdateFormat svg
UpdateResult "$$AbsPath$$Basename.svg"
ReferencedFile xhtml "$$AbsPath$$Basename.svg"
FormatEnd
TemplateEnd
2.2 Add a file format
Format: Draw.io
Short name: drawio
Extension: drawio
MIME: application/x-draw.io-diagram
2.3 Add a converter
3. Insert a draw.io file
4. Edit
5. Categories |