[Tex/LaTex] No natural log parentheses when typesetting


How can I insert parentheses around the content of the natural log? I want my document to show


but the code





\ln \left( x+1 \right)

will not produce this.

I should have specified that this issue was occurring in an equation (math mode).

Earlier today I was having some issues compiling due to corrupt temporary files (log and aux files) but never restarted my tex environment. Upon rebooting this evening, my original document is placing parentheses as expected.

I am marking Christian's post as the solution due to his effort and his explanation really clears up what the command \ln actually is (a comand without an argument).

Thank you all for your quick responses.

Best Answer

There are some possibilities to achieve this, but all of them require entering into math mode, i.e. with $...$, \(...\), or \[...\] or one of the various math environments such as equation and align.

But \ln{x+1} is not producing a pair of parentheses. In fact, it's the same as \ln x+1. \ln is an command without arguments, so \ln stands alone actually and ignores the following {...}.

If the parentheses are required in many occasions, wrapper macros, say \lnn and \lnb are useful, which uses either \left(...\right) or the medium spaced version \mleft(...\mright), both of which has the advantage of growing parenthesis for fractions etc.






\verb!$\ln x+1$ and $\ln{x+1}$ produce the same output!

  \fbox{$\ln x+1$}


produce the same output

With parentheses:

  \verb!\ln(x+1)! & \verb!\ln \left(x+1\right)! & \verb!\ln \mleft(x+1\mright)! \\
  \ln (x+1) & \ln \left(x+1\right) & \ln \mleft(x+1\mright) \\
   \verb!\lnb{x+1}! & \verb!\lnb{\dfrac{x+1}{x-1}}! & \verb+\lnn{n!}+\\
  \lnb{x+1} & \lnb{\dfrac{x+1}{x-1}} & \lnn{n!} \\


enter image description here

Related Question