LaTeX forum ⇒ LyXestauto relative paths

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
davidzentlermunro
Posts: 2
Joined: Wed Sep 09, 2020 11:00 am

estauto relative paths

Postby davidzentlermunro » Wed Sep 09, 2020 11:12 am

New lyx user here. Generally love it but have an issue using estauto with relative paths. When I use a full path it works fine (the lyx doc is in the paper folder):

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \estauto{C:/Dropbox/TopicX/paper/tables/Desc_Stat_2019new.tex}{15}{c}


When I use a relative path it doesn't find the file:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \estauto{/tables/Desc_Stat_2019new.tex}{15}{c}


I get the error: "! LaTeX Error: File `/tables/Desc_Stat_2019new.tex' not found."

However, relative paths seem to work fine for coauthors (and also work fine for figures for me). Any help much appreciated. Here is the preamble section for estauto:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. % *****************************************************************
  2. % Estout related things
  3. % *****************************************************************
  4. \let\estinput=\input % define a new input command so that we can still flatten the document
  5.  
  6. \newcommand{\estwide}[4][1]{
  7. \small{
  8. \vspace{-1ex}{
  9. \textsymbols% Note the added command here
  10. \begin{tabularx}
  11. {#1\textwidth}{H*{#3}{#4}}
  12. \toprule
  13. \estinput{#2}
  14. \bottomrule
  15. \addlinespace[.75ex]
  16. \end{tabularx}
  17. }
  18. }
  19. }
  20.  
  21. \newcommand{\estauto}[3]{
  22. \small{
  23. \vspace{-1ex}{
  24. \textsymbols% Note the added command here
  25. \begin{tabular}{l*{#2}{#3}}
  26. \toprule
  27. \estinput{#1}
  28. \bottomrule
  29. \addlinespace[.75ex]
  30. \end{tabular}
  31. }
  32. }
  33. }
  34.  
  35. % Allow line breaks with \\ in specialcells
  36. \newcommand{\specialcell}[2][c]{%
  37. \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
  38. }

User avatar
Ijon Tichy
Posts: 314
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Sep 09, 2020 11:37 am

If a path starts with a slash, it is always an absolute path from the root directory (of the current drive). So either use tables/Desc_Stat_2019new.tex (recommended) or dot syntax ./tables/Desc_Stat_2019new.tex

Note: I'm never using LyX.

davidzentlermunro
Posts: 2
Joined: Wed Sep 09, 2020 11:00 am

Postby davidzentlermunro » Wed Sep 09, 2020 11:55 am

Thanks, however neither of the suggested solutions worked: file still unrecognised (note my original code works for coauthors, just not me! this makes me think there's something I haven't yet installed that I should).


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 3 guests