autogen test

This commit is contained in:
2025-12-16 00:07:00 +01:00
parent 5862a69ac2
commit f22ae02ed5
7 changed files with 149 additions and 147 deletions

View File

@@ -104,8 +104,9 @@ def parse_md_to_html_blocks(md_content):
fig_file = f'figures/figura_{figure_counter}.png'
fig_path = os.path.join(BASE_DIR, 'thesis_output', fig_file)
# Create figure with proper template format (Piedefoto-tabla class)
html_blocks.append(f'''<p class=Piedefoto-tabla style="margin-left:0cm;text-align:center"><span lang=ES><b>Figura {figure_counter}.</b> <i>{fig_title}</i></span></p>''')
# Create figure with MsoCaption class and bookmark for Word cross-reference
bookmark_id = f"_TocFigura{figure_counter}"
html_blocks.append(f'''<p class=MsoCaption style="text-align:center"><a name="{bookmark_id}"><span lang=ES style="font-size:12.0pt;line-height:150%">Figura {figure_counter}. </span></a><i><span lang=ES style="font-size:12.0pt;line-height:150%;font-weight:normal">{fig_title}</span></i></p>''')
if os.path.exists(fig_path):
# Use actual image with proper Word-compatible format
@@ -185,12 +186,13 @@ def parse_md_to_html_blocks(md_content):
table_source = lines[i].replace('*', '').replace('Fuente:', '').strip()
i += 1
# Add table title with proper template format (Piedefoto-tabla class)
# Add table title with MsoCaption class and bookmark for Word cross-reference
bookmark_id = f"_TocTabla{table_counter}"
if table_title:
clean_title = table_title.replace(f"Tabla {table_counter}.", "").strip()
html_blocks.append(f'<p class=Piedefoto-tabla style="margin-left:0cm"><span lang=ES><b>Tabla {table_counter}.</b> <i>{clean_title}</i></span></p>')
html_blocks.append(f'<p class=MsoCaption><a name="{bookmark_id}"><span lang=ES style="font-size:12.0pt;line-height:150%">Tabla {table_counter}. </span></a><i><span lang=ES style="font-size:12.0pt;line-height:150%;font-weight:normal">{clean_title}</span></i></p>')
else:
html_blocks.append(f'<p class=Piedefoto-tabla style="margin-left:0cm"><span lang=ES><b>Tabla {table_counter}.</b> <i>Tabla de datos.</i></span></p>')
html_blocks.append(f'<p class=MsoCaption><a name="{bookmark_id}"><span lang=ES style="font-size:12.0pt;line-height:150%">Tabla {table_counter}. </span></a><i><span lang=ES style="font-size:12.0pt;line-height:150%;font-weight:normal">Tabla de datos.</span></i></p>')
# Build table HTML
table_html = '<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt">'