% \iffalse meta-comment % % Copyright (C) 2021 by Ziyue "Alan" Xiang % % This file may be distributed and/or modified under the conditions of % the LaTeX Project Public License, either version 1.3c of this license % 28 or (at your option) any later version. The latest version of this % 29 license is in: % % http://www.latex-project.org/lppl.txt % % and version 1.3c or later is part of all distributions of LaTeX % version 2006/05/20 or later. % % \fi % % \iffalse %<*driver> \ProvidesFile{smart-eqn.dtx} % %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesExplPackage{smart-eqn}{08/05/2021}{1.0}{Automatic Math Symbol Styling} % % %<*driver> \makeatletter \@namedef{ver@fourier.sty}{} % suppress the loading of fourier \makeatother \documentclass{ydoc} \usepackage[english]{babel} \usepackage{fontspec, unicode-math} \usepackage{smart-eqn} \usepackage{microtype} \usepackage{etoolbox} \usepackage{titlesec} \usepackage{chngcntr} \usepackage[skins,listings,xparse]{tcolorbox} \usepackage{hyperref} \ExplSyntaxOff \AlsoImplementation \setmainfont{ETbb-Regular}[ Extension=.otf, BoldFont=ETbb-Bold, ItalicFont=ETbb-Italic, BoldItalicFont=ETbb-BoldItalic ] \setsansfont{QTAvanti}[ Extension=.otf, ItalicFont=QTAvanti-Italic, Scale=0.8 ] \setmonofont{NewCMMono10-Regular}[ Extension=.otf, BoldFont=NewCMMono10-Bold, ItalicFont=NewCMMono10-Italic ] \newfontfamily{\QTFloraline}{QTFloraline}[ Extension=.otf, BoldFont=QTFloraline-Bold ] \newfontfamily{\dejavumono}{DejaVuSansMono}[ Extension=.ttf, BoldFont=DejaVuSansMono-Bold, ItalicFont=DejaVuSansMono-Oblique, BoldItalicFont=DejaVuSansMono-BoldOblique ] \setmathfont{Asana-Math}[Extension=.otf] \newcommand{\thispkg}{\pkg{smart-eqn}} \title{\QTFloraline The \thispkg~Package:\\ Automatic Math Symbol Styling} \author{\href{https://www.alanshawn.com}{Ziyue ``Alan'' Xiang}} \date{\today} \repository{https://github.com/xziyue/smart-eqn} \email{ziyue.alan.xiang@gmail.com} \titleformat*{\section}{\QTFloraline\large\bfseries} \titleformat*{\subsection}{\QTFloraline\bfseries} %\newcounter{example} %\counterwithin{example}{section} \DeclareTCBListing{exbox}{soo}{ IfBooleanTF={#1}{listing only}{}, enhanced, sharp corners, boxrule=0pt, attach boxed title to top left, title={\sffamily\large EXAMPLE~\refstepcounter{example}\theexample% \IfValueT{#2}{\label{#2}}% \IfValueT{#3}{\space #3} }, boxed title style={sharp corners, boxrule=0pt, colback=black!25}, listing options={ basicstyle={\dejavumono\scriptsize}, xleftmargin=0pt, xrightmargin=0pt, framesep=0pt, aboveskip=0pt, belowskip=0pt, framexbottommargin=0pt, breaklines=true, breakatwhitespace=false } } \def\PrintMacroCode{% \begingroup \dejavumono \fontsize{6}{8}\selectfont \noindent\themacrocode \par \endgroup } \def\linenumberbox{% \hbox to 1.25em{}% \llap{% \stepcounter{linenumber}% {\color{gray}\tiny\thelinenumber~}% }% } \ExplSyntaxOn \def\PrintMacroImplName#1{% \str_set:Nn \l_tmpa_str {#1} \regex_replace_all:nnN {\s} {} \l_tmpa_str \implstyle{\str_use:N \l_tmpa_str}% } \ExplSyntaxOff \begin{document} \DocInput{smart-eqn.dtx} \end{document} % % \fi % \maketitle % \tableofcontents % \section{Introduction} % \makeatmath % \smesetsym{symbfup}{A,v} % In \LaTeX~typesetting, it is usually the case that one needs to use different variants of a math symbol to clarify the meanings. For example, in linear algebra literature, it is common to use boldfaced symbols to represent vectors, and use normal symbols to represent scalars, which makes equations like @Av=\lambda v@ easier to understand. However, applying these variants by typing |\mathbf|, |\mathrm| commands manually can be daunting. The \thispkg~package aims to provide an automatic and customizable approach for math symbol styling, which eliminates the need to enter style commands repeatedly. % \makeatother %\section{Usage} %\subsection{Style Configuration} % \DescribeMacro\smesetsym{