Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reworked regex for multi-line concordance files #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dhicks
Copy link

@dhicks dhicks commented Feb 21, 2015

patchKnitrSynctex was failing with this concordance file:

\Sconcordance{concordance:commentary.tex:commentary.Rnw:%
1 2 1 49 0 1 11 69 1 1 20 1 1 1 27 10 1 1 27 5 1 7 0 %
77 1 1 7}

I determined that the problem was that the regex pattern re assumed exactly two lines. I rewrote re to accommodate multiple lines. This led to errors in the line rleValues <- read.table(textConnection(parsed[[1]][i,5]));. I then determined that the problem was that this element of the regex results now contained non-numeric characters (%, \n, and }). This element is now passed through gsub to remove everything except digits and spaces. I tested the new version of patchKnitrSynctex in situ with the concordance file above and both forward and backward searching appears to be working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant