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

Incorrect folding of table environment if a threeparttable with a tablenotes env is present #2771

Closed
cristobaltapia opened this issue Aug 17, 2023 · 3 comments
Labels

Comments

@cristobaltapia
Copy link

cristobaltapia commented Aug 17, 2023

Description

When a threeparttable environment is created with the corresponding tablenotes environment, then the folding of the table environment does not work correctly, as the text below (outside) the table environment gets folded too (see images below). This problem does not occur if only the threeparttable environment is present without the tablenotes (which of course makes no sense in practice).

Before folding:
Screenshot-2023-08-17-201917
After folding:
Screenshot-2023-08-17-202020

Steps to reproduce

  1. Create a *.tex file with the following content:
    \documentclass[a4paper]{article}
    \usepackage{threeparttable}
    
    \begin{document}
    
    \begin{table}[tbp]
      \caption{Test caption}
      \label{tab:test}
      \begin{threeparttable}
        \begin{tabular}{cc}
          a & b\tnote{*} \\
          1 & 2          \\
        \end{tabular}
        \begin{tablenotes}
          \item[*] note 1
        \end{tablenotes}
      \end{threeparttable}
    \end{table}
    
    Some text, which is hidden when the table is folded.
    
    \end{document}
  2. Place the cursor on the table environment and close the fold e.g. with zc.
  3. Observe that not only the table environment got hidden, but also the text that comes after the table.

Expected behavior

Only the table environment should fold.

Actual behavior

The text below the table environment gets hidden too.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Ubuntu 22.04.2 LTS
  Vim version: NVIM v0.9.1
  Has clientserver: true
  Servername: /run/user/1001/nvim.2335660.0

VimTeX project: test
  base: test.tex
  root: /home/tapiac
  tex: /home/tapiac/test.tex
  main parser: fallback current file
  document class: 
  compiler: latexmk
    engine: -lualatex
    options:
      -verbose
      -shell-escape
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    out_dir: out
    aux_dir: .aux
    callback: 1
    continuous: 0
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  qf method: LaTeX logfile
@cristobaltapia cristobaltapia changed the title Incorrect folding of table environment if a threeparttable with a tablenots env is present Incorrect folding of table environment if a threeparttable with a tablenotes env is present Aug 17, 2023
lervag added a commit that referenced this issue Aug 17, 2023
@lervag
Copy link
Owner

lervag commented Aug 17, 2023

Should be fixed now. Notice that the tablenotes environment is clearly a list environment, so the problem would also be resolved by adding it to the g:vimtex_indent_lists option. But this is not really well documented behaviour. :\

@lervag lervag closed this as completed Aug 17, 2023
@cristobaltapia
Copy link
Author

Thanks for the quick answer and fix! It works now :)
Thanks for the tip regarding g:vimtex_indent_lists. I didn't know about it.

@lervag
Copy link
Owner

lervag commented Aug 19, 2023

My pleasure, glad it works :)

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

No branches or pull requests

2 participants