Skip to main content
add preload to bugfix
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

ToBoxes @ TeXForm[""];Convert`TeX`ExpressionToTeX; (* preload; do not remove! *) If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

ToBoxes @ TeXForm[""]; (* preload; do not remove! *) If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

Convert`TeX`ExpressionToTeX; (* preload; do not remove! *) If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

added 60 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

ToBoxes @ TeXForm[""]; (* preload; do not remove! *) If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

ToBoxes @ TeXForm[""]; (* preload; do not remove! *) If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

Fix typos.
Source Link
jkuczm
  • 15.2k
  • 2
  • 55
  • 89

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

Itit has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

It has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

It can be traced that, in minimal example from question, following definition of System`Convert`TeXFormDump`maketex function is used:

System`Convert`TeXFormDump`maketex[str_String?System`Convert`CommonDump`EmbeddedStringWithLinearSyntaxQ] := ( System`Convert`CommonDump`DebugPrint["------------------------------------"]; System`Convert`CommonDump`DebugPrint["maketex[str_String?EmbeddedStringWithLinearSyntaxQ]"]; System`Convert`CommonDump`DebugPrint["str: ", str]; System`Convert`TeXFormDump`MakeTeX[System`Convert`CommonDump`RemoveLinearSyntax[str, System`Convert`CommonDump`Recursive -> True]] ) 

Above definition calls System`Convert`CommonDump`RemoveLinearSyntax function with System`Convert`CommonDump`Recursive option. Problem is that, as we can see in function's options:

Options[System`Convert`CommonDump`RemoveLinearSyntax] (* {System`Convert`CommonDump`ConvertRecursive -> False} *) 

it has ConvertRecursive and not Recursive option. At least in versions 9 and 10. In v8 option name is Recursive.

To fix this bug, we can replace option, in maketex definition, with correct one:

If[FreeQ[Options[System`Convert`CommonDump`RemoveLinearSyntax], System`Convert`CommonDump`Recursive], DownValues[System`Convert`TeXFormDump`maketex] = DownValues[System`Convert`TeXFormDump`maketex] /. Verbatim[System`Convert`CommonDump`RemoveLinearSyntax][arg_, System`Convert`CommonDump`Recursive -> val_] :> System`Convert`CommonDump`RemoveLinearSyntax[arg, System`Convert`CommonDump`ConvertRecursive -> val] ]; 

It will fix maketex definition, in versions, in which RemoveLinearSyntax has different option than used in maketex.

After above fix, cell, from question, is correctly converted to $\TeX$, in all three tested Mathematica versions.

Source Link
jkuczm
  • 15.2k
  • 2
  • 55
  • 89
Loading