裝飾物之間的文字垂直居中

裝飾物之間的文字垂直居中

如何使兩個裝飾物之間的文字垂直居中?當我將這三行放在一起時,\fbox它看起來幾乎居中,但並不完全居中。

微量元素:

\documentclass{article}
\usepackage{pgfornament}
\begin{document}
\begin{center}
\pgfornament[width=4cm]{88}\\
$\mathcal{SP}$\\
\pgfornament[width=4cm]{88}
\end{center}
\end{document}

答案1

一個簡單的\raisebox就可以了:

\documentclass{article}
\usepackage{pgfornament}
\usepackage{array, makecell}
\usepackage[usestackEOL]{ stackengine}

\begin{document}

\begin{center}
\pgfornament[width=4cm]{88}\\
\raisebox{-0.5\height}{$\mathcal{SP}$}\\
\pgfornament[width=4cm]{88}
\end{center}

\end{document} 

在此輸入影像描述

答案2

我應該學會閱讀軟體包附帶的文檔。後面的例子暗示了這個解決方案:

\begin{tikzpicture}
   \node at (0,1) {\pgfornament[width=4cm,anchor=north]{88}};
   \node at (0,.5) {$\mathcal{SP}$};
   \node at (0,0) {\pgfornament[width=4cm,anchor=north]{88}};
\end{tikzpicture}

相關內容