Re: [LyX/master] Fix bug #9101
On Tue, Jun 20, 2017 at 02:45:31AM +0200, Guillaume MM wrote: > Le 08/06/2017 à 04:28, Enrico Forestieri a écrit : > > > > Actually it was simpler than expected. > > > > Thanks. Yes, you are right. -- Enrico
Re: [LyX/master] Fix bug #9101
Le 08/06/2017 à 04:28, Enrico Forestieri a écrit : Actually it was simpler than expected. Thanks.
Re: [LyX/master] Fix bug #9101
On Thu, Jun 08, 2017 at 02:13:33AM +0200, Enrico Forestieri wrote: > On Thu, Jun 08, 2017 at 12:47:30AM +0200, Guillaume MM wrote: > > > > Is it possible to make layoutName() depend on the setting and avoid > > \ifx\minted\undefined in the output? > > I have not explored this possibility, but then it starts to get too much > complicated, IMHO. Actually it was simpler than expected. Thanks for the idea. -- Enrico
Re: [LyX/master] Fix bug #9101
On Thu, Jun 08, 2017 at 12:47:30AM +0200, Guillaume MM wrote: > Le 07/06/2017 à 01:08, Enrico Forestieri a écrit : > > commit 8dab1cfe7ee6a3bb6d5e57afb55cb357e1e8ec23 > > Author: Enrico Forestieri> > Date: Wed Jun 7 00:55:23 2017 +0200 > > > > Fix bug #9101 > > Update the listings inset to optionally use the minted package > > (instead of the listings one) for typesetting code listings. > > Only one of the two packages can be used in a document, but it > > is possible to switch packages without issues if the used options > > are the same. If a switch is made and the options differ, one needs > > to manually adjust them if they were entered in the advanced options > > tab, or apply again the gui settings. > > Note that minted requires the -shell-escape option for the latex > > backend and the installation of additional software (python pygments). > > --- > ... > > BabelPreamble > > - > > \addto\captions$$lang{\renewcommand{\lstlistlistingname}{_(Listings[[List > > of Listings]])}} > > + \ifx\minted\undefined > > + > > \addto\captions$$lang{\renewcommand{\lstlistlistingname}{_(Listings[[List > > of Listings]])}}\else > > + > > \addto\captions$$lang{\renewcommand{\listoflistingscaption}{_(Listings[[List > > of Listings]])}}\fi > > EndBabelPreamble > > - # The command does not need to be defined in LangPreamble, since > > - # listings.sty does that already. However it needs to be redefined > > - # in order to be used for non-english single-language documents. > > + # Either commands do not need to be defined in LangPreamble, since > > + # listings.sty or minted.sty do that already. However they need to be > > + # redefined in order to be used for non-english single-language > > + # documents. > > LangPreamble > > - \renewcommand{\lstlistlistingname}{_(Listings[[List of > > Listings]])} > > + \ifx\minted\undefined > > + \renewcommand{\lstlistlistingname}{_(Listings[[List of > > Listings]])}\else > > + \renewcommand{\listoflistingscaption}{_(Listings[[List of > > Listings]])}\fi > > EndLangPreamble > > FixedWidthPreambleEncoding true > > HTMLTag h2 > > @@ -298,13 +303,18 @@ End > > InsetLayout Include:Listings > > BabelPreamble > > - > > \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}} > > + \ifx\minted\undefined > > + > > \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}}\else > > + > > \addto\captions$$lang{\renewcommand{\listingscaption}{_(Listing)}}\fi > > EndBabelPreamble > > - # The command does not need to be defined in LangPreamble, since > > - # listings.sty does that already. However it needs to be redefined > > - # in order to be used for non-english single-language documents. > > + # Either commands do not need to be defined in LangPreamble, since > > + # listings.sty or minted.sty do that already. However they need to be > > + # redefined in order to be used for non-english single-language > > + # documents. > > LangPreamble > > - \renewcommand{\lstlistingname}{_(Listing)} > > + \ifx\minted\undefined > > + \renewcommand{\lstlistingname}{_(Listing)}\else > > + \renewcommand{\listingscaption}{_(Listing)}\fi > > EndLangPreamble > > FixedWidthPreambleEncoding true > > End > > > Is it possible to make layoutName() depend on the setting and avoid > \ifx\minted\undefined in the output? I have not explored this possibility, but then it starts to get too much complicated, IMHO. -- Enrico
Re: [LyX/master] Fix bug #9101
Le 07/06/2017 à 01:08, Enrico Forestieri a écrit : commit 8dab1cfe7ee6a3bb6d5e57afb55cb357e1e8ec23 Author: Enrico ForestieriDate: Wed Jun 7 00:55:23 2017 +0200 Fix bug #9101 Update the listings inset to optionally use the minted package (instead of the listings one) for typesetting code listings. Only one of the two packages can be used in a document, but it is possible to switch packages without issues if the used options are the same. If a switch is made and the options differ, one needs to manually adjust them if they were entered in the advanced options tab, or apply again the gui settings. Note that minted requires the -shell-escape option for the latex backend and the installation of additional software (python pygments). --- ... BabelPreamble - \addto\captions$$lang{\renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}} + \ifx\minted\undefined + \addto\captions$$lang{\renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}}\else + \addto\captions$$lang{\renewcommand{\listoflistingscaption}{_(Listings[[List of Listings]])}}\fi EndBabelPreamble - # The command does not need to be defined in LangPreamble, since - # listings.sty does that already. However it needs to be redefined - # in order to be used for non-english single-language documents. + # Either commands do not need to be defined in LangPreamble, since + # listings.sty or minted.sty do that already. However they need to be + # redefined in order to be used for non-english single-language + # documents. LangPreamble - \renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])} + \ifx\minted\undefined + \renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}\else + \renewcommand{\listoflistingscaption}{_(Listings[[List of Listings]])}\fi EndLangPreamble FixedWidthPreambleEncoding true HTMLTag h2 @@ -298,13 +303,18 @@ End InsetLayout Include:Listings BabelPreamble - \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}} + \ifx\minted\undefined + \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}}\else + \addto\captions$$lang{\renewcommand{\listingscaption}{_(Listing)}}\fi EndBabelPreamble - # The command does not need to be defined in LangPreamble, since - # listings.sty does that already. However it needs to be redefined - # in order to be used for non-english single-language documents. + # Either commands do not need to be defined in LangPreamble, since + # listings.sty or minted.sty do that already. However they need to be + # redefined in order to be used for non-english single-language + # documents. LangPreamble - \renewcommand{\lstlistingname}{_(Listing)} + \ifx\minted\undefined + \renewcommand{\lstlistingname}{_(Listing)}\else + \renewcommand{\listingscaption}{_(Listing)}\fi EndLangPreamble FixedWidthPreambleEncoding true End Is it possible to make layoutName() depend on the setting and avoid \ifx\minted\undefined in the output?