@@ -143,7 +143,7 @@ def validate_color(s):
143143
144144 if len (s )== 6 and s .isalnum (): # looks like hex
145145 return '#' + s
146-
146+
147147 if len (s )== 7 and s .startswith ('#' ) and s [1 :].isalnum ():
148148 return s
149149
@@ -165,21 +165,6 @@ def validate_stringlist(s):
165165 'landscape' , 'portrait' ,
166166 ])
167167
168- def validate_latex_preamble (s ):
169- 'return a list'
170- preamble_list = validate_stringlist (s )
171- if not preamble_list == ['' ]:
172- verbose .report ("""
173- *****************************************************************
174- You have the following UNSUPPORTED LaTeX preamble customizations:
175- %s
176- Please do not ask for support with these customizations active.
177- *****************************************************************
178- """ % '\n ' .join (preamble_list ), 'helpful' )
179- return preamble_list
180-
181-
182-
183168def validate_aspect (s ):
184169 if s in ('auto' , 'equal' ):
185170 return s
@@ -198,7 +183,7 @@ def validate_fontsize(s):
198183 return float (s )
199184 except ValueError :
200185 raise ValueError ('not a valid font size' )
201-
186+
202187def validate_font_properties (s ):
203188 parse_fontconfig_pattern (s )
204189 return s
@@ -353,7 +338,7 @@ def __call__(self, s):
353338 'text.color' : ['k' , validate_color ], # black
354339 'text.usetex' : [False , validate_bool ],
355340 'text.latex.unicode' : [False , validate_bool ],
356- 'text.latex.preamble' : [['' ], validate_latex_preamble ],
341+ 'text.latex.preamble' : [['' ], validate_stringlist ],
357342 'text.dvipnghack' : [False , validate_bool ],
358343 'text.fontstyle' : ['normal' , str ],
359344 'text.fontangle' : ['normal' , str ],
@@ -369,7 +354,7 @@ def __call__(self, s):
369354 'mathtext.sf' : ['sans\-serif' , validate_font_properties ],
370355 'mathtext.fontset' : ['cm' , validate_fontset ],
371356 'mathtext.fallback_to_cm' : [True , validate_bool ],
372-
357+
373358 'image.aspect' : ['equal' , validate_aspect ], # equal, auto, a number
374359 'image.interpolation' : ['bilinear' , str ],
375360 'image.cmap' : ['jet' , str ], # one of gray, jet, etc
0 commit comments