我正在使用schemabloc package
,并且我想在一个块中显示两行文本......
Diode
Protection
在 以下示例Oscillator
中,Boost
这里是:
\documentclass{article}
\usepackage{schemabloc}
\begin{document}
\begin{center}
\begin{tikzpicture}
\sbEntree{E}
\sbBloc[3]{PV}{PV Cells}{E}
\sbDecaleNoeudy[-1.9]{PV}{PV2}
\sbBlocL[2]{B}{Battery}{PV}
\sbBlocL{D}{Protection \\ Diode}{B} % Here
\sbRenvoi[-2]{PV2}{D}{}
\sbBlocL[2]{OS}{Boost/Oscillator}{D} % And Here
\sbBlocL[2]{L}{LED}{OS}
\sbSortie{S}{OS}
\end{tikzpicture}
\end{center}
\end{document}
这就是我得到的:
./Sans-titre.tex:10: LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \sbBlocL{D}{Protection \\ Diode}{B}
有任何想法吗 ?
答案1
将键附加align
到样式sbStyleBloc
。
\documentclass{standalone}
\usepackage{schemabloc}
\tikzset{%
sbStyleBloc/.append style = {align = center}}
\begin{document}
\begin{tikzpicture}
\sbEntree{E}
\sbBloc[3]{PV}{PV Cells}{E}
\sbDecaleNoeudy[-1.9]{PV}{PV2}
\sbBlocL[2]{B}{Battery}{PV}
\sbBlocL{D}{Protection \\ Diode}{B}
\sbRenvoi[-2]{PV2}{D}{}
\sbBlocL[2]{OS}{Boost \\ Oscillator}{D}
\sbBlocL[2]{L}{LED}{OS}
\sbSortie{S}{OS}
\end{tikzpicture}
\end{document}