Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于代码环境美化的问题 #30

Open
abcvav opened this issue Jun 6, 2021 · 1 comment
Open

关于代码环境美化的问题 #30

abcvav opened this issue Jun 6, 2021 · 1 comment
Labels
✨ enhancement New feature or request

Comments

@abcvav
Copy link

abcvav commented Jun 6, 2021

请描述该需求尝试解决的问题

目前这个代码环境有点丑
image

请描述您认为可行的解决方案

使用monaco字体->MONACO.zip
并将在csuthesis.cls文件中更改\lstset如下:

\newfontfamily\menlo{MONACO.ttf}
\RequirePackage{listings}
\lstset{
    breaklines,                                 % 自动将长的代码行换行排版
    extendedchars=false,                        % 解决代码跨页时,章节标题,页眉等汉字不显示的问题
    backgroundcolor=\color[rgb]{0.96,0.96,0.96},% 背景颜色
    keywordstyle=\color{blue}\bfseries,         % 关键字颜色
    identifierstyle=\color{black},              % 普通标识符颜色
    commentstyle=\color[rgb]{0,0.6,0},          % 注释颜色
    stringstyle=\color[rgb]{0.58,0,0.82},       % 字符串颜色
    showstringspaces=false,                     % 不显示字符串内的空格
    numbers=left,                               % 显示行号
    numberstyle=\tiny\menlo,                    % 设置数字字体
    basicstyle=\small\menlo,                    % 设置基本字体
    captionpos=t,                               % title在上方(在bottom即为b)
    frame=single,                               % 设置代码框形式
    rulecolor=\color[rgb]{0.8,0.8,0.8},         % 设置代码框颜色
}  

经过以上设置代码界面如下图所示:
image
这样就美观一些了

@abcvav abcvav added the ✨ enhancement New feature or request label Jun 6, 2021
@Edwardzcn
Copy link
Member

这个配置我觉得是挺好看的,不过模板默认设置考虑标准(是否可以使用Monaco字体),待定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants