On Sat, Jan 25, 2014 at 1:18 PM, Scott Kostyshak <skost...@lyx.org> wrote: > On Thu, Jan 23, 2014 at 12:14 PM, Scott Kostyshak <skost...@lyx.org> wrote: >> On Thu, Jan 23, 2014 at 11:32 AM, Jean-Marc Lasgouttes >> <lasgout...@lyx.org> wrote: >>> Le 23/01/2014 17:22, Scott Kostyshak a écrit : >>> >>>> $$s is for the system directory. So to reach those scripts one could >>>> do $$s/scripts/. I don't believe there is a variable for the user >>>> scripts directory and it is this directory that I understand the >>>> Customization manual to suggest. >>> >>> >>> Actually, the filettols.h file says: >>> >>> /** Takes a command such as "python $$s/scripts/convertDefault.py file.in >>> file.out" >>> * and replaces "$$s/" with the path to the LyX support directory >>> containing >>> * this script. If the script is not found, "$$s/" is removed. Executing >>> the >>> * command will still fail, but the error message will make some sort of >>> * sense ;-) >>> */ >>> std::string const libScriptSearch(std::string const & command, >>> quote_style style = quote_shell); >>> >>> $$s is not really a variable like the others, but a kind of macro. The real >>> syntax is actually $$s/foo/bar, and this searches for bar in user_dir/foo >>> and then system_dir/foo. >>> >>> Therefore $$s/scripts/pdfcopier.sh is correct and finds the script wherever >>> it is. >> >> Ah now I'm starting to understand. Do you happen to know under which >> cases $$s is interpreted? Putting the same copier command in different >> converters leads to the $$s sometimes being substituted and sometimes >> not. And contrary to the message you cited, the $$s/ is still included >> for me when the path is not found (I put in a bogus name). So this >> makes me think there's something that I'm still not understanding. >> >> Scott > > If latex=pdflatex is specified, the $$s is not substituted. The only > substitution is for $$i. This is not documented. I have a script that > I want to use to run pdflatex (and do other things like copy the log > file to a different directory). Because my script runs pdflatex, > specifying latex=pdflatex seems like the right thing to do. I'm > actually not sure what latex=pdflatex does. Does it tell LyX to make > sure that the converter is run as many times as necessary? I would > like to put this information in the customization manual, which > currently only says "This converter runs some form of LaTeX. This will > make LyX's LaTeX error logs available." I'm guessing it does more than > that. > > The attached patch fixes the "problem" for me. I have no idea if it is > correct. Is there a reason not to do the substitution, i.e. do we want > to disallow user scripts when latex=pdflatex? > > Also, it seems that now latex is not a flag and should be listed under > "The following three flags are not really flags at all because they > take an argument in the key = value format:" > Is that correct? > > Scott
Is there any reason not to make any of the other substitutions also? I would like to either fix this for 2.1 or fix the Customization manual. Scott