Zivanovic의 Forest-Package(음운학적 표현용)에서 발견된 스타일인 Forest-GP1을 사용하려고 합니다.깃허브에서.
.sty
관련 파일과 동일한 디렉토리에 파일을 추가했습니다 .tex
. (또한 에서 경로를 정의하여 연결을 시도했지만 \usepackage{/path/forest-GP1}
관계없이\begin{문서} 누락오류.
내가 사용한 코드는 다음과 같습니다.
\documentclass{article}
\usepackage{forest-GP1}
\begin{document}
\begin{forest} GP1 [
[O[x[f ] ][x[r ] ] ]
[R[N[x[o ] ] ][x[s ] ] ]
[O[x[t ] ] ]
[R[N[x ] ] ]
]\end{forest}
\end{document}
TeXWorks에서 PDFLaTeX로 조판하고 있습니다(MiKTeX 사용).
답변1
그 이유는 당신이 빠졌기 때문이에요.숲-GP1패키지이며 자동으로 다운로드되지 않습니다. 올바른 폴더에 포함시켰나요?
당신은 그것을 얻을 수 있습니다깃허브작업 폴더에 다음과 같이 포함시킵니다.숲-GP1.sty그리고 그것은 작동할 것이다.
\documentclass{article}
\usepackage{forest-GP1}
\begin{document}
\begin{forest} GP1 [
[O[x[f ] ][x[r ] ] ]
[R[N[x[o ] ] ][x[s ] ] ]
[O[x[t ] ] ]
[R[N[x ] ] ]
]\end{forest}
\end{document}
답변2
forest
의 매뉴얼 49페이지에 표시된 대로 스타일을 정의할 수 있습니다 .
\documentclass[tikz,border=5pt]{standalone}
\usepackage{forest}
\newbox\standardnodestrutbox
\setbox\standardnodestrutbox=\hbox to 0pt{\phantom{\forestOve{standard node}{content}}}
\def\standardnodestrut{\copy\standardnodestrutbox}
\forestset{% from page 49 of forest's manual
GP1/.style 2 args={
for n={1}{baseline},
s sep=0pt, l sep=0pt,
for descendants={
l sep=0pt, l={#1},
anchor=base,calign=first,child anchor=north,
inner xsep=1pt,inner ysep=2pt,outer sep=0pt,s sep=0pt,
},
delay={
if content={}{phantom}{for children={no edge}},
for tree={
if content={O}{tier=OR}{},
if content={R}{tier=OR}{},
if content={N}{tier=N}{},
if content={x}{
tier=x,content={$\times$},outer xsep={#2},
for tree={calign=center},
for descendants={content format={\standardnodestrut\forestoption{content}}},
before drawing tree={outer xsep=0pt,delay={typeset node}},
s sep=4pt
}{},
},
},
before drawing tree={where content={}{parent anchor=center,child anchor=center}{}},
},
GP1/.default={5ex}{8.0pt},
associate/.style={%
tikz+={\draw[densely dotted](!)--(!#1);}},
spread/.style={
before drawing tree={tikz+={\draw[dotted](!)--(!#1);}}},
govern/.style={
before drawing tree={tikz+={\draw[->](!)--(!#1);}}},
p-govern/.style={
before drawing tree={tikz+={\draw[->](.north) to[out=150,in=30] (!#1.north);}}},
no p-govern/.style={
before drawing tree={tikz+={\draw[->,loosely dashed](.north) to[out=150,in=30] (!#1.north);}}},
encircle/.style={before drawing tree={circle,draw,inner sep=0pt}},
fen/.style={pin={[font=\footnotesize,inner sep=1pt,pin edge=<-]10:\textsc{Fen}}},
el/.style={content=\textsc{\textbf{##1}}},
head/.style={content=\textsc{\textbf{\underline{##1}}}}
}
\begin{document}
\begin{forest} GP1 [
[O[x[f ] ][x[r ] ] ]
[R[N[x[o ] ] ][x[s ] ] ]
[O[x[t ] ] ]
[R[N[x ] ] ]
]\end{forest}
\end{document}