开发者

braces for Math in LaTeX

Is there any convenient way to type in braces in Math in Latex?

Especially when I have already typed in a lot of "(" and ")" instead of "\left(" and "\right)", how can I do a quick replacement? similarly for "{" and "}" and "[" and "]"?

Is it important to make such changes? I am writing a thesis.

Thanks and regards!

BTW: I mainly edit latex file in Texmaker and I know how to use emacs. If there is other editor that can do such replacement in a quick way, please let开发者_如何学Python me know.


EDIT:

If there is nothing taking more than one line height inside the braces, is there any difference in their appearances between using \left and \right and not using? Is it still necessary to use \left and \right ?


The point of the \left( \right) syntax is to have brackets automatically resize to fit their content.

A search/replace is a simple way to correct your brackets (M-% ( RET \left( RET in emacs for example, which will let you check each occurrence), or your editing environment might have a quick way to type them.


Assuming that you don't want to replace ('s with \left('s in your source files, you can try this hack:

\def\oparen{\left(} \def\cparen{\left)}
{\catcode`\(=\active \gdef({\oparen} \catcode`\)=\active \gdef){\cparen}}
\everymath={\catcode`\(=\active \catcode`\)=\active}

But this will probably break some of the macros using parentheses.

The same trick possible with {/} (use with extreme care!) and [/].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜