Skip to content
Snippets Groups Projects
components.sty 1.91 KiB
Newer Older
% \ProvidesExplPackage{profile/components}{2021-9-4}{0.1}{Some things I wrote} 

Yu Xiong's avatar
Yu Xiong committed
% 图表位置调整
\floatsetup[lstlisting]{ % Captions for lstlistings
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}
\floatsetup[figure]{ % Captions for figures
	capposition=bottom,%
	margins=centering,%
	floatwidth=\textwidth%
}
\floatsetup[table]{ % Captions for tables
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}

% 代码样式
\lstset{
    basicstyle=\ttfamily,% basic font
    keywordstyle=\bfseries,% use bold style for keywords
    commentstyle=\rmfamily\itshape,% use italic style for comments
    stringstyle=\ttfamily,% 字符串风格
    flexiblecolumns,% ?
    numbers=left,% left-aligned numbering
    showspaces=false,% hide markers for spaces
    showstringspaces=false,
    captionpos=t,% place the caption at the top
	% frame=lrtb,% show all four sides of the frame
	%linewidth=.8\textwidth,
Yu Xiong's avatar
Yu Xiong committed
	breakatwhitespace=true,
	breaklines=true,
	xleftmargin=2em,xrightmargin=2em,% set the width of the code environment
Yu Xiong's avatar
Yu Xiong committed
}
\AtBeginEnvironment{lstlisting}{\linespread{1}\selectfont} % 调整代码环境行距
% 图表标题样式
\DeclareCaptionFont{songtibf}{\bf\songti}
Yu Xiong's avatar
Yu Xiong committed
\captionsetup{
    font=small,%
    labelfont=bf,
	strut=no,%
	hypcap=true, % Links point to the top of the figure
	% indention=0pt, % Suppress indentation
	% % parindent=0pt, % Suppress space between paragraphs
	aboveskip=6pt, % Increase the space between the figure and the caption
	belowskip=6pt, % Increase the space between the caption and the table
}
\captionsetup[table]{
    position=top,
    textfont=songtibf,
    labelfont=songtibf
}
\captionsetup[figure]{
    position=below,
    textfont=songtibf,
    labelfont=songtibf
}

% list configuration
\renewcommand{\labelitemi}{\small$\blacktriangleright$}
\renewcommand{\labelitemii}{\textbullet}

\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
\setlist[description]{noitemsep}