LaTeX Font-consistent Diagrams Using Dia

Ensuring that manuscripts I produce using LaTeX have a consistent font throughout the document has been a long-held obsession of mine. The majority of documents I produce typically contain block diagrams which I almost always generate using third-party tools. One of the problems, however, with integrating LaTeX documents with input files (typically JPG, PNG, EPS et al.) from these external tools is that of ending up with a final output that has inconsistent fonts.

I have been experimenting with TikZ [1] and PSTricks [2], but with their steep learning curves, I was forced to look for quick fixes. While I religiously started using LaTeXDraw [3] in the not so distant past, I recently discovered that Dia [4] can export diagrams as LaTeX PGF macros. Here is how I integrate PGF Macros into LaTeX documents.

  • Draw Dia diagram
  • Export output as LaTeX PGF macro (.tex extension)
  • Use ‘tikz’ package in LaTeX preamble

LaTeX Minimal Example


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\title{\textbf{\LaTeXe font-consistent diagrams using Dia}}
\author{Munthu}
\date{}
\begin{document}
\maketitle
\section{A minimal example}
You will notice that the fonts used in Figure \ref{fig:latex_dia_integration} are consistent with the document.
\begin{figure}[hb]
\begin{center
}
\framebox[0.90\textwidth]{%
\input{dia_latex_block_diagrams.tex}
}
\end{center}
\caption[]{\label{fig:latex_dia_integration} A sample font-consistent figure
}
\end{figure}
\end{document
}

Final PDF Output

LaTeX font-consistent diagrams using Dia

LaTeX font-consistent diagrams using Dia

Reference

[1] http://www.texample.net/tikz
[2] http://tug.org/PSTricks/main.cgi
[3] http://latexdraw.sourceforge.net
[4] http://live.gnome.org/Dia

Categories: General
Tags: , ,
  • Anonymoose.

    Relevant, clear, and to the point. Thanks!

  • Vlademiro Landim

    Thanks for sharing. This information Solve my problem.