tikz圆圈与数字改变行之间的垂直空间

tikz圆圈与数字改变行之间的垂直空间

tikzArg,我尝试使用我读到的方法来复制不同的答案邮政并且在这方面邮政,但没有成功,我的圆圈炸毁了线条之间的空间。

不明白为什么结果不同...

在此处输入图片描述

那里有 cthullu MWE:

% !TEX encoding =  UTF-8 Unicode
% -*- program: xelatex -*-
\documentclass[a4paper, 11pt,twoside, openright]{memoir}
\usepackage{mwe} % just for dummy images
\usepackage{pgf,tikz}

\makeatletter
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[anchor=text, shape=circle,fill,draw,inner sep=0pt,text=white,minimum size=2em] (char) {#1\strut};}}
\makeatother

\begin{document}

    Ph'nglui mglw'nafh Cthulhu R'lyeh \circled{1} wgah'nagl fhtagn. Nog Chaugnar Faugn ooboshu 'fhalma ron, uln syha'h zhro lloig 'fhalma ph'hlirgh ep sgn'wahl ph'kn'a, hai kadishtu shagg kn'a stell'bsna naflmnahn' gotha 'fhalma uaaah. Gof'nnog \circled{3} shagg hrii 'ai uaaah ngthrod geboth h'ep ooboshu syha'h, gof'nn epyar sgn'wahl nilgh'ri orr'e Yoggothoth ep wgah'n. Gof'nnagl athg Azathothagl k'yarnak \circled{2} gof'nn Dagon, uln 'fhalma throd phlegeth wgah'nog 'fhalma, nnnHastur uh'e chtenff r'luh. Stell'bsna hlirgh Shub-Niggurath orr'e lw'nafh R'lyeh, lw'nafh ep grah'n li'hee, r'luh gof'nn nw 'fhalma. H'gof'nn ng'fhalma ngehye h'shtunggli Dagon orr'e k'yarnak geb athg ee R'lyeh orr'e, 'aior nnnDagon Shub-Niggurath y-Tsathoggua hrii nog Chaugnar Faugn Nyarlathotepnyth lw'nafh nashagg stell'bsna, fm'latgh zhro nallll ee Nyarlathotep n'ghft ehye nglui naron sgn'wahl. 

\end{document}

答案1

\tikz定义中的 的高度\circled负责增加的行距。可以使用\smash{}宏将对象的高度视为零。所以在这里,我\smash{\tikz[...]{...}}

当然,这现在可能造成重叠。为了解决这个问题,我将圆的最小尺寸减小到 1.4em。

% !TEX encoding =  UTF-8 Unicode
% -*- program: xelatex -*-
\documentclass[a4paper, 11pt,twoside, openright]{memoir}
\usepackage{mwe} % just for dummy images
\usepackage{pgf,tikz}

\makeatletter
\newcommand*\circled[1]{\smash{\tikz[baseline=(char.base)]{
            \node[anchor=text, shape=circle,fill,draw,inner sep=0pt,text=white,minimum size=1.4em] (char) {#1\strut};}}}
\makeatother

\begin{document}
\sloppy
    Ph'nglui mglw'nafh Cthulhu R'lyeh \circled{1} wgah'nagl fhtagn. Nog Chaugnar Faugn ooboshu 'fhalma ron, uln syha'h zhro lloig 'fhalma ph'hlirgh ep sgn'wahl ph'kn'a, hai kadishtu shagg kn'a stell'bsna naflmnahn' gotha 'fhalma uaaah. Gof'nnog \circled{3} shagg hrii 'ai uaaah ngthrod geboth h'ep ooboshu syha'h, gof'nn epyar sgn'wahl nilgh'ri orr'e Yoggothoth ep wgah'n. Gof'nnagl athg Azathothagl k'yarnak \circled{2} gof'nn Dagon, uln 'fhalma throd phlegeth wgah'nog 'fhalma, nnnHastur uh'e chtenff r'luh. Stell'bsna hlirgh Shub-Niggurath orr'e lw'nafh R'lyeh, lw'nafh ep grah'n li'hee, r'luh gof'nn nw 'fhalma. H'gof'nn ng'fhalma ngehye h'shtunggli Dagon orr'e k'yarnak geb athg ee R'lyeh orr'e, 'aior nnnDagon Shub-Niggurath y-Tsathoggua hrii nog Chaugnar Faugn Nyarlathotepnyth lw'nafh nashagg stell'bsna, fm'latgh zhro nallll ee Nyarlathotep n'ghft ehye nglui naron sgn'wahl. 

\end{document}

在此处输入图片描述

相关内容