Is there any way I can define a variable in LaTeX?

后端 未结 6 1794
梦谈多话
梦谈多话 2020-12-04 04:57

In LaTeX, how can I define a string variable whose content is used instead of the variable in the compiled PDF?

Let\'s say I\'m writing a tech doc on a software and

6条回答
  •  遥遥无期
    2020-12-04 05:35

    For variables describing distances, you would use \newlength (and manipulate the values with \setlength, \addlength, \settoheight, \settolength and \settodepth).

    Similarly you have access to \newcounter for things like section and figure numbers which should increment throughout the document. I've used this one in the past to provide code samples that were numbered separatly of other figures...

    Also of note is \makebox which allows you to store a bit of laid-out document for later re-use (and for use with \settolength...).

提交回复
热议问题