LyXestauto relative paths

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

estauto relative paths

Post by davidzentlermunro »

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

\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

\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

% *****************************************************************
% Estout related things
% *****************************************************************
\let\estinput=\input % define a new input command so that we can still flatten the document

\newcommand{\estwide}[4][1]{
  \small{
        \vspace{-1ex}{
            \textsymbols% Note the added command here
            \begin{tabularx}
            {#1\textwidth}{H*{#3}{#4}}
            \toprule
            \estinput{#2}
            \bottomrule
            \addlinespace[.75ex]
            \end{tabularx}
            }
        }   
  }

\newcommand{\estauto}[3]{
  \small{
        \vspace{-1ex}{
            \textsymbols% Note the added command here
            \begin{tabular}{l*{#2}{#3}}
            \toprule
            \estinput{#1}
            \bottomrule
            \addlinespace[.75ex]
            \end{tabular}
            }
        }
  }

% Allow line breaks with \\ in specialcells
\newcommand{\specialcell}[2][c]{%
    \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

estauto relative paths

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
davidzentlermunro
Posts: 4
Joined: Wed Sep 09, 2020 11:00 am

estauto relative paths

Post by davidzentlermunro »

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).
SantiagoCC
Posts: 1
Joined: Mon Apr 12, 2021 11:21 pm

estauto relative paths

Post by SantiagoCC »

davidzentlermunro wrote: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).
Did you ever solve this? I have the same problem. Weird enough, if I export from lyx to to LaTeX and compile there, it works perfectly, making me think the problem might be with the lyx compiler.
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

estauto relative paths

Post by Ijon Tichy »

Note: LyX uses a build folder for the LaTeX runs. So files, that are not automatically copied to the build folder should either have absolute paths or the relative path has to be relative to the build folder.

Disclaimer: I do not use LyX, because it is nice, if everything works, but a mess, if something does not. In such a case, you always have to know LyX and LaTeX to find out, whether the problem is LyX or LaTeX.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply