Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add print to .tex file example to examples.ipynb #199

Merged
merged 7 commits into from
Dec 7, 2023
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,38 @@
"\n",
"solve"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"$$ \\displaystyle \\frac{-b + \\sqrt{b^{{2}} - {4}ac}}{{2}a} $$"
],
"text/plain": [
"<latexify.frontend.LatexifiedFunction at 0x7f58824de860>"
],
"text/plain": [
"The above equation is sent to a new file, latexifyExample.tex"
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks this is not a real output. I think it is better to put this paragraph as a comment of the code block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Perhaps rather than relocate this, removal may be sufficient if the current comment at the top of the block is descriptive enough.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's remove it as you said.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed that plain text you highlighted in the recent commit. Let me know how it looks.

},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# We can also print the output to a .tex file\n",
"@latexify.expression\n",
"def solve1(a, b, c):\n",
" return (-b + math.sqrt(b**2 - 4*a*c)) / (2*a)\n",
"\n",
"with open('latexifyExample.tex', 'w') as fp: \n",
" print(solve1, file = fp) \n"
]
}
],
"metadata": {
Expand Down