Skip to content

Commit

Permalink
chore(latex): minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crispgm committed Nov 4, 2021
1 parent bccc124 commit 452dfb3
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
46 changes: 46 additions & 0 deletions fixtures/example.latex
Original file line number Diff line number Diff line change
@@ -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}
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/heading/format/latex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 452dfb3

Please sign in to comment.