## python – sympy in jupyter notebook cannot give answer in latex form

I encountered a problem when using sympy in Jupyter Notebook. Here is the code
(!(enter image description here)(1))(1)

import sympy as sp
sp.init_printing()
x,y = sp.symbols('x,y')
expr = x**2 + y**2
expr

Adding sympy.init_printing() will cause cessation of jupyter notebook. How could I solve this problem? Thanks!!
p.s. configuration: win10 + python3 + TexLive
(1): https://i.stack.imgur.com/uZfcD.png

## export – Exporting string with newline and tab symbols to LaTeX

We have a string that has “tab” symbol between letters “B” and “C” and “newline” symbol between letters “C” and “D”:

Input:

"A BtCnD"

Output:

The output is formatted accordingly to special symbols used.

But when I export the same string to LaTeX, the special symbols n and t are interpreted literally like so:

Input:

ExportString["A btcnd", "TeXFragment"]

Output:

[text{A b$$backslash$$tc$$backslash$$newlined}]

If you put this Latex code into some TeX file the document will display literally “A BtCnD” and without “tab” and “newline” symbols.

How to tell the Mathematica to export the special symbols into LaTeX accordingly?

## plotting – How to properly write multiline text with LaTeX symbol in a frame and with background

I wanted to include a number of text-box with background color white inside a plot. The text inside the box will also have LaTex expressions as well as multiple lines.

Is there any way to include multiline text (including LaTeX symbol) inside a plot?

In addition I want to set frame and background color for the box.
I am currently using Epilog and Prolog to include such text.

ListLinePlot(
Table({k,
PDF(BinomialDistribution(50, p), k)}, {p, {0.3, 0.5, 0.8}}, {k, 0,50}),
Filling -> Axis,
FillingStyle -> Automatic,
(**Option-1**)
Epilog -> Text(Style(ToExpression("\text{E}_{x} \n text2", TeXForm, HoldForm),Bold),{30, 0.13}),
(**Option-2**)
Prolog -> {Inset(Framed( "E_{x}ntext2" , RoundingRadius -> 5,Background -> White), {45, 0.13})}
(**Option-3**)
(*Prolog -> {Inset(Framed( MaTeX("E_{x}\n text2" ) , RoundingRadius -> 5,Background ->White),{45,0.13})}*)
)

Option-1 fails writing E_{x} as well as breaking line.
Option-2 fails writing E_{x} but breaks line.
Option-3 is the one I wanted but it fails in breaking line.

Is there any way to achieve this.

Moreover I also wanted to ask, what should one do if one has to include say more that two text boxes?

## pdflatex – How to align equation systems in LaTeX?

I’m new to LaTeX and I’m having issues with aligning this equation system. I’m trying to align it in a way such that the x’s, +’s, y’s and =’s are all aligned. I don’t know if that’s possible or not, but I couldn’t find help online.

I’ve tried using systeme*, this way it aligned the =’s.

[
systeme*{ax + by=c,dx^2 + ey^2=f}
]

My next attempt was to use &, which I’ve noticed you can only use once to change the alignment.

[
systeme*{ax& + by=c,dx&^2 + ey^2=f}
]

This way it aligned the x’s.

Thanks for you help.

## ms office – hat{} symbol “^” in a LaTeX equation in Pages disappears after being exported to a MS Word file

I use Pages 10.2 (7028.0.88) on macOS 10.15.7. As I finished editing my Pages file and exported it to a .docx file for my colleagues, all the equations in it were successfully passed to the new file and became editable in MS Word, except that all the hat{}‘s “^” were missing. I also tried widehat{} but encountered the same problem.

Is there any other LaTeX symbol that looks like hat{} “^” and can stay in the equations after being exported to .docx?

## python – Latex formula in Pandas DataFrame

I want to make a Pandas DataFrame in which some columns are of Latex formula (IPython.core.display.Latex) type. When I display the DataFrame in Jupyter Notebook, the formulae are not displayed, instead I see only the type name. Is there any way to show the formulae when they are some elements of a Pandas DF?

import pandas as pd
from IPython.display import Latex

my_dict = {'Case1':{'Formula1':Latex('$$x^{-1}$$'), 'Formula2':Latex('$$x^2$$')},
'Case2':{'Formula1':Latex('$$x^{-2}$$'), 'Formula2':Latex('$$x^4$$')}}

df = pd.DataFrame(my_dict)
display(df.transpose())

## latex – Missing files after installing texlive-extra-utils

I’ve recently switched from U16.04 to U20.04.

For my work, I use a lot latex. After installing the all packages, including texlive-extra-utils, the scripts/programs pdfjoin, pdf90, pdf180, and pdf270 are missing.

They were available after the installation of latex on U16.04.
Why are they no present in U20.04?

Notice that pdfjam is present on my computer.

## Generating PDF with LaTeX source using PHP on webhosting

I am preparing for my students some tests that should be generated by PHP on a webhosting. I have stored latex-source codes in database and I would like to get PDF together using PDFLaTeX. Is there any solution for that? I can not find anything in PHP.

The obvious answer would be to generate the tex-file and then use shel_exec with texlive install on my machine. But since it is on the webhosting where I can not install texlive, I can’t do that in general. I would use mPDF or FPDF, but I need mathematical environment.

If it is not with PHP, is there any change to use some JavaScript libraries on frontend to generate PDF for download?

Thank you.

## Como faço para centralizar todo o conteúdo de uma tabela no LaTeX utilizando Overleaf?

Todo o conteúdo da minha tabela está todo para a esquerda, como faço para centralizar o conteúdo das colunas e linhas da tabela?

begin{table}(H)
centering
footnotesize