以下 MWE 在边缘设置了一些方框文本:
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{blindtext}
\begin{document}
\marginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {200};}
\blindtext
\marginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {demo};}
\blindtext
\marginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {$(a,b)*(c,d)$};}
\end{document}
页边距文本与左侧对齐。但是,我想让页边距文本居中,我正在寻找解决方案。
答案1
您可以\centering
手动添加、重新定义\marginline
或者定义新命令:
\documentclass{scrartcl}\show\marginline
\usepackage{tikz}
\usepackage{blindtext}
\newcommand\cmarginline[1]{% or \renewcommand\marginline[1]
\marginpar[\centering {#1}]{\centering #1}%
}
\begin{document}
\cmarginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {200};}
\blindtext
\cmarginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {demo};}
\blindtext
\cmarginline{\tikz[baseline=(n.base)]\node[rounded corners,draw] (n) {$(a,b)*(c,d)$};}
\end{document}