Embed Graphics
Learn how to embed graphics and customize their appearance within Neural Sketch blocks.
Introduction
Embedding graphics in your diagrams enhances visual expressiveness and clarity, allowing you to effortlessly integrate images, illustrations, or external content. Neural Sketch provides two convenient embedding mechanisms: gfx embedding and custom embedding.
Universal Raster Embedding
Neural Sketch offers robust, universal raster embedding features capable of automatically adapting graphics to any block shape. It also supports precise cropping, clipping, and customization to fit your exact diagramming needs.
Quick Usage
Use the embed-gfx
key to quickly insert and automatically scale graphics to fit block dimensions:
For advanced control, the embed
key allows you to directly inject custom TikZ commands:
Embedding Graphics
Below are examples showcasing how to use embedding effectively.
Simple Graphic Embed
Embed and scale graphics directly using a straightforward, one-line syntax:
Comparison of Embed Types
Here's a comprehensive example illustrating both raw and gfx embeddings:
Embedding in Custom Shapes
Neural Sketch automatically adapts embedded graphics to various block shapes. Here’s how graphics seamlessly fit into different geometrical primitives:
Customizing Padding
Control the spacing between your embedded graphics and block boundaries using embed-padding
:
Here's a practical demonstration:
Customizing Border Radius
Adjust the rounding of corners for embedded content using embed-border-radius
:
A visual example:
Reference
Prop | Type | Default |
---|---|---|
embed-gfx? | string | {} |
embed? | TikZ code | {} |
embed-padding? | dimension | 1mm |
embed-border-radius? | dimension | 1.3mm |
Best Practices
- Use gfx embedding for quick, proportional scaling.
- Choose raw embedding for granular control of dimensions and alignment.
- Consistently adjust padding and border-radius to achieve visual harmony.