Skip to content

Instantly share code, notes, and snippets.

@Wintus
Last active July 20, 2022 14:52
Show Gist options
  • Save Wintus/a6948988ea864525a1a2e937146d58d7 to your computer and use it in GitHub Desktop.
Save Wintus/a6948988ea864525a1a2e937146d58d7 to your computer and use it in GitHub Desktop.
TeXit
% support CJK unicode in UTF-8
\usepackage{CJKutf8}
% alternative
\usepackage[whole]{bxcjkjatype}
% Required to support mathematical unicode
\usepackage[warnunknown, fasterrors, mathletters]{ucs}
% Always typeset math in display style
\everymath{\displaystyle}
% Use a larger font size
\usepackage[fontsize=14pt]{scrextend}
% Standard mathematical typesetting packages
\usepackage{amsfonts, amsthm, amsmath, amssymb}
\usepackage{mathtools} % Extension to amsmath
% Symbol and utility packages
\usepackage{cancel, textcomp}
\usepackage[mathscr]{euscript}
\usepackage[nointegrals]{wasysym}
% Extras
\usepackage{physics} % Lots of useful shortcuts and macros
\usepackage{tikz-cd} % For drawing commutative diagrams easily
\usepackage{color} % Add some colour to life
\usepackage{microtype} % Minature font tweaks
\usepackage{yquant,braket} % Quantum circuit
% Common shortcuts
\def\mbb#1{\mathbb{#1}}
\def\mfk#1{\mathfrak{#1}}
\def\bN{\mbb{N}}
\def\bC{\mbb{C}}
\def\bR{\mbb{R}}
\def\bQ{\mbb{Q}}
\def\bZ{\mbb{Z}}
% Sometimes helpful macros
\newcommand{\func}[3]{#1\colon#2\to#3}
\newcommand{\vfunc}[5]{\func{#1}{#2}{#3},\quad#4\longmapsto#5}
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
% Quantum circuit macros
\newcommand{\circuit}[1]{\begin{tikzpicture}\begin{yquant}#1\end{yquant}\end{tikzpicture}}
% Some standard theorem definitions
\newtheorem{Theorem}{Theorem}
\newtheorem{Proposition}{Theorem}
\newtheorem{Lemma}[Theorem]{Lemma}
\newtheorem{Corollary}[Theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{Definition}[Theorem]{Definition}
% support CJK unicode in UTF-8
\usepackage[whole]{bxcjkjatype}
@Wintus
Copy link
Author

Wintus commented Jul 20, 2022

usage

,gpreamble --replace
<code comes here>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment