  To induce intrinsic magnetism in the nominally nonmagnetic carbon materials
containing only $s$ and $p$ electrons is an intriguing yet challenging task.
Here, based on first-principles electronic structure calculations, we propose a
universal approach inspired by Ovchinnikov's rule to guide us the design of a
series of imaginative magnetic all-carbon structures. The idea is to combine
the differently stacked graphene layers via the acetylenic linkages
(-C$\equiv$C-) to obtain a class of two-dimensional (2D) and three-dimensional
(3D) carbon networks. With first-principles electronic structure calculations,
we confirm the effectiveness of this approach via concrete examples of
double-layer ALBG-C14, triple-layer ALTG-C22, and bulk IALG-C30. We show that
these materials are antiferromagnetic (AFM) semiconductors with intralayer
N\'eel and interlayer AFM couplings. According to the above idea, our work not
only provides a promising design scheme for magnetic all-carbon materials, but
also can apply to other $\pi$-bonding network systems.
