Skip to content

Technical note on \endinput removing trailing space might be wrong? #210

@user202729

Description

@user202729

The part that "\endinput ends the content before the final space" may be a documentation error.

I believe that \endinput by itself does not remove the trailing space by itself, rather it's a side effect of the fact that TeX ignores spaces after control sequences.

E.g. in the following code

\documentclass{article}
\usepackage{pythontex}
\begin{document}
\begin{pycode}
def f():
	print(r"1\empty")
\end{pycode}
123\pyc{f()}456
\end{document}

The space is not visible. While in the following code

\documentclass{article}
\usepackage{pythontex}
\begin{document}
\begin{pycode}
def f():
	print(r"1\endinput 77")
\end{pycode}
123\pyc{f()}456
\end{document}

The space is visible.

As such, I think it would be better to simply remove the suggestion of using \endinput to remove the trailing space. Using % suffices. (or even \empty / \relax but this one would be confusing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions