mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Merge branch 'master' into biblatex2
This commit is contained in:
commit
74f774d6cf
@ -186,7 +186,7 @@ macro(maketestname testname inverted listinverted listignored listunreliable lis
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(loadTestList filename resList depth)
|
||||
macro(loadTestList filename resList depth splitlangs)
|
||||
# Create list of strings from a file without comments
|
||||
# ENCODING parameter is a new feature in cmake 3.1
|
||||
initLangVars(${resList})
|
||||
@ -218,8 +218,12 @@ macro(loadTestList filename resList depth)
|
||||
list(REMOVE_DUPLICATES mylabels)
|
||||
set(sublabel ${_newl})
|
||||
else()
|
||||
string(REGEX REPLACE "(\\/|\\||\\(|\\))" " " _vxx ${_newl})
|
||||
string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
|
||||
if (splitlangs)
|
||||
string(REGEX REPLACE "(\\/|\\||\\(|\\))" " " _vxx ${_newl})
|
||||
string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
|
||||
else()
|
||||
set(_vx OFF)
|
||||
endif()
|
||||
if(_vx)
|
||||
foreach(_v ${_vx})
|
||||
string(REGEX REPLACE " " "" _v ${_v})
|
||||
@ -276,10 +280,11 @@ assignLabelDepth(1 "unreliable" "inverted")
|
||||
assignLabelDepth(2 "suspended")
|
||||
assignLabelDepth(-1 "examples" "manuals" "mathmacros" "templates" "autotests")
|
||||
|
||||
loadTestList(invertedTests invertedTests 7)
|
||||
loadTestList(ignoredTests ignoredTests 0)
|
||||
loadTestList(suspendedTests suspendedTests 6)
|
||||
loadTestList(unreliableTests unreliableTests 5)
|
||||
loadTestList(invertedTests invertedTests 7 ON)
|
||||
loadTestList(ignoredTests ignoredTests 0 ON)
|
||||
loadTestList(suspendedTests suspendedTests 6 ON)
|
||||
loadTestList(unreliableTests unreliableTests 5 ON)
|
||||
loadTestList(ignoreLatexErrorsTests ignoreLatexErrorsTests 8 OFF)
|
||||
|
||||
foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autotests/mathmacros)
|
||||
set(testlabel "export")
|
||||
@ -417,6 +422,8 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autote
|
||||
set(mytestlabel ${testlabel})
|
||||
maketestname(TestName inverted invertedTests ignoredTests unreliableTests mytestlabel)
|
||||
if(TestName)
|
||||
set(missingLabels )
|
||||
findexpr(mfound TestName ignoreLatexErrorsTests missingLabels)
|
||||
add_test(NAME ${TestName}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
|
||||
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
|
||||
@ -429,6 +436,7 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autote
|
||||
-Dfile=${f}
|
||||
-Dinverted=${inverted}
|
||||
-DTOP_SRC_DIR=${TOP_SRC_DIR}
|
||||
"-DIgnoreErrorMessage=${missingLabels}"
|
||||
-DPERL_EXECUTABLE=${PERL_EXECUTABLE}
|
||||
-DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
|
||||
-DENCODING=${_enc2}
|
||||
|
@ -24,12 +24,14 @@
|
||||
# -Dfile=xxx \
|
||||
# -Dinverted=[01] \
|
||||
# -DTOP_SRC_DIR=${TOP_SRC_DIR} \
|
||||
# -DIgnoreErrorMessage=(ON/OFF) \
|
||||
# -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \
|
||||
# -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \
|
||||
# -DENCODING=xxx \
|
||||
# -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
|
||||
#
|
||||
|
||||
message(STATUS "IgnoreErrorMessage = ${IgnoreErrorMessage}")
|
||||
set(Perl_Script "${TOP_SRC_DIR}/development/autotests/useSystemFonts.pl")
|
||||
set(Structure_Script "${TOP_SRC_DIR}/development/autotests/beginEndStructureCheck.pl")
|
||||
set(LanguageFile "${TOP_SRC_DIR}/lib/languages")
|
||||
@ -139,14 +141,20 @@ if (extension MATCHES "\\.lyx$")
|
||||
endforeach()
|
||||
else()
|
||||
if ($ENV{LYX_DEBUG_LATEX})
|
||||
set(LatexDebugParam -dbg latex)
|
||||
set(LyXExtraParams -dbg latex)
|
||||
else()
|
||||
set(LatexDebugParam)
|
||||
set(LyXExtraParams)
|
||||
endif()
|
||||
message(STATUS "Executing ${lyx} ${LatexDebugParam} -userdir \"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
|
||||
if(IgnoreErrorMessage)
|
||||
foreach (_em ${IgnoreErrorMessage})
|
||||
list(APPEND LyXExtraParams --ignore-error-message ${_em})
|
||||
endforeach()
|
||||
endif()
|
||||
string(REGEX REPLACE ";" " " _LyXExtraParams "${LyXExtraParams}")
|
||||
message(STATUS "Executing ${lyx} ${_LyXExtraParams} -userdir \"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
|
||||
file(REMOVE ${result_file_name})
|
||||
execute_process(
|
||||
COMMAND ${lyx} ${LatexDebugParam} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
|
||||
COMMAND ${lyx} ${LyXExtraParams} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
|
||||
RESULT_VARIABLE _err)
|
||||
|
||||
#check if result file created
|
||||
|
2
development/autotests/ignoreLatexErrorsTests
Normal file
2
development/autotests/ignoreLatexErrorsTests
Normal file
@ -0,0 +1,2 @@
|
||||
Sublabel: missing_glyphs
|
||||
export/doc/UserGuide_(dvi3|pdf4|pdf5)_systemF
|
168
lib/configure.py
168
lib/configure.py
@ -72,7 +72,7 @@ def cmdOutput(cmd, async = False):
|
||||
cmd = 'cmd /d /c pushd ' + shortPath(os.getcwd()) + '&' + cmd
|
||||
else:
|
||||
b = True
|
||||
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
|
||||
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, universal_newlines=True)
|
||||
pipe.stdin.close()
|
||||
if async:
|
||||
@ -110,16 +110,16 @@ def setEnviron():
|
||||
|
||||
def copy_tree(src, dst, preserve_symlinks=False, level=0):
|
||||
''' Copy an entire directory tree 'src' to a new location 'dst'.
|
||||
|
||||
|
||||
Code inspired from distutils.copy_tree.
|
||||
Copying ignores non-regular files and the cache directory.
|
||||
Copying ignores non-regular files and the cache directory.
|
||||
Pipes may be present as leftovers from LyX for lyx-server.
|
||||
|
||||
If 'preserve_symlinks' is true, symlinks will be
|
||||
copied as symlinks (on platforms that support them!); otherwise
|
||||
(the default), the destination of the symlink will be copied.
|
||||
'''
|
||||
|
||||
|
||||
if not os.path.isdir(src):
|
||||
raise FileError("cannot copy tree '%s': not a directory" % src)
|
||||
try:
|
||||
@ -127,12 +127,12 @@ def copy_tree(src, dst, preserve_symlinks=False, level=0):
|
||||
except os.error as oserror:
|
||||
(errno, errstr) = oserror.args
|
||||
raise FileError("error listing files in '%s': %s" % (src, errstr))
|
||||
|
||||
|
||||
if not os.path.isdir(dst):
|
||||
os.makedirs(dst)
|
||||
|
||||
|
||||
outputs = []
|
||||
|
||||
|
||||
for name in names:
|
||||
src_name = os.path.join(src, name)
|
||||
dst_name = os.path.join(dst, name)
|
||||
@ -150,7 +150,7 @@ def copy_tree(src, dst, preserve_symlinks=False, level=0):
|
||||
outputs.append(dst_name)
|
||||
else:
|
||||
logger.info("Ignore non-regular file %s", src_name)
|
||||
|
||||
|
||||
return outputs
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ def checkUpgrade():
|
||||
|
||||
def createDirectories():
|
||||
''' Create the build directories if necessary '''
|
||||
for dir in ['bind', 'clipart', 'doc', 'examples', 'images', 'kbd', \
|
||||
for dir in ['bind', 'clipart', 'doc', 'examples', 'images', 'kbd',
|
||||
'layouts', 'scripts', 'templates', 'ui' ]:
|
||||
if not os.path.isdir( dir ):
|
||||
try:
|
||||
@ -210,9 +210,11 @@ def checkTeXPaths():
|
||||
inpname = inpname.replace('~', '\\string~')
|
||||
os.write(fd, r'\relax')
|
||||
os.close(fd)
|
||||
latex_out = cmdOutput(r'latex "\nonstopmode\input{%s}\makeatletter\@@end"' % inpname)
|
||||
latex_out = cmdOutput(r'latex "\nonstopmode\input{%s}\makeatletter\@@end"'
|
||||
% inpname)
|
||||
if 'Error' in latex_out:
|
||||
latex_out = cmdOutput(r'latex "\nonstopmode\input{\"%s\"}\makeatletter\@@end"' % inpname)
|
||||
latex_out = cmdOutput(r'latex "\nonstopmode\input{\"%s\"}\makeatletter\@@end"'
|
||||
% inpname)
|
||||
if 'Error' in latex_out:
|
||||
logger.warning("configure: TeX engine needs posix-style paths in latex files")
|
||||
windows_style_tex_paths = 'false'
|
||||
@ -252,7 +254,8 @@ def checkProg(description, progs, rc_entry = [], path = [], not_found = ''):
|
||||
'''
|
||||
# one rc entry for each progs plus not_found entry
|
||||
if len(rc_entry) > 1 and len(rc_entry) != len(progs) + 1:
|
||||
logger.error("rc entry should have one item or item for each prog and not_found.")
|
||||
logger.error("rc entry should have one item or item "
|
||||
"for each prog and not_found.")
|
||||
sys.exit(2)
|
||||
logger.info('checking for ' + description + '...')
|
||||
## print '(' + ','.join(progs) + ')',
|
||||
@ -279,13 +282,17 @@ def checkProg(description, progs, rc_entry = [], path = [], not_found = ''):
|
||||
logger.info(msg + ' yes')
|
||||
# deal with java and perl
|
||||
if ac_word.endswith('.class'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"' % (java, os.path.join(ac_dir, ac_word[:-6])))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"'
|
||||
% (java, os.path.join(ac_dir, ac_word[:-6])))
|
||||
elif ac_word.endswith('.jar'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"' % (java, os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"'
|
||||
% (java, os.path.join(ac_dir, ac_word)))
|
||||
elif ac_word.endswith('.pl'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"' % (perl, os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"'
|
||||
% (perl, os.path.join(ac_dir, ac_word)))
|
||||
elif ac_dir in additional_path:
|
||||
ac_prog = ac_prog.replace(ac_word, r'\"%s\"' % (os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'\"%s\"'
|
||||
% (os.path.join(ac_dir, ac_word)))
|
||||
# write rc entries for this command
|
||||
if len(rc_entry) == 1:
|
||||
addToRC(rc_entry[0].replace('%%', ac_prog))
|
||||
@ -300,7 +307,8 @@ def checkProg(description, progs, rc_entry = [], path = [], not_found = ''):
|
||||
return ['', not_found]
|
||||
|
||||
|
||||
def checkProgAlternatives(description, progs, rc_entry = [], alt_rc_entry = [], path = [], not_found = ''):
|
||||
def checkProgAlternatives(description, progs, rc_entry = [],
|
||||
alt_rc_entry = [], path = [], not_found = ''):
|
||||
'''
|
||||
The same as checkProg, but additionally, all found programs will be added
|
||||
as alt_rc_entries
|
||||
@ -340,13 +348,17 @@ def checkProgAlternatives(description, progs, rc_entry = [], alt_rc_entry = [],
|
||||
m = None
|
||||
# deal with java and perl
|
||||
if ac_word.endswith('.class'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"' % (java, os.path.join(ac_dir, ac_word[:-6])))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"'
|
||||
% (java, os.path.join(ac_dir, ac_word[:-6])))
|
||||
elif ac_word.endswith('.jar'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"' % (java, os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"'
|
||||
% (java, os.path.join(ac_dir, ac_word)))
|
||||
elif ac_word.endswith('.pl'):
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"' % (perl, os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"'
|
||||
% (perl, os.path.join(ac_dir, ac_word)))
|
||||
elif ac_dir in additional_path:
|
||||
ac_prog = ac_prog.replace(ac_word, r'\"%s\"' % (os.path.join(ac_dir, ac_word)))
|
||||
ac_prog = ac_prog.replace(ac_word, r'\"%s\"'
|
||||
% (os.path.join(ac_dir, ac_word)))
|
||||
# write rc entries for this command
|
||||
if found_prime == False:
|
||||
if len(rc_entry) == 1:
|
||||
@ -438,33 +450,38 @@ def listAlternatives(progs, alt_type, rc_entry = []):
|
||||
def checkViewer(description, progs, rc_entry = [], path = []):
|
||||
''' The same as checkProgAlternatives, but for viewers '''
|
||||
alt_rc_entry = listAlternatives(progs, 'viewer', rc_entry)
|
||||
return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto')
|
||||
return checkProgAlternatives(description, progs, rc_entry,
|
||||
alt_rc_entry, path, not_found = 'auto')
|
||||
|
||||
|
||||
def checkEditor(description, progs, rc_entry = [], path = []):
|
||||
''' The same as checkProgAlternatives, but for editors '''
|
||||
alt_rc_entry = listAlternatives(progs, 'editor', rc_entry)
|
||||
return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto')
|
||||
return checkProgAlternatives(description, progs, rc_entry,
|
||||
alt_rc_entry, path, not_found = 'auto')
|
||||
|
||||
|
||||
def checkViewerNoRC(description, progs, rc_entry = [], path = []):
|
||||
''' The same as checkViewer, but do not add rc entry '''
|
||||
alt_rc_entry = listAlternatives(progs, 'viewer', rc_entry)
|
||||
rc_entry = []
|
||||
return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto')
|
||||
return checkProgAlternatives(description, progs, rc_entry,
|
||||
alt_rc_entry, path, not_found = 'auto')
|
||||
|
||||
|
||||
def checkEditorNoRC(description, progs, rc_entry = [], path = []):
|
||||
''' The same as checkViewer, but do not add rc entry '''
|
||||
alt_rc_entry = listAlternatives(progs, 'editor', rc_entry)
|
||||
rc_entry = []
|
||||
return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto')
|
||||
return checkProgAlternatives(description, progs, rc_entry,
|
||||
alt_rc_entry, path, not_found = 'auto')
|
||||
|
||||
|
||||
def checkViewerEditor(description, progs, rc_entry = [], path = []):
|
||||
''' The same as checkProgAlternatives, but for viewers and editors '''
|
||||
alt_rc_entry = listAlternatives(progs, ['editor', 'viewer'], rc_entry)
|
||||
return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto')
|
||||
return checkProgAlternatives(description, progs, rc_entry,
|
||||
alt_rc_entry, path, not_found = 'auto')
|
||||
|
||||
|
||||
def checkDTLtools():
|
||||
@ -606,10 +623,10 @@ def checkFormatEntries(dtl_tools):
|
||||
\Format xpm xpm XPM "" "%s" "%s" "" "image/x-xpixmap"'''
|
||||
path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 'gimp-remote', 'gimp'], rc_entry = [imageformats])
|
||||
path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 'gimp'], rc_entry = [imageformats])
|
||||
addToRC(imageformats % \
|
||||
addToRC(imageformats %
|
||||
(iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie) )
|
||||
#
|
||||
checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
|
||||
checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
|
||||
'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
|
||||
rc_entry = [r'''\Format asciichess asc "Plain text (chess output)" "" "" "%%" "" ""
|
||||
\Format docbook sgml DocBook B "" "%%" "document,menu=export" ""
|
||||
@ -645,25 +662,29 @@ def checkFormatEntries(dtl_tools):
|
||||
checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 'netscape'],
|
||||
rc_entry = [r'\Format xhtml xhtml "LyXHTML" y "%%" "" "document,menu=export" "application/xhtml+xml"'])
|
||||
#
|
||||
checkEditor('a BibTeX editor', ['jabref', 'JabRef', \
|
||||
'pybliographic', 'bibdesk', 'gbib', 'kbib', \
|
||||
'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
|
||||
'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
|
||||
'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad', \
|
||||
checkEditor('a BibTeX editor', ['jabref', 'JabRef',
|
||||
'pybliographic', 'bibdesk', 'gbib', 'kbib',
|
||||
'kbibtex', 'sixpack', 'bibedit', 'tkbibtex'
|
||||
'xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
|
||||
'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad',
|
||||
'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
|
||||
rc_entry = [r'''\Format bibtex bib "BibTeX" "" "" "%%" "" "text/x-bibtex"''' ])
|
||||
#
|
||||
#checkProg('a Postscript interpreter', ['gs'],
|
||||
# rc_entry = [ r'\ps_command "%%"' ])
|
||||
checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview --unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
|
||||
checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview --unique',
|
||||
'evince', 'gv', 'ghostview -swap',
|
||||
'gsview64', 'gsview32'],
|
||||
rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector" "image/x-eps"
|
||||
\Format eps2 eps "EPS (uncropped)" "" "%%" "" "vector" ""
|
||||
\Format eps3 eps "EPS (cropped)" "" "%%" "" "document" ""
|
||||
\Format ps ps Postscript t "%%" "" "document,vector,menu=export" "application/postscript"'''])
|
||||
# for xdg-open issues look here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
|
||||
# the MIME type is set for pdf6, because that one needs to be autodetectable by libmime
|
||||
checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview --unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \
|
||||
'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
|
||||
checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview --unique',
|
||||
'evince', 'kghostview', 'xpdf', 'SumatraPDF',
|
||||
'acrobat', 'acroread', 'mupdf', 'gv',
|
||||
'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
|
||||
rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document,vector,menu=export" ""
|
||||
\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document,vector,menu=export" ""
|
||||
\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector,menu=export" ""
|
||||
@ -776,7 +797,7 @@ def checkConverterEntries():
|
||||
\converter knitr luatex "%%" "needauth"
|
||||
\converter knitr dviluatex "%%" "needauth"'''])
|
||||
#
|
||||
checkProg('a Sweave -> R/S code converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'],
|
||||
checkProg('a Sweave -> R/S code converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'],
|
||||
rc_entry = [ r'\converter sweave r "%%" "needauth"' ])
|
||||
#
|
||||
checkProg('a knitr -> R/S code converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r tangle'],
|
||||
@ -784,9 +805,9 @@ def checkConverterEntries():
|
||||
#
|
||||
checkProg('an HTML -> LaTeX converter', ['html2latex $$i', 'gnuhtml2latex',
|
||||
'htmltolatex -input $$i -output $$o', 'htmltolatex.jar -input $$i -output $$o'],
|
||||
rc_entry = [ r'\converter html latex "%%" ""', \
|
||||
r'\converter html latex "python -tt $$s/scripts/html2latexwrapper.py %% $$i $$o" ""', \
|
||||
r'\converter html latex "%%" ""', \
|
||||
rc_entry = [ r'\converter html latex "%%" ""',
|
||||
r'\converter html latex "python -tt $$s/scripts/html2latexwrapper.py %% $$i $$o" ""',
|
||||
r'\converter html latex "%%" ""',
|
||||
r'\converter html latex "%%" ""', '' ])
|
||||
#
|
||||
checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
|
||||
@ -811,16 +832,16 @@ def checkConverterEntries():
|
||||
else:
|
||||
# search for HTML converters other than eLyXer
|
||||
# On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
|
||||
path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'htlatex.sh $$i', \
|
||||
'/usr/share/tex4ht/htlatex $$i', 'tth -t -e2 -L$$b < $$i > $$o', \
|
||||
path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'htlatex.sh $$i',
|
||||
'/usr/share/tex4ht/htlatex $$i', 'tth -t -e2 -L$$b < $$i > $$o',
|
||||
'latex2html -no_subdir -split 0 -show_section_numbers $$i', 'hevea -s $$i'],
|
||||
rc_entry = [ r'\converter latex html "%%" "needaux"' ])
|
||||
if htmlconv.find('htlatex') >= 0 or htmlconv == 'latex2html':
|
||||
addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py -e html,png,css $$i $$o"''')
|
||||
else:
|
||||
addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py $$i $$o"''')
|
||||
path, htmlconv = checkProg('a LaTeX -> HTML (MS Word) converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'", \
|
||||
"htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'", \
|
||||
path, htmlconv = checkProg('a LaTeX -> HTML (MS Word) converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'",
|
||||
"htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'",
|
||||
"/usr/share/tex4ht/htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
|
||||
rc_entry = [ r'\converter latex wordhtml "%%" "needaux"' ])
|
||||
if htmlconv.find('htlatex') >= 0:
|
||||
@ -873,7 +894,7 @@ def checkConverterEntries():
|
||||
#
|
||||
checkProg('a RTF -> HTML converter', ['unrtf --html $$i > $$o'],
|
||||
rc_entry = [ r'\converter rtf html "%%" ""' ])
|
||||
# Do not define a converter to pdf6, ps is a pure export format
|
||||
# Do not define a converter to pdf6, ps is a pure export format
|
||||
checkProg('a PS to PDF converter', ['ps2pdf $$i $$o'],
|
||||
rc_entry = [ r'\converter ps pdf "%%" ""' ])
|
||||
#
|
||||
@ -1145,15 +1166,19 @@ def checkOtherEntries():
|
||||
''' entries other than Format and Converter '''
|
||||
checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
|
||||
rc_entry = [ r'\chktex_command "%%"' ])
|
||||
checkProgAlternatives('BibTeX or alternative programs', ['bibtex', 'bibtex8', 'biber'],
|
||||
checkProgAlternatives('BibTeX or alternative programs',
|
||||
['bibtex', 'bibtex8', 'biber'],
|
||||
rc_entry = [ r'\bibtex_command "%%"' ],
|
||||
alt_rc_entry = [ r'\bibtex_alternatives "%%"' ])
|
||||
checkProg('a specific Japanese BibTeX variant', ['pbibtex', 'jbibtex', 'bibtex'],
|
||||
checkProg('a specific Japanese BibTeX variant',
|
||||
['pbibtex', 'jbibtex', 'bibtex'],
|
||||
rc_entry = [ r'\jbibtex_command "%%"' ])
|
||||
checkProgAlternatives('available index processors', ['texindy', 'makeindex -c -q', 'xindy'],
|
||||
checkProgAlternatives('available index processors',
|
||||
['texindy', 'makeindex -c -q', 'xindy'],
|
||||
rc_entry = [ r'\index_command "%%"' ],
|
||||
alt_rc_entry = [ r'\index_alternatives "%%"' ])
|
||||
checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 'jmakeindex -c -q', 'makeindex -c -q'],
|
||||
checkProg('an index processor appropriate to Japanese',
|
||||
['mendex -c -q', 'jmakeindex -c -q', 'makeindex -c -q'],
|
||||
rc_entry = [ r'\jindex_command "%%"' ])
|
||||
checkProg('the splitindex processor', ['splitindex.pl', 'splitindex',
|
||||
'splitindex.class'], rc_entry = [ r'\splitindex_command "%%"' ])
|
||||
@ -1177,19 +1202,19 @@ def processLayoutFile(file, bool_docbook):
|
||||
Declare lines look like this:
|
||||
|
||||
\DeclareLaTeXClass[<requirements>]{<description>}
|
||||
|
||||
|
||||
Optionally, a \DeclareCategory line follows:
|
||||
|
||||
|
||||
\DeclareCategory{<category>}
|
||||
|
||||
|
||||
So for example (article.layout, scrbook.layout, svjog.layout)
|
||||
|
||||
|
||||
\DeclareLaTeXClass{article}
|
||||
\DeclareCategory{Articles}
|
||||
|
||||
|
||||
\DeclareLaTeXClass[scrbook]{book (koma-script)}
|
||||
\DeclareCategory{Books}
|
||||
|
||||
|
||||
\DeclareLaTeXClass[svjour,svjog.clo]{article (Springer - svjour/jog)}
|
||||
|
||||
we'd expect this output:
|
||||
@ -1226,7 +1251,8 @@ def processLayoutFile(file, bool_docbook):
|
||||
prereq_latex = ','.join(prereq_list)
|
||||
prereq_docbook = {'true':'', 'false':'docbook'}[bool_docbook]
|
||||
prereq = {'LaTeX':prereq_latex, 'DocBook':prereq_docbook}[classtype]
|
||||
classdeclaration = '"%s" "%s" "%s" "%s" "%s"' % (classname, opt, desc, avai, prereq)
|
||||
classdeclaration = ('"%s" "%s" "%s" "%s" "%s"'
|
||||
% (classname, opt, desc, avai, prereq))
|
||||
if categorydeclaration != '""':
|
||||
return classdeclaration + " " + categorydeclaration
|
||||
if qres != None:
|
||||
@ -1265,8 +1291,8 @@ def checkLatexConfig(check_config, bool_docbook):
|
||||
# build the list of available layout files and convert it to commands
|
||||
# for chkconfig.ltx
|
||||
foundClasses = []
|
||||
for file in glob.glob( os.path.join('layouts', '*.layout') ) + \
|
||||
glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) :
|
||||
for file in (glob.glob(os.path.join('layouts', '*.layout'))
|
||||
+ glob.glob(os.path.join(srcdir, 'layouts', '*.layout'))):
|
||||
# valid file?
|
||||
if not os.path.isfile(file):
|
||||
continue
|
||||
@ -1307,8 +1333,8 @@ def checkLatexConfig(check_config, bool_docbook):
|
||||
category = re.compile(r'^\s*#\s*\\DeclareCategory{(.*)}\s*$')
|
||||
empty = re.compile(r'^\s*$')
|
||||
testclasses = list()
|
||||
for file in glob.glob( os.path.join('layouts', '*.layout') ) + \
|
||||
glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) :
|
||||
for file in (glob.glob( os.path.join('layouts', '*.layout') )
|
||||
+ glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) ):
|
||||
nodeclaration = False
|
||||
if not os.path.isfile(file):
|
||||
continue
|
||||
@ -1318,7 +1344,8 @@ def checkLatexConfig(check_config, bool_docbook):
|
||||
for line in open(file).readlines():
|
||||
if not empty.match(line) and line[0] != '#':
|
||||
if decline == "":
|
||||
logger.warning("Failed to find valid \Declare line for layout file `" + file + "'.\n\t=> Skipping this file!")
|
||||
logger.warning("Failed to find valid \Declare line "
|
||||
"for layout file `%s'.\n\t=> Skipping this file!" % file)
|
||||
nodeclaration = True
|
||||
# A class, but no category declaration. Just break.
|
||||
break
|
||||
@ -1326,7 +1353,8 @@ def checkLatexConfig(check_config, bool_docbook):
|
||||
decline = "\\TestDocClass{%s}{%s}" % (classname, line[1:].strip())
|
||||
testclasses.append(decline)
|
||||
elif category.search(line) != None:
|
||||
catline = "\\DeclareCategory{%s}{%s}" % (classname, category.search(line).groups()[0])
|
||||
catline = ("\\DeclareCategory{%s}{%s}"
|
||||
% (classname, category.search(line).groups()[0]))
|
||||
testclasses.append(catline)
|
||||
if catline == "" or decline == "":
|
||||
continue
|
||||
@ -1368,8 +1396,10 @@ def checkLatexConfig(check_config, bool_docbook):
|
||||
pass
|
||||
# if configure successed, move textclass.lst.tmp to textclass.lst
|
||||
# and packages.lst.tmp to packages.lst
|
||||
if os.path.isfile('textclass.lst.tmp') and len(open('textclass.lst.tmp').read()) > 0 \
|
||||
and os.path.isfile('packages.lst.tmp') and len(open('packages.lst.tmp').read()) > 0:
|
||||
if (os.path.isfile('textclass.lst.tmp')
|
||||
and len(open('textclass.lst.tmp').read()) > 0
|
||||
and os.path.isfile('packages.lst.tmp')
|
||||
and len(open('packages.lst.tmp').read()) > 0):
|
||||
shutil.move('textclass.lst.tmp', 'textclass.lst')
|
||||
shutil.move('packages.lst.tmp', 'packages.lst')
|
||||
return ret
|
||||
@ -1391,8 +1421,8 @@ def checkModulesConfig():
|
||||
seen = []
|
||||
# note that this searches the local directory first, then the
|
||||
# system directory. that way, we pick up the user's version first.
|
||||
for file in glob.glob( os.path.join('layouts', '*.module') ) + \
|
||||
glob.glob( os.path.join(srcdir, 'layouts', '*.module' ) ) :
|
||||
for file in (glob.glob( os.path.join('layouts', '*.module') )
|
||||
+ glob.glob( os.path.join(srcdir, 'layouts', '*.module' ) ) ):
|
||||
# valid file?
|
||||
logger.info(file)
|
||||
if not os.path.isfile(file):
|
||||
@ -1499,7 +1529,8 @@ def processModuleFile(file, filename, bool_docbook):
|
||||
cm.write(line + '\n')
|
||||
cm.close()
|
||||
|
||||
return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, pkgs, req, excl, catgy)
|
||||
return ('"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n'
|
||||
% (modname, filename, desc, pkgs, req, excl, catgy))
|
||||
|
||||
|
||||
def checkCiteEnginesConfig():
|
||||
@ -1653,7 +1684,8 @@ def rescanTeXFiles():
|
||||
interpreter = sys.executable
|
||||
if interpreter == '':
|
||||
interpreter = "python"
|
||||
tfp = cmdOutput(interpreter + " -tt " + '"' + os.path.join(srcdir, 'scripts', 'TeXFiles.py') + '"')
|
||||
tfp = cmdOutput(interpreter + " -tt " + '"'
|
||||
+ os.path.join(srcdir, 'scripts', 'TeXFiles.py') + '"')
|
||||
logger.info(tfp)
|
||||
logger.info("\tdone")
|
||||
|
||||
|
@ -3446,7 +3446,7 @@ unreliable:nonstandard
|
||||
\begin_layout Itemize
|
||||
Check the log file Testing/Temporary/LastTest.log.
|
||||
In case of latex-errors rerun the failing test with environment variable
|
||||
'LAX_DEBUG_LATEX' set to '1'.
|
||||
'LYX_DEBUG_LATEX' set to '1'.
|
||||
This will include latex messages in LastTest.log, so it should be easier
|
||||
to interpret the fail-reason.
|
||||
\end_layout
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "BufferList.h"
|
||||
#include "LaTeX.h"
|
||||
#include "LyXRC.h"
|
||||
#include "LyX.h"
|
||||
#include "DepTable.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
@ -895,8 +896,9 @@ int LaTeX::scanLogFile(TeXErrors & terr)
|
||||
from_local8bit("pdfTeX Error"),
|
||||
from_local8bit(token),
|
||||
child_name);
|
||||
} else if (prefixIs(token, "Missing character: There is no ")
|
||||
&& !contains(token, "nullfont")) {
|
||||
} else if (!ignore_missing_glyphs
|
||||
&& prefixIs(token, "Missing character: There is no ")
|
||||
&& !contains(token, "nullfont")) {
|
||||
// Warning about missing glyph in selected font
|
||||
// may be dataloss (bug 9610)
|
||||
// but can be ignored for 'nullfont' (bug 10394).
|
||||
|
22
src/LyX.cpp
22
src/LyX.cpp
@ -99,6 +99,13 @@ bool use_gui = true;
|
||||
bool verbose = false;
|
||||
|
||||
|
||||
// Do not treat the "missing glyphs" warning of fontspec as an error message.
|
||||
// The default is false and can be changed with the option
|
||||
// --ignore-error-message missing_glyphs
|
||||
// This is used in automated testing.
|
||||
bool ignore_missing_glyphs = false;
|
||||
|
||||
|
||||
// We default to open documents in an already running instance, provided that
|
||||
// the lyxpipe has been setup. This can be overridden either on the command
|
||||
// line or through preference settings.
|
||||
@ -1165,6 +1172,10 @@ int parse_help(string const &, string const &, string &)
|
||||
" specifying whether all files, main file only, or no files,\n"
|
||||
" respectively, are to be overwritten during a batch export.\n"
|
||||
" Anything else is equivalent to `all', but is not consumed.\n"
|
||||
"\t--ignore-error-message which\n"
|
||||
" allows you to ignore specific LaTeX error messages.\n"
|
||||
" Do not use for final documents! Currently supported values:\n"
|
||||
" * missing_glyphs: Fontspec `missing glyphs' error.\n"
|
||||
"\t-n [--no-remote]\n"
|
||||
" open documents in a new instance\n"
|
||||
"\t-r [--remote]\n"
|
||||
@ -1313,6 +1324,16 @@ int parse_verbose(string const &, string const &, string &)
|
||||
}
|
||||
|
||||
|
||||
int parse_ignore_error_message(string const & arg1, string const &, string &)
|
||||
{
|
||||
if (arg1 == "missing_glyphs") {
|
||||
ignore_missing_glyphs = true;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int parse_force(string const & arg, string const &, string &)
|
||||
{
|
||||
if (arg == "all") {
|
||||
@ -1362,6 +1383,7 @@ void LyX::easyParse(int & argc, char * argv[])
|
||||
cmdmap["--remote"] = parse_remote;
|
||||
cmdmap["-v"] = parse_verbose;
|
||||
cmdmap["--verbose"] = parse_verbose;
|
||||
cmdmap["--ignore-error-message"] = parse_ignore_error_message;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
map<string, cmd_helper>::const_iterator it
|
||||
|
@ -52,6 +52,7 @@ enum OverwriteFiles {
|
||||
|
||||
extern bool use_gui;
|
||||
extern bool verbose;
|
||||
extern bool ignore_missing_glyphs;
|
||||
extern RunMode run_mode;
|
||||
extern OverwriteFiles force_overwrite;
|
||||
|
||||
|
@ -82,7 +82,8 @@ public:
|
||||
// macro arguments are in macros
|
||||
LATTEST(mathMacro_->nesting() > 0);
|
||||
/// The macro nesting can change display of insets. Change it locally.
|
||||
Changer chg = make_change(mi.base.macro_nesting, mathMacro_->nesting());
|
||||
Changer chg = make_change(mi.base.macro_nesting,
|
||||
mathMacro_->nesting() == 1 ? 0 : mathMacro_->nesting());
|
||||
|
||||
MathRow::Element e_beg(MathRow::BEG_ARG);
|
||||
e_beg.macro = mathMacro_;
|
||||
|
Loading…
Reference in New Issue
Block a user