# List items starting with brackets broken in LaTeX output #414

Closed
opened this Issue Feb 24, 2017 · 2 comments

Projects
None yet
2 participants

### RyanKoppenhaver-NCC commented Feb 24, 2017

 For the markdown input: * $foo$ bar  ...kramdown generates this LaTeX output: \begin{itemize} \item [foo] bar \end{itemize}  LaTeX then processes [foo] as an optional parameter to \item, specifying the bullet point symbol. (The intervening whitespace is ignored.) This results in output that looks like this:  | Lorem ipsum dolor sit amet | | * asdf foo bar | * blah  The issue also applies to ordered lists, and to input where the brackets are not escaped, but kramdown can't find a corresponding link definition, so it passes the brackets through. It's possible other LaTex output has similar issues, but I haven't looked in depth. Based on some messing around, I think this can be fixed by inserting an empty group {} or a \relax command into the output after \item, or by transforming the leading [ into either {[} or \char91 . I kind of like the first option, but I'm by no means a TeX/LaTeX expert, so I'm not sure if another one might be more technically correct.

Owner

### gettalong commented Feb 24, 2017

 There are already many places in kramdown's LaTeX converter that use {} because of the way LaTeX is parsed. So this is probably the way to go - I will have a look. Thanks for reporting this bug!
Owner

### gettalong commented Sep 3, 2017

 @RyanKoppenhaver-NCC I have looked at this and putting {} after \item would fix it for this case. However, during my experiments I found other problems with brackets and so they will additionally be escaped using {[} and {]}. This is fixed in the next release.

### gettalong added a commit that referenced this issue Sep 3, 2017

 Fix problem with brackets in LaTeX output 
Fixes #414
 3c9e8df