mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +00:00
Fix bug #2200 (The size of previewed images should be independent of the latex font size)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38709 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
53e99dced5
commit
b2ea8a7db7
@ -148,6 +148,27 @@ def color_pdf(latex_file, bg_color, fg_color):
|
|||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
||||||
|
def fix_latex_file(latex_file):
|
||||||
|
documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt)(.)(.+)")
|
||||||
|
|
||||||
|
tmp = mkstemp()
|
||||||
|
|
||||||
|
changed = 0
|
||||||
|
for line in open(latex_file, 'r').readlines():
|
||||||
|
match = documentclass_re.match(line)
|
||||||
|
if match == None:
|
||||||
|
tmp.write(line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
changed = 1
|
||||||
|
tmp.write("%s%s%s\n" % (match.group(1), match.group(3), match.group(4)))
|
||||||
|
|
||||||
|
if changed:
|
||||||
|
copyfileobj(tmp, open(latex_file,"wb"), 1)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def convert_to_ppm_format(pngtopnm, basename):
|
def convert_to_ppm_format(pngtopnm, basename):
|
||||||
png_file_re = re.compile("\.png$")
|
png_file_re = re.compile("\.png$")
|
||||||
|
|
||||||
@ -191,6 +212,9 @@ def main(argv):
|
|||||||
|
|
||||||
lilypond_book = find_exe_or_terminate(["lilypond-book"], path)
|
lilypond_book = find_exe_or_terminate(["lilypond-book"], path)
|
||||||
|
|
||||||
|
# Omit font size specification in latex file.
|
||||||
|
fix_latex_file(latex_file)
|
||||||
|
|
||||||
# Make a copy of the latex file
|
# Make a copy of the latex file
|
||||||
lytex_file = latex_file_re.sub(".lytex", latex_file)
|
lytex_file = latex_file_re.sub(".lytex", latex_file)
|
||||||
shutil.copyfile(latex_file, lytex_file)
|
shutil.copyfile(latex_file, lytex_file)
|
||||||
|
@ -167,6 +167,27 @@ def color_pdf(latex_file, bg_color, fg_color):
|
|||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
||||||
|
def fix_latex_file(latex_file):
|
||||||
|
documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt)(.)(.+)")
|
||||||
|
|
||||||
|
tmp = mkstemp()
|
||||||
|
|
||||||
|
changed = 0
|
||||||
|
for line in open(latex_file, 'r').readlines():
|
||||||
|
match = documentclass_re.match(line)
|
||||||
|
if match == None:
|
||||||
|
tmp.write(line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
changed = 1
|
||||||
|
tmp.write("%s%s%s\n" % (match.group(1), match.group(3), match.group(4)))
|
||||||
|
|
||||||
|
if changed:
|
||||||
|
copyfileobj(tmp, open(latex_file,"wb"), 1)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def convert_to_ppm_format(pngtopnm, basename):
|
def convert_to_ppm_format(pngtopnm, basename):
|
||||||
png_file_re = re.compile("\.png$")
|
png_file_re = re.compile("\.png$")
|
||||||
|
|
||||||
@ -288,6 +309,9 @@ def main(argv):
|
|||||||
else:
|
else:
|
||||||
latex = find_exe_or_terminate(["latex", "pplatex", "platex", "latex2e"], path)
|
latex = find_exe_or_terminate(["latex", "pplatex", "platex", "latex2e"], path)
|
||||||
|
|
||||||
|
# Omit font size specification in latex file.
|
||||||
|
fix_latex_file(latex_file)
|
||||||
|
|
||||||
# This can go once dvipng becomes widespread.
|
# This can go once dvipng becomes widespread.
|
||||||
dvipng = find_exe(["dvipng"], path)
|
dvipng = find_exe(["dvipng"], path)
|
||||||
if dvipng == None:
|
if dvipng == None:
|
||||||
|
@ -88,6 +88,9 @@ What's new
|
|||||||
|
|
||||||
- Correct erroneous report of duplicate labels when dissolving insets (#7319).
|
- Correct erroneous report of duplicate labels when dissolving insets (#7319).
|
||||||
|
|
||||||
|
- Make size of characters in instant preview snippets independent of the
|
||||||
|
LaTeX font size (bug 2200).
|
||||||
|
|
||||||
|
|
||||||
* DOCUMENTATION AND LOCALIZATION
|
* DOCUMENTATION AND LOCALIZATION
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user