scientific-skills/Others/chart-style-unifier/SKILL.md
Batch-unify typography (font family, size, italics) for Word table cells and embedded charts; use when you need consistent formatting across theses/reports without changing body text.
npx skillsauth add aipoch/medical-research-skills chart-style-unifierInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
scripts/change_table_font.py is the most direct path to complete the request.chart-style-unifier package behavior rather than a generic answer.scripts/change_table_font.py plus 2 additional script(s).references/ for task-specific guidance.Python: 3.10+. Repository baseline for current packaged skills.Third-party packages: not explicitly version-pinned in this skill package. Add pinned versions if this skill needs stricter environment control.cd "20260316/scientific-skills/Others/chart-style-unifier"
python -m py_compile scripts/change_table_font.py
python scripts/change_table_font.py --help
Example run plan:
CONFIG block or documented parameters if the script uses fixed settings.python scripts/change_table_font.py with the validated inputs.scripts/change_table_font.py with additional helper scripts under scripts/.references/ contains supporting rules, prompts, or checklists.config.json, then execute.outputs/runs/<timestamp>/ for traceability.| Dependency | Version | Purpose | Notes |
|---|---:|---|---|
| python-docx | >= 0.8.11 | Modify Word table cell runs/fonts | Used by scripts/change_table_font.py |
| pywin32 | >= 306 | Word/Excel COM automation for chart macros | Windows-only; required for COM-based operations |
Installation:
pip install python-docx pywin32
Optional (mirror):
pip install -i https://mirrors.aliyun.com/pypi/simple python-docx pywin32
# 1) Initialize a run directory for table processing
python scripts/init_run.py --table
# 2) Edit the generated config:
# outputs/runs/<timestamp>/config.json
# 3) Execute the table font unification
python scripts/change_table_font.py
Example outputs/runs/<timestamp>/config.json:
{
"target_doc_path": "C:/Users/xxx/Desktop/document.docx",
"font_name": "SimSun",
"font_size": 10,
"target_type": "table",
"italic_numbers": false,
"italic_chinese": false,
"lowercase_letters": false,
"status": "pending"
}
Paste into Word VBA Editor (Alt+F11) and run NormalizeChartTypography:
Option Explicit
Public Sub NormalizeChartTypography()
Dim fontName As String
Dim baseSize As Single, titleSize As Single
Dim axisTitleSize As Single, tickLabelSize As Single
Dim legendSize As Single, dataLabelSize As Single
fontName = InputBox("Font Name", "Unify Chart Fonts", "Times New Roman")
baseSize = CSng(InputBox("Base Size (ChartArea)", "Unify Chart Fonts", "9"))
titleSize = CSng(InputBox("Chart Title Size", "Unify Chart Fonts", "11"))
axisTitleSize = CSng(InputBox("Axis Title Size", "Unify Chart Fonts", "9"))
tickLabelSize = CSng(InputBox("Tick Label Size", "Unify Chart Fonts", "8"))
legendSize = CSng(InputBox("Legend Size", "Unify Chart Fonts", "10"))
dataLabelSize = CSng(InputBox("Data Label Size", "Unify Chart Fonts", "8"))
Application.ScreenUpdating = False
Dim ish As InlineShape, shp As Shape
For Each ish In ActiveDocument.InlineShapes
If ish.HasChart Then
ApplyChartTypography ish.Chart, fontName, baseSize, titleSize, axisTitleSize, tickLabelSize, legendSize, dataLabelSize
End If
Next ish
For Each shp In ActiveDocument.Shapes
If shp.HasChart Then
ApplyChartTypography shp.Chart, fontName, baseSize, titleSize, axisTitleSize, tickLabelSize, legendSize, dataLabelSize
End If
Next shp
Application.ScreenUpdating = True
End Sub
Private Sub ApplyChartTypography(cht As Object, fontName As String, baseSize As Single, _
titleSize As Single, axisTitleSize As Single, tickLabelSize As Single, _
legendSize As Single, dataLabelSize As Single)
On Error Resume Next
With cht.ChartArea.Format.TextFrame2.TextRange.Font
.Name = fontName
.Size = baseSize
End With
If cht.HasTitle Then
With cht.ChartTitle.Format.TextFrame2.TextRange.Font
.Name = fontName
.Size = titleSize
End With
End If
If cht.HasLegend Then
With cht.Legend.Format.TextFrame2.TextRange.Font
.Name = fontName
.Size = legendSize
End With
End If
Dim axType As Variant, axGroup As Variant, ax As Object
For Each axType In Array(1, 2) ' 1=xlCategory, 2=xlValue
For Each axGroup In Array(1, 2) ' 1=xlPrimary, 2=xlSecondary
Set ax = Nothing
Set ax = cht.Axes(axType, axGroup)
If Not ax Is Nothing Then
ax.TickLabels.Font.Name = fontName
ax.TickLabels.Font.Size = tickLabelSize
If ax.HasTitle Then
ax.AxisTitle.Format.TextFrame2.TextRange.Font.Name = fontName
ax.AxisTitle.Format.TextFrame2.TextRange.Font.Size = axisTitleSize
End If
End If
Next axGroup
Next axType
Dim s As Object
For Each s In cht.SeriesCollection
If s.HasDataLabels Then
s.DataLabels.Font.Name = fontName
s.DataLabels.Font.Size = dataLabelSize
End If
Next s
On Error GoTo 0
End Sub
Run in Excel on the source workbook(s) before refreshing links in Word:
Option Explicit
Public Sub NormalizeLinkedChartTypography()
Dim fontName As String
Dim baseSize As Single, titleSize As Single
Dim axisTitleSize As Single, tickLabelSize As Single
Dim legendSize As Single, dataLabelSize As Single
fontName = InputBox("Font Name", "Unify Chart Fonts", "Times New Roman")
baseSize = CSng(InputBox("Base Size (ChartArea)", "Unify Chart Fonts", "9"))
titleSize = CSng(InputBox("Chart Title Size", "Unify Chart Fonts", "11"))
axisTitleSize = CSng(InputBox("Axis Title Size", "Unify Chart Fonts", "9"))
tickLabelSize = CSng(InputBox("Tick Label Size", "Unify Chart Fonts", "8"))
legendSize = CSng(InputBox("Legend Size", "Unify Chart Fonts", "10"))
dataLabelSize = CSng(InputBox("Data Label Size", "Unify Chart Fonts", "8"))
Application.ScreenUpdating = False
Dim ws As Worksheet, co As ChartObject
For Each ws In ActiveWorkbook.Worksheets
For Each co In ws.ChartObjects
ApplyChartTypography co.Chart, fontName, baseSize, titleSize, axisTitleSize, tickLabelSize, legendSize, dataLabelSize
Next co
Next ws
Application.ScreenUpdating = True
End Sub
target_doc_path).outputs/runs/<timestamp>/.../) and sensitive system directories.outputs/runs/<timestamp>/config.json..docx and iterates tables → rows → cells → paragraphs → runs.font_name and font_size to runs inside table cells.Recommended parameter mapping (used by the VBA macros):
| Element | VBA Target | Parameter |
|---|---|---|
| Chart area base | Chart.ChartArea | baseSize |
| Chart title | Chart.ChartTitle | titleSize |
| Axis titles | Axes(...).AxisTitle | axisTitleSize |
| Tick labels | Axes(...).TickLabels | tickLabelSize |
| Legend | Chart.Legend | legendSize |
| Data labels | Series.DataLabels | dataLabelSize |
| Script | Purpose |
|---|---|
| scripts/init_run.py | Create outputs/runs/<timestamp>/ and a starter config.json |
| scripts/generate_style_pack.py | Generate matplotlib/plotly style packs from a unified config |
| scripts/change_table_font.py | Apply table cell font normalization based on config.json |
tests/test_table_font.pyreferences/style-apply-checklist.mdreferences/style-spec-template.mdtools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.