Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 18:03, Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. I agree with this design - it is very intuitive, and it has the advantage, that one can not accidentally break one template when editing another one. Would definitely be the optimal solution. Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8L++MACgkQoYgNqgF2egpb4QCfXem1JRU1x3qTwFue6XWW0UEJ T7kAn1KWYbvMiNGyqsLkk+PdQd+3FLlq =hwgu -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
On 05/01/2012 12:03 PM, Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen On top of that it would be nice to load only some of these files as we do now for modules. -- Julien
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 18:03, Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. I agree with this design - it is very intuitive, and it has the advantage, that one can not accidentally break one template when editing another one. Would definitely be the optimal solution. Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8L++MACgkQoYgNqgF2egpb4QCfXem1JRU1x3qTwFue6XWW0UEJ T7kAn1KWYbvMiNGyqsLkk+PdQd+3FLlq =hwgu -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
On 05/01/2012 12:03 PM, Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen On top of that it would be nice to load only some of these files as we do now for modules. -- Julien
Re: How to prevent "escaping" for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 18:03, Jürgen Spitzmüller wrote: > Jean-Marc Lasgouttes wrote: >> I think we should not read both files, since the semantics of >> replacing a system file by a user one should be preserved. It >> would be better to load a external_templates.user file (or any >> better name you come up with), like we load several flavors of >> lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). > > I'm not sure I understand. IMHO the user file should be read after > the system file. So any external template in the system file that > is not in the user file should be kept, new user-contributed files > should be added. If templates are in both files, the user version > should override the system version. > > Having said that, I wonder if it would not be better to split this > file into one file per template, having > templates/pdfpages.template, templates/xfig.template etc. Then we > could read all *.template files in both directories, and stick with > the practice of reading only one of each, like we do for *.layout > etc. I agree with this design - it is very intuitive, and it has the advantage, that one can not accidentally break one template when editing another one. Would definitely be the optimal solution. Rainer > > Jürgen > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8L++MACgkQoYgNqgF2egpb4QCfXem1JRU1x3qTwFue6XWW0UEJ T7kAn1KWYbvMiNGyqsLkk+PdQd+3FLlq =hwgu -END PGP SIGNATURE-
Re: How to prevent "escaping" for LaTeX when in module?
On 05/01/2012 12:03 PM, Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen On top of that it would be nice to load only some of these files as we do now for modules. -- Julien
Re: How to prevent escaping for LaTeX when in module?
On 2012-01-05, Rainer M Krug wrote: On 05/01/12 16:12, Jürgen Spitzmüller wrote: Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. I'll do so - thanks. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. Ugly hack - but an option. Another one is an auxiliary command that is defined by a second style. See dinbrief.layout for an example: # dinbrief's \phone has 2 args, area and number. We define an empty # command that can be set by the Area_Code style Preamble \newcommand{\areacode}{} EndPreamble Style Area code CopyStyle DinBrief LabelString Area Code: LatexName renewcommand{\areacode} End Style Telephone CopyStyle DinBrief LabelString Telephone: LatexName phone LatexParam {\areacode} End Günter
Re: How to prevent escaping for LaTeX when in module?
On 2012-01-05, Rainer M Krug wrote: On 05/01/12 16:12, Jürgen Spitzmüller wrote: Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. I'll do so - thanks. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. Ugly hack - but an option. Another one is an auxiliary command that is defined by a second style. See dinbrief.layout for an example: # dinbrief's \phone has 2 args, area and number. We define an empty # command that can be set by the Area_Code style Preamble \newcommand{\areacode}{} EndPreamble Style Area code CopyStyle DinBrief LabelString Area Code: LatexName renewcommand{\areacode} End Style Telephone CopyStyle DinBrief LabelString Telephone: LatexName phone LatexParam {\areacode} End Günter
Re: How to prevent "escaping" for LaTeX when in module?
On 2012-01-05, Rainer M Krug wrote: > On 05/01/12 16:12, Jürgen Spitzmüller wrote: >> Rainer M Krug wrote: >>> One more question: how can I deal with a function which requires >>> two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE >>> LINK} in a module? Is there anywhere an example on how an inset >>> with two parametern looks? >> In Paragraphy styles (not in layouts I think), you can specify >> RequiredArgs. See Customization.lyx. > I'll do so - thanks. >> A workaround in layouts is to simply insert }{ as a separator. This >> is a bad hack, though. > Ugly hack - but an option. Another one is an auxiliary command that is defined by a second style. See dinbrief.layout for an example: # dinbrief's \phone has 2 args, area and number. We define an empty # command that can be set by the Area_Code style Preamble \newcommand{\areacode}{} EndPreamble Style "Area code" CopyStyle DinBrief LabelString "Area Code:" LatexName "renewcommand{\areacode}" End Style Telephone CopyStyle DinBrief LabelString "Telephone:" LatexName phone LatexParam {\areacode} End Günter
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Jürgen
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:22, Jürgen Spitzmüller wrote: Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 Thanks - that's working now. One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FuiEACgkQoYgNqgF2egrVEgCbBsJGKPbF5mH2MG5kVHg7pORx 28sAnAuKQ0qveH5SAwOzkGFz9HzYD8IE =1TNH -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:56, Rainer M Krug wrote: On 05/01/12 15:22, Jürgen Spitzmüller wrote: Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 Thanks - that's working now. One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? Rainer Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FvWUACgkQoYgNqgF2egr+ZgCeKb25x/kj8vUAJIoJOPbYpipk FKMAnRUpTXdvhBhA+1JsCPOuVX6ymdyG =Zg+6 -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. They should. And there are many more advantages. The file paths are known to LyX, you can have preview, you can easily define options, etc. Jürgen
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? external_templates itself states it clearly: # This file contains the definitions of those External Templates that are # part of the official LyX distribution. # Feel free to create your own External Templates, storing them in # .lyx/external_templates Alas, LyX does only read one of those files (the personal one, if there is one), so you have to copy the whole external_templates file to your .lyx folder and _add_ yours there. At least that's how it used to be. Maybe the situation has improved. Jürgen
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:16, Jürgen Spitzmüller wrote: Rainer M Krug wrote: Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? external_templates itself states it clearly: # This file contains the definitions of those External Templates that are # part of the official LyX distribution. # Feel free to create your own External Templates, storing them in # .lyx/external_templates Alas, LyX does only read one of those files (the personal one, if there is one), so you have to copy the whole external_templates file to your .lyx folder and _add_ yours there. At least that's how it used to be. Maybe the situation has improved. Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Cheers, Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz4cACgkQoYgNqgF2egoPVgCghKcR2evoplz7URftrCXc0buq q24An0KqPl09V6Y97KghYNUexVVjeYL3 =9Yem -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:12, Jürgen Spitzmüller wrote: Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. I'll do so - thanks. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. Ugly hack - but an option. However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. They should. And there are many more advantages. The file paths are known to LyX, you can have preview, you can easily define options, etc. Agreed - I think I will go that way. Cheers, Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz+IACgkQoYgNqgF2egrNXwCfZoKNRmoqK/K05/Z6IGpqgx1O thsAnRujP9lDnoqyHoa4W9xwsw6x2ooH =Lqn5 -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 Jürgen
Re: How to prevent escaping for LaTeX when in module?
Le 05/01/2012 17:32, Jürgen Spitzmüller a écrit : Rainer M Krug wrote: Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). JMarc
Re: How to prevent escaping for LaTeX when in module?
Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Jürgen
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:22, Jürgen Spitzmüller wrote: Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 Thanks - that's working now. One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FuiEACgkQoYgNqgF2egrVEgCbBsJGKPbF5mH2MG5kVHg7pORx 28sAnAuKQ0qveH5SAwOzkGFz9HzYD8IE =1TNH -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:56, Rainer M Krug wrote: On 05/01/12 15:22, Jürgen Spitzmüller wrote: Rainer M Krug wrote: I have written this small module to make attaching files to a pdf easier. It works nice, unless I have e.g. a _ in the file name, as then the text in the inset is escaped, i.e. newfile_1.lyx becomes newfile\_.lyx, which is obviously not found. Is there a way of treating the test in the inset as is and not escape it? PassThru 1 Thanks - that's working now. One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? Rainer Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FvWUACgkQoYgNqgF2egr+ZgCeKb25x/kj8vUAJIoJOPbYpipk FKMAnRUpTXdvhBhA+1JsCPOuVX6ymdyG =Zg+6 -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. They should. And there are many more advantages. The file paths are known to LyX, you can have preview, you can easily define options, etc. Jürgen
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? external_templates itself states it clearly: # This file contains the definitions of those External Templates that are # part of the official LyX distribution. # Feel free to create your own External Templates, storing them in # .lyx/external_templates Alas, LyX does only read one of those files (the personal one, if there is one), so you have to copy the whole external_templates file to your .lyx folder and _add_ yours there. At least that's how it used to be. Maybe the situation has improved. Jürgen
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:16, Jürgen Spitzmüller wrote: Rainer M Krug wrote: Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? external_templates itself states it clearly: # This file contains the definitions of those External Templates that are # part of the official LyX distribution. # Feel free to create your own External Templates, storing them in # .lyx/external_templates Alas, LyX does only read one of those files (the personal one, if there is one), so you have to copy the whole external_templates file to your .lyx folder and _add_ yours there. At least that's how it used to be. Maybe the situation has improved. Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Cheers, Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz4cACgkQoYgNqgF2egoPVgCghKcR2evoplz7URftrCXc0buq q24An0KqPl09V6Y97KghYNUexVVjeYL3 =9Yem -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:12, Jürgen Spitzmüller wrote: Rainer M Krug wrote: One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. I'll do so - thanks. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. Ugly hack - but an option. However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. They should. And there are many more advantages. The file paths are known to LyX, you can have preview, you can easily define options, etc. Agreed - I think I will go that way. Cheers, Rainer Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz+IACgkQoYgNqgF2egrNXwCfZoKNRmoqK/K05/Z6IGpqgx1O thsAnRujP9lDnoqyHoa4W9xwsw6x2ooH =Lqn5 -END PGP SIGNATURE-
Re: How to prevent escaping for LaTeX when in module?
Rainer M Krug wrote: Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 Jürgen
Re: How to prevent escaping for LaTeX when in module?
Le 05/01/2012 17:32, Jürgen Spitzmüller a écrit : Rainer M Krug wrote: Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). JMarc
Re: How to prevent escaping for LaTeX when in module?
Jean-Marc Lasgouttes wrote: I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen
Re: How to prevent "escaping" for LaTeX when in module?
Rainer M Krug wrote: > I have written this small module to make attaching files to a pdf > easier. It works nice, unless I have e.g. a _ in the file name, as > then the text in the inset is "escaped", i.e. newfile_1.lyx becomes > newfile\_.lyx, which is obviously not found. Is there a way of > treating the test in the inset "as is" and not "escape" it? PassThru 1 However, I do not think such a module is the way to go. I would rather try with an external material template. Have a look at the pdfpages template for a model (in the file external_templates). Jürgen
Re: How to prevent "escaping" for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:22, Jürgen Spitzmüller wrote: > Rainer M Krug wrote: >> I have written this small module to make attaching files to a >> pdf easier. It works nice, unless I have e.g. a _ in the file >> name, as then the text in the inset is "escaped", i.e. >> newfile_1.lyx becomes newfile\_.lyx, which is obviously not >> found. Is there a way of treating the test in the inset "as is" >> and not "escape" it? > > PassThru 1 Thanks - that's working now. One more question: how can I deal with a function which requires two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in a module? Is there anywhere an example on how an inset with two parametern looks? > > However, I do not think such a module is the way to go. I would > rather try with an external material template. Have a look at the > pdfpages template for a model (in the file external_templates). Makes sense - never thought about that. I'll look into that and think about it. For the moment, I am going to use the module. Do I assume correctly, that these files I specify as external content will be included in the lyx archive? That would be a great advantage. Rainer > > Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FuiEACgkQoYgNqgF2egrVEgCbBsJGKPbF5mH2MG5kVHg7pORx 28sAnAuKQ0qveH5SAwOzkGFz9HzYD8IE =1TNH -END PGP SIGNATURE-
Re: How to prevent "escaping" for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 15:56, Rainer M Krug wrote: > On 05/01/12 15:22, Jürgen Spitzmüller wrote: >> Rainer M Krug wrote: >>> I have written this small module to make attaching files to a >>> pdf easier. It works nice, unless I have e.g. a _ in the file >>> name, as then the text in the inset is "escaped", i.e. >>> newfile_1.lyx becomes newfile\_.lyx, which is obviously not >>> found. Is there a way of treating the test in the inset "as >>> is" and not "escape" it? > >> PassThru 1 > > Thanks - that's working now. > > One more question: how can I deal with a function which requires > two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE > LINK} in a module? Is there anywhere an example on how an inset > with two parametern looks? > > >> However, I do not think such a module is the way to go. I would >> rather try with an external material template. Have a look at >> the pdfpages template for a model (in the file >> external_templates). > > Makes sense - never thought about that. I'll look into that and > think about it. For the moment, I am going to use the module. > > Do I assume correctly, that these files I specify as external > content will be included in the lyx archive? That would be a great > advantage. Just a quick follow up - to add a template, do I have to add it to the existing external_templates file, or can I have the additional template in my .lyx folder (which subfolder?)? Rainer > > Rainer > > >> Jürgen > > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8FvWUACgkQoYgNqgF2egr+ZgCeKb25x/kj8vUAJIoJOPbYpipk FKMAnRUpTXdvhBhA+1JsCPOuVX6ymdyG =Zg+6 -END PGP SIGNATURE-
Re: How to prevent "escaping" for LaTeX when in module?
Rainer M Krug wrote: > One more question: how can I deal with a function which requires two > paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE LINK} in > a module? Is there anywhere an example on how an inset with two > parametern looks? In Paragraphy styles (not in layouts I think), you can specify RequiredArgs. See Customization.lyx. A workaround in layouts is to simply insert }{ as a separator. This is a bad hack, though. > > However, I do not think such a module is the way to go. I would > > rather try with an external material template. Have a look at the > > pdfpages template for a model (in the file external_templates). > > Makes sense - never thought about that. > I'll look into that and think about it. For the moment, I am going to > use the module. > > Do I assume correctly, that these files I specify as external content > will be included in the lyx archive? That would be a great advantage. They should. And there are many more advantages. The file paths are known to LyX, you can have preview, you can easily define options, etc. Jürgen
Re: How to prevent "escaping" for LaTeX when in module?
Rainer M Krug wrote: > Just a quick follow up - to add a template, do I have to add it to the > existing external_templates file, or can I have the additional > template in my .lyx folder (which subfolder?)? external_templates itself states it clearly: # This file contains the definitions of those External Templates that are # part of the official LyX distribution. # Feel free to create your own External Templates, storing them in # .lyx/external_templates Alas, LyX does only read one of those files (the personal one, if there is one), so you have to copy the whole external_templates file to your .lyx folder and _add_ yours there. At least that's how it used to be. Maybe the situation has improved. Jürgen
Re: How to prevent "escaping" for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:16, Jürgen Spitzmüller wrote: > Rainer M Krug wrote: >> Just a quick follow up - to add a template, do I have to add it >> to the existing external_templates file, or can I have the >> additional template in my .lyx folder (which subfolder?)? > > external_templates itself states it clearly: > > # This file contains the definitions of those External Templates > that are # part of the official LyX distribution. # Feel free to > create your own External Templates, storing them in # > .lyx/external_templates > > Alas, LyX does only read one of those files (the personal one, if > there is one), so you have to copy the whole external_templates > file to your .lyx folder and _add_ yours there. At least that's > how it used to be. Maybe the situation has improved. Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Cheers, Rainer > > Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz4cACgkQoYgNqgF2egoPVgCghKcR2evoplz7URftrCXc0buq q24An0KqPl09V6Y97KghYNUexVVjeYL3 =9Yem -END PGP SIGNATURE-
Re: How to prevent "escaping" for LaTeX when in module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/01/12 16:12, Jürgen Spitzmüller wrote: > Rainer M Krug wrote: >> One more question: how can I deal with a function which requires >> two paramerer, e.g. \textattachfile{FILENAME.EXT}{THE TEXT OF THE >> LINK} in a module? Is there anywhere an example on how an inset >> with two parametern looks? > > In Paragraphy styles (not in layouts I think), you can specify > RequiredArgs. See Customization.lyx. I'll do so - thanks. > > A workaround in layouts is to simply insert }{ as a separator. This > is a bad hack, though. Ugly hack - but an option. > >>> However, I do not think such a module is the way to go. I >>> would rather try with an external material template. Have a >>> look at the pdfpages template for a model (in the file >>> external_templates). >> >> Makes sense - never thought about that. I'll look into that and >> think about it. For the moment, I am going to use the module. >> >> Do I assume correctly, that these files I specify as external >> content will be included in the lyx archive? That would be a >> great advantage. > > They should. And there are many more advantages. The file paths are > known to LyX, you can have preview, you can easily define options, > etc. Agreed - I think I will go that way. Cheers, Rainer > > Jürgen - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8Fz+IACgkQoYgNqgF2egrNXwCfZoKNRmoqK/K05/Z6IGpqgx1O thsAnRujP9lDnoqyHoa4W9xwsw6x2ooH =Lqn5 -END PGP SIGNATURE-
Re: How to prevent "escaping" for LaTeX when in module?
Rainer M Krug wrote: > Thanks a lot for the info - I should have looked closer. > But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 Jürgen
Re: How to prevent "escaping" for LaTeX when in module?
Le 05/01/2012 17:32, Jürgen Spitzmüller a écrit : Rainer M Krug wrote: Thanks a lot for the info - I should have looked closer. But it would be nice, if both would be read and just added to each other. Yes. That's actually http://www.lyx.org/trac/ticket/3983 I think we should not read both files, since the semantics of replacing a system file by a user one should be preserved. It would be better to load a external_templates.user file (or any better name you come up with), like we load several flavors of lyxrc files (lyxrc.dist, lyxrc.defaults, preferences). JMarc
Re: How to prevent "escaping" for LaTeX when in module?
Jean-Marc Lasgouttes wrote: > I think we should not read both files, since the semantics of replacing > a system file by a user one should be preserved. It would be better to > load a external_templates.user file (or any better name you come up > with), like we load several flavors of lyxrc files (lyxrc.dist, > lyxrc.defaults, preferences). I'm not sure I understand. IMHO the user file should be read after the system file. So any external template in the system file that is not in the user file should be kept, new user-contributed files should be added. If templates are in both files, the user version should override the system version. Having said that, I wonder if it would not be better to split this file into one file per template, having templates/pdfpages.template, templates/xfig.template etc. Then we could read all *.template files in both directories, and stick with the practice of reading only one of each, like we do for *.layout etc. Jürgen