jkuczm / mmacells

Mathematica cells in TeX
61 stars 18 forks source link

mmaCellGraphics oversize #41

Open laserroger opened 4 years ago

laserroger commented 4 years ago

It seems to me that the mmaCellGraphics can go oversize. I think probably it pass a width=\columnwidth as default \includegraphics parameter? I'm wondering whether there could be a way to specify a width or a scale, and how to set the default value.

jkuczm commented 4 years ago

By default mmacells macros don't pass any options to \includegraphics. So e.g. \mmaCellGraphics{Output}{filename} under the hood calls \includegraphics[]{filename} (without any options).

If you want to pass options to underlying \includegraphics you can do that using ig, moreig and deleteig keys. For example: \mmaCellGraphics[ig={width=5em}]{Output}{filename} will call \includegraphics[width=5em]{filename}. You can set default value using \mmaSet. E.g. after \mmaSet{ig={width=10em}} all calls to \includegraphics, done by mmacells macros, will have width=10em option (unless explicitly overridden).

When ig key is used only given options will be used. When moreig key is used given options are added to previously set default options. deleteig will delete given options from previously set defaults.

As to possible issues with \includegraphics, independent of mmacells, see "Image from \includegraphics showing in wrong image size" question on TeX StackExchange.

jkuczm commented 4 years ago

Since mmacells provides two macros calling \includegraphics, you may want to set separate default values for them. This can be done using graphics and cellgraphics keys (and their more... and delete... variants).

\mmaSet{morecellgraphics={ig={width=15em}}} will pass width=15em option only to \includegraphics calls done by \mmaCellGraphic. Similarly \mmaSet{moregraphics={ig={width=3em}}} will be used only by \mmaGraphics macro.