我正在尝试使用 Tikz 在乳胶中创建一个图形。但它不适合页面。我不需要级别与不同的组匹配。
\documentclass[10pt,twoside,a4paper]{memoir}
\usepackage{graphicx}
\usepackage{forest}
\usepackage{tikz-qtree}
\begin{document}
\begin{tikzpicture}
\tikzset{edge from parent/.style={draw,edge from parent path={(\tikzparentnode.south)-- +(0,-8pt)-| (\tikzchildnode)}}}
\Tree [.CD45$^+$
[.CD3
[.CD56 [CD319 PD1 ICOS ] ]
[.CD4 [Tbet ROR$\gamma$T PD1 CD27 ICOS CD43 CD103 INF$\gamma$ FOXP3 IL10 ]
]
[.CD8 ]
[TCR$\delta$ ]
]
[.CD20
[[[.CD11c [.Tbet ] ] CD27 FoxP3 CD21 PD1 ] ] ]
[.CD138 [.CD319 ] ]
[.CD14 ]
[.CD56 [ICOS GZMs CD16 CD319 PD1 ] ] ]
\end{tikzpicture}
\end{document}
答案1
可能的解决方案forest
:
- 树向东长
- 定义节点之间的距离
编辑:
哎呀,我没有用你的树加载我实验的最新版本,所以它有一些输入错误。现在错误已经更正了。
\documentclass[10pt,twoside,a4paper]{memoir}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage[edges]{forest}
\begin{document}
\begin{center}
\begin{forest}
for tree={
child anchor=west,
%
grow = east,
forked edge, % for forked edge
s sep = 2mm, % sibling distance
l sep = 12mm, % level distance
fork sep = 6mm, % distance from parent to branching point
tier/.option=level, % for aligning nodes to levels
}
[CD45$^+$
[CD3
[CD56
[CD319]
[PD1]
[ICOS]
]
[CD4
[Tbet]
[ROR$\gamma$T]
[PD1]
[CD27]
[ICOS]
[CD43]
[CD103]
[INF$\gamma$]
[FOXP3]
[IL10]
]
[CD8]
[TCR$\delta$ ]
]
[CD20
[CD11c
[Tbet]
]
[CD27]
[FoxP3]
[CD21]
[PD1]
]
[CD138
[CD319]
]
[CD14]
[CD56
[ICOS]
[GZMs]
[CD16]
[CD319]
[PD1]
]
]
\end{forest}
\end{center}
\end{document}
(红线表示页面布局)