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

Wrong indentation with bytefields and the optional length argument #2031

Closed
lkfbr opened this issue Apr 11, 2021 · 1 comment
Closed

Wrong indentation with bytefields and the optional length argument #2031

lkfbr opened this issue Apr 11, 2021 · 1 comment

Comments

@lkfbr
Copy link

lkfbr commented Apr 11, 2021

Hello,
thank you for the great plugin!

I think I hit an edge case with automatic indentation (triggered on gg=G). When I use bytefield with \\ and the optional length argument (\\[1.5ex]) and there is an ampersand in the group before \\, then the indentation is not decreased. Removing either the length argument ([1.5ex]) or an ampersand from the leftwordgroup environment solves the problem.

minimal.vim

set nocompatible
let &runtimepath  = '~/.vim/plugged/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/plugged/vimtex/after'
filetype plugin indent on
syntax enable

minimal.tex

\documentclass{beamer}
\usepackage{bytefield}

\begin{document}

\begin{frame}[fragile]{Test}
\begin{center}
\begin{bytefield}{2}
\begin{leftwordgroup}{Test}
\bitbox{1}{Test}  & \bitbox{1}{Test}
\end{leftwordgroup} \\[1.5ex]
\end{bytefield}
\end{center}
\end{frame}

\begin{frame}{Next frame}
\end{frame}

\end{document}

Commands/Input
From the minimal.tex, indent it using gg=G.

Observed Behaviour

\documentclass{beamer}
\usepackage{bytefield}

\begin{document}

\begin{frame}[fragile]{Test}
	\begin{center}
		\begin{bytefield}{2}
			\begin{leftwordgroup}{Test}
				\bitbox{1}{Test}  & \bitbox{1}{Test}
			\end{leftwordgroup} \\[1.5ex]
			\end{bytefield}
		\end{center}
	\end{frame}

	\begin{frame}{Next frame}
	\end{frame}

	\end{document}

Expected Behaviour

\documentclass{beamer}
\usepackage{bytefield}

\begin{document}

\begin{frame}[fragile]{Test}
	\begin{center}
		\begin{bytefield}{2}
			\begin{leftwordgroup}{Test}
				\bitbox{1}{Test}  & \bitbox{1}{Test}
			\end{leftwordgroup} \\[1.5ex]
		\end{bytefield}
	\end{center}
\end{frame}

\begin{frame}{Next frame}
\end{frame}

\end{document}

Output from VimtexInfo

System info
  OS: Linux 5.11.11-200.fc33.x86_64
  Vim version: VIM 8.2 (1-2637)
  Has clientserver: true
  Servername: VIM

VimTeX project: test
  base: test.tex
  root: /tmp
  tex: /tmp/test.tex
  out: /tmp/test.pdf
  log: /tmp/test.log
  aux: /tmp/test.aux
  fls: /tmp/test.fls
  main parser: current file verified
  compiler: latexmk
    configuration: 
      continuous: 1
      callback: 1
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
  viewer: General
  qf: LaTeX logfile
    addqflist: 51
    fix_paths: 52
    set_errorformat: 50
  document class: beamer
lervag added a commit that referenced this issue Oct 12, 2021
@lervag
Copy link
Owner

lervag commented Oct 12, 2021

Sorry about taking so long! There's been a large backlog of issues and yours sort of got on the bottom of the pile...

But, I think this is finally fixed now. Please test. :)

@lervag lervag closed this as completed Oct 12, 2021
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