LaTeX reader: allow for []s inside LaTeX optional args.
Fixes cases like: \begin{center} \begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt] \Tree [.{S} [.NP John\index{i} ] [.VP [.V likes ] [.NP himself\index{i,*j} ]]] \end{tikzpicture} \end{center}
This commit is contained in:
parent
4f06e6c445
commit
5d02e478d0
1 changed files with 2 additions and 1 deletions
|
@ -861,7 +861,8 @@ opt = bracketed inline
|
||||||
|
|
||||||
rawopt :: LP String
|
rawopt :: LP String
|
||||||
rawopt = do
|
rawopt = do
|
||||||
contents <- bracketed (many1 (noneOf "]") <|> try (string "\\]"))
|
contents <- bracketed (many1 (noneOf "[]") <|> try (string "\\]") <|>
|
||||||
|
try (string "\\[") <|> rawopt)
|
||||||
optional sp
|
optional sp
|
||||||
return $ "[" ++ contents ++ "]"
|
return $ "[" ++ contents ++ "]"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue