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

Issue with atypical Latex indentation #121

Open
peterjc opened this issue Oct 7, 2021 · 2 comments
Open

Issue with atypical Latex indentation #121

peterjc opened this issue Oct 7, 2021 · 2 comments

Comments

@peterjc
Copy link
Contributor

peterjc commented Oct 7, 2021

e.g. https://github.com/peterjc/biopython/blob/biopython-175/Doc/Tutorial/chapter_phenotype.tex

Reduced to a smaller test case, note the inconsistent indentation of lines 4 and 6 (which LaTeX does not care about):

\begin{description}
  \item[Well identifier]
    If you know the well identifier (row + column identifiers) you can access the desired well directly.
\begin{minted}{pycon}
    >>> record["A02"]
    \end{minted}

  \item[Well plate coordinates]
    The same well can be retrieved by using the row and columns numbers (0-based index).

%doctest examples lib:numpy
\begin{minted}{pycon}
>>> from Bio import phenotype
>>> record = list(phenotype.parse("Plates.csv", "pm-csv"))[-1]
>>> print(record[0, 1].id)
A02
\end{minted}

more text here...

\end{description}

The output:

\begin{description}
  \item[Well identifier]
    If you know the well identifier (row + column identifiers) you can access the desired well directly.
\begin{minted}{pycon}
>>> record["A02"]
\end{minted}

tem[Well plate coordinates]
The same well can be retrieved by using the row and columns numbers (0-based index).

test examples lib:numpy
in{minted}{pycon}
>>> from Bio import phenotype
>>> record = list(phenotype.parse("Plates.csv", "pm-csv"))[-1]
>>> print(record[0, 1].id)

\end{minted}

more text here...

\end{description}

Notice line 8 onwards (after the end of the code snippet) has lost the first few characters, it should still start \item

I suspect the issue is the two code blocks with text in between being treated as one code block?

@asottile
Copy link
Contributor

asottile commented Oct 7, 2021

unless you're planning on working on this -- I don't think this will be fixed (looks like you added the latex implementation)

@peterjc
Copy link
Contributor Author

peterjc commented Oct 7, 2021

I suspected you might say that - I'm not sure without digging into it if this is an oversight in just the recently added \begin{minted}{pycon} regex, or all the LaTeX patterns in general. LaTeX can be frustratingly flexible on somethings (like the white space indentation here) while incredibly precise on others.

I've been off work sick this week, and am unlikely to look any further at this in the next week or so.

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

No branches or pull requests

2 participants