Merge branch 'master' into math-mappings

This commit is contained in:
Karl Yngve Lervåg 2015-09-19 22:19:50 +02:00
commit 8b124af0b6
13 changed files with 56 additions and 8 deletions

View File

@ -12,15 +12,21 @@ elseif b:current_syntax !=# 'tex'
endif endif
" {{{1 Add syntax highlighting for \url and \href " {{{1 Add syntax highlighting for \url and \href
syntax match texStatement '\\url' nextgroup=texUrl syntax match texStatement '\\url\ze[^\ta-zA-Z]' nextgroup=texUrlVerb
syntax match texStatement '\\url\ze\s*{' nextgroup=texUrl
syntax match texStatement '\\href' nextgroup=texHref syntax match texStatement '\\href' nextgroup=texHref
syntax region texUrl matchgroup=Delimiter start="{" end="}" contained
syntax region texHref matchgroup=Delimiter start="{" end="}" contained syntax region texUrl matchgroup=Delimiter start='{' end='}' contained
syntax region texUrlVerb matchgroup=Delimiter
\ start='\z([^\ta-zA-Z]\)' end='\z1' contained
syntax region texHref matchgroup=Delimiter start='{' end='}' contained
\ nextgroup=texHrefLinkText \ nextgroup=texHrefLinkText
syntax region texHrefLinkText matchgroup=Delimiter start="{" end="}" contained syntax region texHrefLinkText matchgroup=Delimiter start='{' end='}' contained
\ contains=@Spell \ contains=@Spell
highlight link texUrl Function highlight link texUrl Function
highlight link texUrlVerb texUrl
highlight link texHref texUrl highlight link texHref texUrl
highlight link texHrefLinkText texSectionZone highlight link texHrefLinkText texSectionZone

View File

@ -384,7 +384,7 @@ function! s:latexmk_build_cmd() " {{{1
let cmd .= ' ' . g:vimtex_latexmk_options let cmd .= ' ' . g:vimtex_latexmk_options
let cmd .= ' -e ' . vimtex#util#shellescape( let cmd .= ' -e ' . vimtex#util#shellescape(
\ '$pdflatex =~ s/ / -file-line-error /') \ '$pdflatex =~ s/^((.(?<!^internal(?=\s)))*?) /$1 -file-line-error /')
if g:vimtex_latexmk_build_dir !=# '' if g:vimtex_latexmk_build_dir !=# ''
let cmd .= ' -outdir=' . g:vimtex_latexmk_build_dir let cmd .= ' -outdir=' . g:vimtex_latexmk_build_dir
endif endif

View File

@ -428,7 +428,7 @@ function! s:parse_line_input(line, file) " {{{1
let l:file = substitute(l:file, '\s*$', '', '') let l:file = substitute(l:file, '\s*$', '', '')
" Ensure file has extension " Ensure file has extension
if l:file !~# '.tex$' if l:file !~# '\.tex$'
let l:file .= '.tex' let l:file .= '.tex'
endif endif

View File

@ -123,7 +123,7 @@ endfunction
function! vimtex#util#shellescape(path) " {{{1 function! vimtex#util#shellescape(path) " {{{1
" Blackslashes in path must be escaped to be correctly parsed by the " Blackslashes in path must be escaped to be correctly parsed by the
" substitute() function. " substitute() function.
let l:path = escape(a:path, '\') let l:path = has('win32') ? escape(a:path, '\') : a:path
" "
" In a Windows environment, a path used in "cmd" only needs to be enclosed by " In a Windows environment, a path used in "cmd" only needs to be enclosed by
@ -132,7 +132,7 @@ function! vimtex#util#shellescape(path) " {{{1
" reports an error. Any path that goes into vimtex#util#execute() should be " reports an error. Any path that goes into vimtex#util#execute() should be
" processed through this function. " processed through this function.
" "
return has('win32') ? '"' . l:path . '"' : shellescape(l:path) return has('win32') ? '"' . l:path . '"' : shellescape(l:path, 1)
endfunction endfunction
" }}}1 " }}}1

View File

@ -0,0 +1,3 @@
\chapter{Chapter 1}
This is chapter 1.

View File

View File

6
test/issue-225/main.tex Normal file
View File

@ -0,0 +1,6 @@
\documentclass{scrbook}
% \input{./chapters/preamble}
\input{./chapters/preamble_tex}
\begin{document}
\include{./chapters/chapter}
\end{document}

View File

View File

@ -0,0 +1,7 @@
$pdflatex = 'internal internalexample %R %O %S';
sub internalexample {
my @args = @_;
print "This line should be printed\n";
return system("pdflatex @args");
}

View File

@ -0,0 +1,17 @@
\documentclass[11pt,a4paper]{article}
\begin{document}
This is just a simple example. Compiling it with the following \texttt{.latexmkrc} should print ``This line should be printed'' before starting \texttt{pdflatex}.
\begin{verbatim}
$pdflatex = 'internal internalexample %R %O %S';
sub internalexample {
my @args = @_;
print "This line should be printed\n";
return system("pdflatex @args");
}
\end{verbatim}
\end{document}

View File

@ -76,4 +76,13 @@ circle of diameter $d$.
const double pi = 3.1415926535 const double pi = 3.1415926535
\end{minted} \end{minted}
% Urls and hrep
\url{http://www.google.com}
\url+http://www.google.com+
\href{http://example.com}{Title text}
\urldef{\mysite}\url{http://example.com}
\end{document} \end{document}
% vim: fdl=9