GithubHelp home page GithubHelp logo

Comments (5)

shifujun avatar shifujun commented on July 23, 2024 1

图表命令的包装不仅仅是为了帮助LaTeX的初学者正确插入图片,而且还将图表的格式控制从用户手中拿走。因为学校规范是对图表有特别规定的,比如图片应该居中,图的标题应该在上,表的标题应该在下,图表前后间距。这些东西如果以零散的命令写出来,不能做到由模板统一控制这些格式。所以包装是有必要的。

其次,LaTeX的命令中只能定义一个可选参数,而且必须是第一个参数。这就很难灵活了。

总之,像你这样的LaTeX熟练用户,其实完全可以自己重新定义一个你喜欢的插图命令,只要和模板定义的效果一致,前后间距什么的都一样就行了啊。反正,我非常不建议直接将includegraphics命令和figure环境暴露在论文正文的源码中。

from uestcthesis.

shifujun avatar shifujun commented on July 23, 2024

我最近十分忙,不能详细解释代码。你能否先告诉我你是不是看过Wiki了?另外模板自定义的插图命令可以在源代码中找到。dtx文件编译出的源码说明文档中更清晰一些。

from uestcthesis.

shifujun avatar shifujun commented on July 23, 2024

另外,你下面示例的那段代码原本就不应该那样写。那里面有很多涉及格式的命令,按照LaTeX的思路应该先定义成自定义的命令,这样才便于修改便于移植。考虑到你已经写了很多这样的插图代码。我想唯一的办法就是用正则表达式进行替换。希望你会用正则表达式。

from uestcthesis.

andnot avatar andnot commented on July 23, 2024

@shifujun wiki以及issue的每一篇我都认真看过了。dtx我也编译出来看了,不过还是不大明白……

我的代码之所以这样写是因为在文章的不同地方我可能会希望以不同的格式排版,当然我这种用法可能不够高效,这里仅仅是个示例。

不过就我近几天使用模板的插图命令来看,我觉得这套自定义的命令与通常的插图命令语法还是有较大出入的,比如:

  • 对于常见的includegraphics插图命令来说,不会把图片宽高比作为必选参数(这个参数是以方括号形式存在的);而模板自定义的pic命令和addsubpic命令就必须输入这个参数(以花括号形式存在);
  • 类似的,\begin{pics}后面跟着的第三个参数是图片组的整体标签,这个属性对于插图来说应该并非必需的,而模板也将之规定为必要参数。如果缺失这个整体标签,编译就会出错;
  • 子图组中两个\addsubpic命令行之间必须紧邻,不能有空行,否则编译出的两幅子图位置就变成上下放置了。这个问题还是蛮隐蔽的,我检查了很久才发现。如果有遇到相同问题的同学,敬请注意。

这里列举的几个小问题,并非指摘自定命令,而仅仅是从我自身的使用体验来说,感觉和常见命令的用法出入有些大。我觉得关于命令的参数、属性规定,最好能有一些弹性。譬如一幅插图是否要加上标签,应该交给用户自己去定夺。

一点浅见,还望指正。

from uestcthesis.

andnot avatar andnot commented on July 23, 2024

@shifujun 原来如此,明白了!
多谢指教:)

P.S.
我今天又详细看了一遍dtx,虽然还是不太懂,但明显能感到这份模板的用心良苦。
能在毕业之前用上自己学校的LaTeX模板,真是一件幸事。
辛苦了。

from uestcthesis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.