Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\documentclass[10pt,a4paper]{book}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[lite]{mtpro2}

\begin{document}
    \[\begin{PARENS}    
    \frac{x}{y} 
    \end{PARENS} \]
\end{document}

The code above gives the error

Argument of \frac has an extra }. \frac.

But if i write the \frac{x}{y} command in {} then there is no error.

I just want to learn how i can fix it?

share|improve this question
2  
According to pctex.com/files/managed/1/1b/mtpro2Abbrev.pdf, \PARENS is a command expecting an argument, so \PARENS{\frac{x}{y}} should be correct. Can you test? (I don't have mtpro2 installed.) –  Joseph Wright Aug 10 at 11:26
    
@JosephWright Tested it; is correct. –  JPi Aug 10 at 11:41

1 Answer 1

up vote 4 down vote accepted

The documentation for mtpro2 makes it clear that \PARENS is a command taking one argument

\PARENS{\frac{x}{y}}

It's unsurprising that if you use it as an environment odd things happen (here, it grabs \frac but not the arguments to \frac, then problems arise as \frac looks for two arguments and fails to find them).

share|improve this answer
    
i wonder if there is a way to use \PARENS as environment without using {}. Can we add {} automatically, for example, using a command. –  mert Aug 10 at 11:56
    
@mert You could define a command which uses the environ package to collect up the content of the environment then use it as the argument to \PAREN. I think that would be a separate question :-) –  Joseph Wright Aug 10 at 11:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.