简体   繁体   English

MediaWiki中是否有等效的Latex \\ newcommand

[英]Is there an equivalent of latex \newcommand in mediawiki

I want to create a command in mediawiki. 我想在mediawiki中创建一个命令。 For example, in latex I can do 例如,在乳胶中,我可以

 \newcommand{\concept}{\textbf}

Is it possible to create an alias for '''foo''' and so on? 是否可以为'''foo'''创建别名等等?

MediaWiki为此使用模板

Like Roger said , you can create templates ,create a page called 'template:foo' with content '''foo''' then you can insert it to where ever you wanted by placing {{foo}}. 就像Roger所说的那样,您可以创建模板,创建一个名为'template:foo'且内容为'''foo'''的页面,然后可以通过放置{{foo}}将其插入到您想要的任何位置。

and when you change the content of the page template:foo all other pages where {{foo}} is placed will also change accordingly. 当您更改页面模板:foo的内容时,放置{{foo}}的所有其他页面也将相应地更改。

you can also insert it by placing {{subst:foo}} this will substitute the content of the template to that place. 您还可以通过放置{{subst:foo}}来插入它,这会将模板的内容替换到该位置。 but when you change the template page later , it won't reflect here. 但是当您以后更改模板页面时,它不会在此处反映出来。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM