I would like to use latex to produce math output like this:

enter image description here

Please, no scolding about how this looks like a ransom note, makes your eyeballs bleed, etc. This is for didactic purposes in specific situations in teaching physics. The first one is meant to focus the student's eyes on the main physical relationship, so they're not distracted by the coupling constants. The second one (for students at a much lower mathematical level) is to express the idea that when a force is applied to a small mass, the result is a big acceleration.

I've tried three methods:

(1) It seems that code like this only partly works:

${\Huge a}=F/{\scriptstyle m}$

In the outpout, the "a" isn't enlarged at all, although the "m" is small. I would also like to be able to produce more extreme sizes than Huge and scriptstyle.

(2) I also tried accomplishing this using pdf2svg (which I believe is what textext does under the hood), but the results seemed extremely buggy. I created separate pdf files for the small and large stuff, then converted to svg. But when I cut and pasted from one of the svg files to the other, the results were garbled (completely incorrect text).

(3) I tried using textext in inkscape. However, textext seems to be broken in the version of inkscape I'm using (0.92). With any input (even input not involving math mode) I get a long error message starting with "Error: /undefined in .makeoperator."


You can use \scalebox from the graphicx package for this. The command takes two arguments, the scale (less than one scales down, more than one scales up) and the content. Note that the content needs to be set in math mode even when you are already in math mode. The scale can be set arbitrarily large or small.

For convenience you can define a new command that inserts math mode automatically.

Note that the normal spacing that LaTeX provides for math can no longer be applied between size changes so you may need to insert manual spacing here and there (such as between a and =F in the example below).



$\mathrm{div}E=\scalebox{0.5}{$4\pi k$}\rho$

$\scalebox{4.0}{$a$}\ \scalebox{2.0}{$=F/$}\scalebox{0.7}{$m$}$

$\mathrm{div}E=\mscale{0.5}{4\pi k}\rho$

$\mscale{4}{a}\ \mscale{2}{=F/}\mscale{0.7}{m}$


enter image description here


I'm not really sure about the pedagogical usefulness of this idea. I'm pretty sure the output is as ugly as it can be. ;-)





$\Div\mathrm{E}=\ransom{\tiny}{4\pi k}\rho$



enter image description here

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.