Skip to content

Instantly share code, notes, and snippets.

View muzimuzhi's full-sized avatar

Yukai Chou muzimuzhi

View GitHub Profile
@muzimuzhi
muzimuzhi / analysisLatexLabels.py
Created July 3, 2020 17:00
A Python script showing multiply defined and unused labels in *.tex files
#!/usr/bin/env python3
"""
Analysis *.tex files in current directory or given <path>, show info about
multiply defined and unused labels.
Usage:
python3 analysisLatexLabels.py
python3 analysisLatexLabels.py <path>
@muzimuzhi
muzimuzhi / cwl-clean-duplicate.py
Last active January 9, 2023 08:31
remove duplicates in texstudio completion file `tcolorbox.cwl`
#!/usr/bin/env python3
import itertools
from typing import Dict, List, Tuple
import re
CWL_PATH = "your path"
CWL_FILE = CWL_PATH + "texstudio/completion/tcolorbox.cwl"
def get_duplicate_relation(cwl_file):
@muzimuzhi
muzimuzhi / build.sh
Last active June 28, 2019 03:31
Fix PDF hyperlinks produced by LaTeX package `pgfpages`
#!/bin/bash
# CAUTION: tested on macOS only
TEXFILE='main.tex'
SUFFIX_NORMAL='normal'
SUFFIX_MERGED='nup'
XDVIPDFMX_OPTIONS=''
# XDVOPT='-z0 -C 0x0010'
@muzimuzhi
muzimuzhi / READEME.md
Last active October 14, 2020 07:53
Fix a longtable bug where single-page longtable below float delays pagebreak

This gist provides a bug-fixing version of latex package longtable.

Changelog

  • revision 1: add longtable.sty v4.11
  • revision 2: patch longtable.sty
  • revision 3: add READEME.md
  • revision 4: add more related links, re-format readme

Related links

@muzimuzhi
muzimuzhi / how-tabular-row-grows.tex
Created August 21, 2018 01:04
latex: how height of tabular row grows
\documentclass{ctexart}
\usepackage{array}
\usepackage{tcolorbox}
\tcbuselibrary{skins, listings}
\tcbset{skin=bicolor, colbacklower=white}
\newtcblisting[auto counter]{example}[1]{
title=例\thetcbcounter: #1
}
\begin{document}
@muzimuzhi
muzimuzhi / basictex-install.sh
Last active May 30, 2023 13:31
install and config basicTeX
##
# A script to help you install and config basictex
# https://www.tug.org/mactex/morepackages.html
#
# References:
# - https://gist.github.com/kadrach/6228314
# - https://tex.stackexchange.com/a/304202
#
# Requirements:
# - homebrew