如何使节点内的文本“Mi”左对齐?我假设 align=left 可以工作,但文本仍然居中。
\documentclass[fontsize=6pt]{article}
\usepackage{tikz}
\usepackage[right]{showlabels}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[x=23mm,y=6mm,%
mybox/.style={rectangle,rounded corners,minimum width=23mm, minimum height=6mm, align=left},%
workday/.style={mybox,draw=black,align=left}]%
\node at (0,-1) [workday] {Mi};
\end{tikzpicture}
\end{document}
答案1
您可以添加一个指定文本宽度的选项。然后它会自动左对齐:
\documentclass[fontsize=6pt]{article}
\usepackage{tikz}
\usepackage[right]{showlabels}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[x=23mm,y=6mm,%
mybox/.style={rectangle,rounded corners,minimum width=23mm, minimum height=6mm, align=left,text width=2cm},%
workday/.style={mybox,draw=black,align=left}]%
\node at (0,-1) [workday] {Mi};
\end{tikzpicture}
\end{document}