3

How do I make other terms in equation to the same size as tfrac terms

\begin{equation}
X=\tfrac{2J^2}{4J^2+U^2/4}\sin^2\big(({\sqrt{4J^2+U^2/4}})t\big)
\end{equation}

looks like enter image description here

How do I adjust the size of the term inside sin^2 to match with the tfrac terms ?

4

Do you mean like this?

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ascii]{inputenc}
\usepackage{amsmath}



\begin{document}
\begin{equation}
    X=\tfrac{2J^2}{4J^2+U^2/4}
    \scriptstyle \sin^2\bigl(({\sqrt{4J^2+U^2/4}})t\bigr)
\end{equation}
\end{document}

Or maybe you prefer this (bigger “sin”, amended spacing, resized parentheses…):

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ascii]{inputenc}
\usepackage{amsmath}



\begin{document}
\begin{equation}
    X=\tfrac{2J^2}{4J^2+U^2\!/4}
    \sin^2\Bigl({\scriptstyle \bigl(\sqrt{4J^2+U^2\!/4}\bigr)\,t}\Bigr)
\end{equation}
\end{document}

Output (of the second code sample):

Output of the second code sample


Addendum: @egreg criticism about the above parentheses being “awful” is too much for me to cope with: I must post some other attempt. Perhaps this one could be regarded as acceptable:

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
    X=\tfrac{2J^2}{4J^2+U^2\!/4}
    \sin^2({\scriptstyle \sqrt{4J^2+U^2\!/4}\:\cdot\:t})
\end{equation}
\end{document}

This is the corresponding output:

Output of the third code sample

  • I can understand keeping the t at the end; but the size of the parentheses is awful. – egreg Apr 18 '16 at 23:07
5

Why not :

enter image description here

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
    X=\tfrac{2J^2}{4J^2+U^2\!/4}
    \sin^2\bigl({\scriptstyle t\,\sqrt{4J^2+U^2\!/4}}\bigr)
\end{equation}
\end{document}
  • 1
    Welcome to TeX.SE! A quick hint: If you highlight the lines of code and click on the {} "button" in the row above the editing window, the lines will be indented by four spaces and, importantly, will be pretty-printed by the site software. – Mico Apr 18 '16 at 3:46
  • 3
    I find this the best answer in the lot: moving the t avoids the need for additional parentheses and \, commands are tastefully applied. I'd suggest a \, more, just before the closing parenthesis, though. I also removed two lines: they're not needed for the example and might be confusing readers. – egreg Apr 18 '16 at 8:28
  • I like this, but I think you dropped a factor of 2? – wchargin Apr 18 '16 at 12:11
  • @egreg: I too was tempted to move the “t” before the square root, but I decided to respect the OP’s preference for the ordering of the factors: I think (s)he deliberately put what is presumably the variable for t ime at the end, to keep the pattern of \sin^2(\omega t). Also, the two line you removed are mine! ;-) – GuM Apr 18 '16 at 23:01
  • 1
    @GustavoMezzetti An inexperienced reader might think that the solution depends on this package option. – egreg Apr 18 '16 at 23:21
4

I think maybe you'll have too great a contrast betwwen different parts of your formula. I suggest using the\medmath command, from nccmath, which reduces displaymath by about 80 %. Compare:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools, nccmath}

\begin{document}

\begin{align*}
X & =\medmath{\frac{2J²}{4J²+U²/4}\sin²\Bigl(\Bigl({√{4J²+U²/4}}\Bigr)t\Bigr)}
\\
X & =\tfrac{2J²}{4J²+U²/4}\sin²{\scriptstyle\Bigl(\Bigl({√{4J²+U²/4}}\Bigr)t\Bigr)}
\\
X & =\frac{2J²}{4J²+U²/4}\sin²\Bigl(\Bigl({√{4J²+U²/4}}\Bigr)t\Bigr)
\end{align*}

\end{document} 

enter image description here

  • 1
    the inner parentheses for the \sin would look better if they "covered" the radical sign more completely; the relative size of the outer parens looks good, so if the inner parens get larger, the outer ones should also, – barbara beeton Apr 18 '16 at 0:59
  • @barbara beeton: You're right. I wasn't in a (sentimental?) mood to tackle this problem, and I left this part of the O.P.'s code as is. I'll change that in a moment – Bernard Apr 18 '16 at 1:04
2

Actually, I think that the problem is that you are "misusing" \tfrac because it is meant to fractions in in-line text. If instead you use \frac then the latex markup is simpler your problem goes away:

enter image description here

The code:

\documentclass{amsart}
\begin{document}

    \textbf{With tfrac}
    \begin{equation}
        X=\tfrac{2J^2}{4J^2+U^2/4}\sin^2\big(({\sqrt{4J^2+U^2/4}})t\big)
    \end{equation}

    \textbf{With frac}
    \begin{equation}
        X=\frac{2J^2}{4J^2+U^2/4}\sin^2\big(({\sqrt{4J^2+U^2/4}})t\big)
    \end{equation}

\end{document}
  • thanx. there are long multiple equations involved and each terms are little lengthy, so if I use \frac it takes whole lot of space and it does not look nice. \scriptstyle with \tfrac solved the problem. – ss1729 Apr 18 '16 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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