Skip to content

Working with nested standalone files #2234

@cuppajoeman

Description

@cuppajoeman

Description

Trying to compile nested standalone files breaks because of path name.

Steps to reproduce

.
├── main.tex
└── sub
    ├── sub2
    │   └── sub2.tex
    └── sub.tex

main.tex

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{standalone}

\begin{document}

\input{sub/sub}

\end{document}

sub.tex

\documentclass{standalone}
\usepackage{standalone}
\begin{document}
A
\input{sub/sub2/sub2}
\end{document}

sub2.tex

\documentclass{standalone}
\begin{document}
B
\end{document}

Setup the code sample, vim main.tex then \ll everything works as expected. Then cd sub and vim sub.tex and :VimtexToggleMain, then run \ll and it fails because it doesn't know where sub/sub2/sub2 is. To fix it we have to do sub2/sub2 which will break compilation in the main file.

Expected behavior

Allowing compilation of a nested standalone document

Actual behavior

Compilation of nested standalone document fails.

Do you use a latexmkrc file?

No

VimtexInfo

System info
  OS: Manjaro Linux
  Vim version: NVIM v0.6.0-dev+116-g35041432b
  Has clientserver: true
  Servername: /tmp/nvim41AJVy/0

VimTeX project: main
  base: main.tex
  root: /home/ccn/Downloads/standalone test
  tex: /home/ccn/Downloads/standalone test/main.tex
  out: /home/ccn/Downloads/standalone test/build/main.pdf
  log: /home/ccn/Downloads/standalone test/build/main.log
  aux: /home/ccn/Downloads/standalone test/build/main.aux
  fls: /home/ccn/Downloads/standalone test/build/main.fls
  main parser: current file verified
  source files:
    main.tex
    sub/sub.tex
    sub/sub2/sub2.tex
  compiler: latexmk
    configuration: 
      continuous: 1
      callback: 1
      build_dir: build
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
  viewer: Zathura
    xwin id: 0
  qf: LaTeX logfile
    addqflist: 62
    fix_paths: 63
    set_errorformat: 61
  document class: article
  packages:
    adjcalc
    adjustbox
    collectbox
    currfile
    epstopdf-base
    filehook
    filehook-2020
    filemod-expmin
    gincltex
    graphics
    graphicx
    ifluatex
    ifoddpage
    iftex
    inputenc
    keyval
    kvoptions
    kvsetkeys
    ltxcmds
    shellesc
    standalone
    svn-prov
    trig
    trimclip
    varwidth
    xkeyval

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions