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

latex: formatting latex files that use {pythontex} or {sagetex} breaks everything horribly, due to indentation #4215

Open
williamstein opened this issue Nov 6, 2019 · 3 comments

Comments

@williamstein
Copy link
Contributor

Why -- formatting results in indentation of the code blocks, which is a syntax error in Python!

@williamstein
Copy link
Contributor Author

Here is an example pythontex file:

\documentclass[11pt]{article}
\usepackage{pythontex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{pyconsole}
x = 987.27
x = x**2
\end{pyconsole}

The variable is $x=\pycon{x}$
\end{document}

@williamstein williamstein changed the title latex: disable formating if the document contains {pythontex} or {sagetex}. latex: disable formatting if the document contains {pythontex} or {sagetex}. Aug 6, 2024
@williamstein
Copy link
Contributor Author

Wow this is a huge bug and is still a problem today!

A possibly better fix would be to remove the python code, format, and put the code back.

Also https://github.com/siefkenj/unified-latex might do a better job (NOPE -- the demo there is way worse: https://siefkenj.github.io/latex-parser-playground/)

@williamstein williamstein changed the title latex: disable formatting if the document contains {pythontex} or {sagetex}. latex: formatting latex files that use {pythontex} or {sagetex} breaks everything horribly, due to indentation Aug 6, 2024
@williamstein
Copy link
Contributor Author

Confirmed again -- this is a major bug in our latex editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant