Building smart diagrams

\documentclass{article}
\usepackage{smartdiagram}
\begin{document}
\smartdiagram[flow diagram:horizontal]{Edit,
\LaTeX, Bib\TeX/ biber, make-index, \LaTeX}
\end{document}
Compile, and take a look at the output, a flowchart of a TeX workflow:
在这里插入图片描述

A simple call of \smartdiagram plus arguments produced the image. The syntax of the command is as follows:

\smartdiagram[type of diagram]{list of items}

We chose a horizontal flow diagram. Use only flow diagram to get a vertical layout. There’s a specific set of diagram types. Instead of just listing them, let’s perform some examples to take a look at the results.

There’s more…
We can play a bit with diagram type and items to get different diagrams. If there’s a root item or a central item, it’s always the first in the list.

Circular diagram
Let’s try a circular diagram. It is counterclockwise by default. Add :clockwise to the option to get a clockwise order:

\smartdiagram[circular diagram:clockwise]{Edit,
  pdf\LaTeX, Bib\TeX/ biber, make\-index, pdf\LaTeX}

The following figure shows the circular diagram:

Circular flowchart

Bubble diagram
To simply present some words in the main context, you can use a bubble diagram. The first item of the list is in a central circle. All other items are placed in colored circles around it. They are slightly overlapping so as to visualize a close relation.

To get macros for more TeX logos, we will load the dtklogos package in addition, so add this to the preamble:

\usepackage{dtklogos}

Alternatively, you can use the metalogo package, which gives logo commands such as \XeTeX. Combining strings by writing Lua\TeX instead would be another idea.

The smartdiagram call becomes this:

\smartdiagram[bubble diagram]{\TeX\ engines,
  \TeX\ (dvi), pdf\TeX, \XeTeX, \LuaTeX, \ConTeXt}

Bubble diagram

Constellation diagram
A slightly different form is given by a constellation diagram. In it, each item is in a colored circle connected to the center, which is again the first item:

\smartdiagram[constellation diagram]{\TeX\ software,
  Editor, Compiler, Converter, PDF Reader}

Constellation diagram

Descriptive diagram
For nicely arranging items with a description, there’s the descriptive diagram. The item is a list of small lists, as a consequence. We use additional curly braces to hide the comma within an item so that it won’t be taken as an item separator:

\smartdiagram[descriptive diagram]{
  {Style,{Define shapes, colors, shading,
          and line styles for nodes and arrows}},
  {Position, {Place nodes using a matrix,
              relative or absolute positioning}},
  {Relation, Insert edges or arrows
             between selected nodes},
  {Label, Add labels on edges or arrows}}

This gives us the following diagram:

Descriptive diagram

Priority descriptive diagram
If your descriptive diagram has a certain order and you would like to emphasize that order, use a priority descriptive diagram, like this:

\smartdiagram[priority descriptive diagram]{
  Develop a document structure,
  Choose a document class,
  Select suitable packages,
  Setup the document preamble,
  Write your document,
  Finetune the layout}

Priority descriptive diagram

Animating a diagram
In a presentation done with the beamer class, you can easily animate such a diagram. It’s as simple as:

Using the beamer class
Using a frame environment for the diagram
Writing \smartdiagramanimated instead of \smartdiagram
This, applied to one of the examples you saw earlier, results in the following:

\documentclass{beamer}
\usepackage{smartdiagram}
\begin{document}
\begin{frame}
  \smartdiagramanimated[circular diagram]{Edit,
  pdf\LaTeX, Bib\TeX/ biber, make\-index, pdf\LaTeX}
\end{frame}
\end{document}

The diagram will then be built step by step, frame by frame.

Further customization
Of course, you can set the colors and shapes of all elements. For details, refer to the smartdiagram manual, as usual via texdoc, or online at http://texdoc.net/pkg/smartdiagram.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值