Comments (8)
另:官方 https://www.mdpi.com/authors/latex 提供的模板写成这样也是醉了……这种 CTAN 上面没有的 class 或 package 很难排查错误……
现在对现有问题做一个整体分析吧:
algorithmic
环境是通过 list 来实现逐行排版算法的,即每一行算法其实是跟在\item
之后排版的。mdpi.cls
通过极其不正确的方法更改\item
的定义,就为了使用它定义的\itemsep
,模板负分。
如果你一定要用 algorithmic
,那么可以通过向导言区添加如下代码实现:
\usepackage{etoolbox}
\AtBeginEnvironment{algorithmic}
{\let\item\olditem}
这模板简直了……
from forum.
源代码里面的小毛病挺多的,这里只回答涉及 algorithmic
行距的问题。
首先,请去掉 algorithmic
里的手动换行 \\
,一共 3 处。
其实,并不是行距问题——第 1 行算法(4 行文本)与第 2 行算法(2 行文本)的内部是没有问题的,出问题的是这两行算法之间的间距。
改进方法:
% 加在导言区
\usepackage{etoolbox}
\makeatletter
\expandafter\patchcmd\csname\string\algorithmic\endcsname
{\itemsep\z@}
{\itemsep=2ex plus2pt\relax}% 根据个人喜好修改 2ex plus2pt 弹性距离
{}{}
\makeatother
真·改进方法:把算法重写,文本描述精简一些,不要一行算法出现多行文本描述。
from forum.
@OsbertWang 您的方法会将所有行距都变大,问题只是每行算法之间的距离太小。
@RuixiZhang42 你给的改进方法,我加入导言区域后没有效果,可否提供下您修改后的全部源码?
from forum.
你给的改进方法,我加入导言区域后没有效果
那就是 class 的问题了,你试试把 mdpi.cls
里的这句注释掉:
\renewcommand{\item}{\setlength{\itemsep}{\wideitemsep}\olditem}
大概看了一下 mdpi.cls
,代码写得不好。例如上面这个修改 \itemsep
的方法是很糟糕的,应该通过 enumitem
这些宏包来实现才对。
from forum.
@RuixiZhang42
谢谢你的帮助,
最后我将mdpi.cls
中你提示的那句话前面的一句中的-7pt
修改为-2pt
这个问题就解决了。
%% Bullet lists
\addtolength{\wideitemsep}{-2pt} %原来是 addtolength{\wideitemsep}{-7pt}
\let\olditem\item
\renewcommand{\item}{\setlength{\itemsep}{\wideitemsep}\olditem}
from forum.
不对啊,我修改的 class 是这样的:
%%%% Bullet lists
\newlength{\wideitemsep}
\setlength{\wideitemsep}{.5\itemsep}
\addtolength{\wideitemsep}{-7pt}
\let\olditem\item
%\renewcommand{\item}{\setlength{\itemsep}{\wideitemsep}\olditem}
然后这是我得到的结果:
一切正常……
from forum.
@RuixiZhang42 我重新再在试了下,我们两个的方法都可以实现算法行距的更改,但是会导致每条参考文献之间的间距变大。
所以,还是要想办法在算法这个区域进行修改。
from forum.
方便留下你的联系方式吗,有空的话,麻烦你帮我【有偿】调一个学位论文的Latex模板。
或者你加我Q 2320763254 也可以
from forum.
Related Issues (20)
- xeCJKfntef 和 ulem 联用时影响 \textbf 的作用范围 HOT 3
- 使用XeLatex构建中文文档源码时报错: xdvipdfmx:fatal: Unknown coverage format HOT 7
- 如何在article中调整所有caption为楷体 HOT 1
- linux和windows下伪粗效果不统一 HOT 6
- 中英文之间空格不习惯,如何去掉? HOT 11
- CJKfntef 是否具有 xeCJKfntef 的 subtract 功能?
- CTeX 3.0.212.1 xelatex编译通过,但无法生成pdf。dvipdfmx:fatal: typecheck: Invalid object type: -1 7 (line 2378)] HOT 6
- 关于LaTeX2e中文档类使用l3keys键对值的问题 HOT 8
- 当minipage环境和enumerate配合使用时,引入hyperref宏包会导致minipage顶部对齐失效 HOT 2
- 选项 leqno 与 fleqn 的缩写 HOT 13
- 我想将某些内容固定排版在偶数页的页面底部,但使用\ifodd\value{page}进行判断时在某些情形下会失效 HOT 4
- `jiazhu` 宏包是否能实现 `linespread < 1` 的排版效果?
- 如何将附录放在backmatter后同时对附录进行编号? HOT 6
- 能否实现英语句子中自动使用非中文字体的标点符号 HOT 3
- How to draw an specific feynman diagram with TikZ (LaTeX) HOT 4
- [NFSS] 关于使表示字体的控制序列等于\relax的作用(的问题) HOT 5
- [问题] pdfTeX下标点设置的另一种实现方式 HOT 14
- 安装了CTeX_3.0.215.2_Full.exe: 64位通用版本,打开软件或者使用中总是弹出要求注册的窗口,请问该如何处理 HOT 2
- 希望在同一个\section标题中多次使用脚注功能,并且可以在不手动指定具体数字的情况下生成不同的序号 HOT 5
- The font "SimHei" cannot be found.无法用伪粗体规避 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forum.