Tikz 文本在路径中左侧参差不齐 2024-5-25 • tikz-pgf horizontal-alignment tikz-path 这是我的 MWE: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (11,0) -- (18,1) node [midway, sloped, align=left] (sentence) {This is a sentence}; \end{tikzpicture} \end{document} 以及对应的渲染: 那么,如何让文本在路径的第一个节点左对齐? 答案1 您可以\rlap与以下一起使用pos=0: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (11,0) --node [pos=0, sloped] (sentence) {\rlap{This is a sentence}} (18,1); \end{tikzpicture} \end{document} 答案2 那这个呢: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (11,0) --node [pos=0.25, sloped,fill=white] (sentence) {This is a sentence} (18,1); \end{tikzpicture} \end{document} 输出如下: 相关内容 将包含 utf-8 的 pdf 转换为 word 或文本文件? 检测中间人攻击? 跟踪路由 RTT 减少 - 如何解决中间延迟? Windows Server 使用 2-4 周后挂起? 哪个 Windows 7 日志文件包含音频插孔连接/断开信息? 如何修复以未处理的异常结束的启动盘创建器? 如何确定系统日志消息来自何处? 使用循环提取数据到 Excel 显示偏移。参见图片 Team Foundation Server 允许具有 Web 访问权限的用户查看其他错误