Embed Graphics
Learn how to embed graphics and customize their appearance within Neural Sketch blocks.
Introduction
Neural Sketch makes it simple to place images inside blocks—as native parts of your diagrams. You can inject anything from icons to plots, screenshots to schematics—using just one line of code.
There are two modes:
- GFX embed — quick image injection, auto-scaled to fit
- Custom embed — full manual control via raw
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 commands:
For instance a node
with includegraphics
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:
Explore Available Shapes
Want to see which shapes you can embed into? Head over to the Basic Styles guide—it covers every supported primitive, from rectangles and circles to diamonds and trapezoids.
Fine-Tuning Padding
Control the spacing between your embedded graphics and block boundaries using embed-padding
:
Here's a practical demonstration:
Rounding the Embed
You can round the embedded content corners using embed-border-radius
. This value mirrors the block’s own corner radius unless set manually.
A visual example:
Design Tip
To maintain visual harmony between the block and its embedded graphic,
consider offsetting their radii. For instance, if the inner (embedded)
radius is set to 3mm
, using 4mm
or more for the outer block’s corner
radius helps preserve a smooth, nested feel—especially in rounded or layered
designs.
Reference Table
Prop | Type | Default |
---|---|---|
embed-gfx? | string | {} |
embed? | TikZ code | {} |
embed-padding? | dimension | 1mm |
embed-border-radius? | dimension | 1.3mm |
embed-border-size? | dimension | .4mm |