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

后端 未结 6 1795
梦谈多话
梦谈多话 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:18

    Use \def command:

    \def \variable {Something that's better to use as a variable}
    

    Be aware that \def overrides preexisting macros without any warnings and therefore can cause various subtle errors. To overcome this either use namespaced variables like my_var or fall back to \newcommand, \renewcommand commands instead.

提交回复
热议问题