Skip to main content
14 events
when toggle format what by license comment
Jun 10, 2012 at 7:05 comment added Sidious Lord @Rojo, I have accepted your answer. It seems that Invisible sets an option ShowContents -> False and then you use "BoxRules" to search for it and replace it with \hphantom.
Jun 10, 2012 at 7:02 vote accept Sidious Lord
Jun 9, 2012 at 21:36 comment added jmlopez @Rojo, That seems to be doing the job. I just found out about the option "BoxRules" but I still can't make it work correctly. Not sure if I should make it another question, but Sidious Lord question has gotten me to think more about how to write proper rules to convert from mms to tex. Consider the following: RawBoxes@ConvertTeXTeXToBoxes[ "\\int_{a\\hphantom{b} c}^{\\hphantom{a} b\\hphantom{c} d}"]. How would you make it write it correctly in mma? You know what, I am making it another question.
Jun 9, 2012 at 21:26 comment added Rojo @SidiousLord you too check the edit
Jun 9, 2012 at 21:26 comment added Rojo @jmlopez, see my edit, something like that?
Jun 9, 2012 at 21:25 history edited Rojo CC BY-SA 3.0
added 868 characters in body
Jun 9, 2012 at 20:27 comment added murray @Rojo: No, the TeX W^I{}_J is different from the indicated construction with \hphantom in that the subscript of the former is displaced too far horizontally.
Jun 9, 2012 at 19:33 comment added jmlopez @Rojo, I don't think ConversionRules is what is needed here since they just tell Mathematica how to export a styled cell to say TeX or HTML. I was having a similar problem in which mma didn't give me the correct TeX transformation. I think this is all done with ConvertTeXBoxesToTeX but I have no idea what this function wants so that we can get an \hphantom out of it.
Jun 9, 2012 at 16:20 comment added Sidious Lord Thanks for the suggestion. I'll try to see if I can make it work.
Jun 9, 2012 at 16:07 comment added Rojo @SidiousLord if you haven't, search for ConversionRules in the site, and check out if you can add your own rules to export some invisible box into a \hphantom. I haven't used ConversionRules yet
Jun 9, 2012 at 15:54 comment added Sidious Lord As I said, in \TeX\ the placement of the indices will be a bit off. For example, if I have a big symbol on which I want to put indices, if I follow your method I get $\int_{a}^{b}{}_{c}{}^{d}$ whereas with `\hphantom' I get $\int_{a \hphantom{b} c}^{\hphantom{a} b \hphantom{c} d}$.
Jun 9, 2012 at 15:40 comment added Rojo @SidiousLord, why does it feel like a hack? To me, that I'm not used to latex so much, inserting an invisible version of your superscript in the subscript feels more like a hack
Jun 9, 2012 at 15:12 comment added Sidious Lord Yes, I thought about doing it this way, but I would say this is a hack and there should be something more appropriate built-in in Mathematica (but it looks like there isn't anything better at the moment). I have to test this more, but it looks to me like the alignment of indices may come out wrong in some circumstances.
Jun 9, 2012 at 15:02 history answered Rojo CC BY-SA 3.0