diff --git a/README.md b/README.md index 87882a7..ee9d757 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ An extension for [telescope.nvim](https://github.com/nvim-telescope/telescope.nv - AsciiDoc (experimental) - OrgMode (experimental) - ReStructuredText (experimental) +- LaTeX (experimental) ## Setup diff --git a/fixtures/example.latex b/fixtures/example.latex new file mode 100644 index 0000000..07271fc --- /dev/null +++ b/fixtures/example.latex @@ -0,0 +1,46 @@ +\documentclass[12pt]{article} +\usepackage{lingmacros} +\usepackage{tree-dvips} +\begin{document} + +\section*{Notes for My Paper} + +Don't forget to include examples of topicalization. +They look like this: + +{\small +\enumsentence{Topicalization from sentential subject:\\ +\shortex{7}{a John$_i$ [a & kltukl & [el & + {\bf l-}oltoir & er & ngii$_i$ & a Mary]]} +{ & {\bf R-}clear & {\sc comp} & + {\bf IR}.{\sc 3s}-love & P & him & } +{John, (it's) clear that Mary loves (him).}} +} + +\subsection*{How to handle topicalization} + +I'll just assume a tree structure like (\ex{1}). + +{\small +\enumsentence{Structure of A$'$ Projections:\\ [2ex] +\begin{tabular}[t]{cccc} + & \node{i}{CP}\\ [2ex] + \node{ii}{Spec} & &\node{iii}{C$'$}\\ [2ex] + &\node{iv}{C} & & \node{v}{SAgrP} +\end{tabular} +\nodeconnect{i}{ii} +\nodeconnect{i}{iii} +\nodeconnect{iii}{iv} +\nodeconnect{iii}{v} +} +} + +\subsection*{Mood} + +Mood changes when there is a topic, as well as when +there is WH-movement. \emph{Irrealis} is the mood when +there is a non-subject topic or WH-phrase in Comp. +\emph{Realis} is the mood when there is a subject topic +or WH-phrase. + +\end{document} diff --git a/lua/telescope/_extensions/heading/format/latex.lua b/lua/telescope/_extensions/heading/format/latex.lua index eec87fb..60362ae 100644 --- a/lua/telescope/_extensions/heading/format/latex.lua +++ b/lua/telescope/_extensions/heading/format/latex.lua @@ -47,7 +47,7 @@ function Latex.get_headings(filepath, start, total) local trimmedline = string.gsub(line, '^%s+', '') local headingname = string.match(trimmedline, '^\\%l+') or '' headingname = string.sub(headingname, 2) - local skip = false + local skip if matchtable[headingname] then local firstWordCol = string.len(line) - string.len(trimmedline) + 1