-
Notifications
You must be signed in to change notification settings - Fork 15
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
算法的行距太小,如何调整算法中的行距 #16
Comments
源代码里面的小毛病挺多的,这里只回答涉及 首先,请去掉 其实,并不是行距问题——第 1 行算法(4 行文本)与第 2 行算法(2 行文本)的内部是没有问题的,出问题的是这两行算法之间的间距。 改进方法: % 加在导言区
\usepackage{etoolbox}
\makeatletter
\expandafter\patchcmd\csname\string\algorithmic\endcsname
{\itemsep\z@}
{\itemsep=2ex plus2pt\relax}% 根据个人喜好修改 2ex plus2pt 弹性距离
{}{}
\makeatother 真·改进方法:把算法重写,文本描述精简一些,不要一行算法出现多行文本描述。 |
@OsbertWang 您的方法会将所有行距都变大,问题只是每行算法之间的距离太小。 |
那就是 class 的问题了,你试试把 \renewcommand{\item}{\setlength{\itemsep}{\wideitemsep}\olditem} 大概看了一下 |
@RuixiZhang42
|
@RuixiZhang42 我重新再在试了下,我们两个的方法都可以实现算法行距的更改,但是会导致每条参考文献之间的间距变大。 |
另:官方 https://www.mdpi.com/authors/latex 提供的模板写成这样也是醉了……这种 CTAN 上面没有的 class 或 package 很难排查错误…… 现在对现有问题做一个整体分析吧:
如果你一定要用 \usepackage{etoolbox}
\AtBeginEnvironment{algorithmic}
{\let\item\olditem} 这模板简直了…… |
检查
编译环境
操作系统
TeX 发行版
描述问题
(1)问题:算法的行距太小,如何调整算法中的行距?
(2)尝试调整line33-35的代码,无效
最小工作示例(MWE)
MDPI_template.zip
The text was updated successfully, but these errors were encountered: