]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/EmbeddedObjects.lyx
UserGuide.lyx: load math packages automatically
[lyx.git] / lib / doc / EmbeddedObjects.lyx
index 255c2ab5d3828cb854c99a1d0e64dbf0925c4f9c..61eecb6c6f5e9a82523a520a8373de64c6747298 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 543
+\lyxformat 544
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -216,6 +216,7 @@ graphicboxes
 \suppress_date false
 \justification true
 \use_refstyle 0
+\use_minted 0
 \notefontcolor #0000ff
 \index Index
 \shortcut idx
@@ -21518,7 +21519,7 @@ array
 \series default
  will be loaded automatically by \SpecialChar LyX
  when you use self defined table formats.
- To avoid that it being loaded twice the command 
+ To avoid that it is loaded twice the command 
 \series bold
 
 \backslash
@@ -40849,7 +40850,7 @@ Program Listing
 \family default
 .
  The \SpecialChar LaTeX
--package 
+-packages 
 \series bold
 listings
 \series default
@@ -40864,8 +40865,194 @@ status collapsed
 
 \end_inset
 
- provides a powerful and flexible way to insert program source code into
+ or 
+\series bold
+minted
+\series default
+
+\begin_inset Index idx
+status collapsed
+
+\begin_layout Plain Layout
+\SpecialChar LaTeX
+-packages ! minted
+\end_layout
+
+\end_inset
+
+ provide a powerful and flexible way to insert program source code into
  your document.
+ One can only use one of these packages in a document.
+\series bold
+listings
+\series default
+ is used by default.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+Note:
+\series default
+ \SpecialChar LyX
+ does NOT want to encourage users to add the 
+\family typewriter
+-shell-escape
+\family default
+ option to converter definitions.
+ It works, but it is a huge security risk.
+ There is an active discussion about how to handle this.
+ Once that's been resolved, this can be updated appropriately.
+\end_layout
+
+\begin_layout Plain Layout
+=====
+\end_layout
+
+\begin_layout Plain Layout
+In order to use 
+\series bold
+minted
+\series default
+, you need to select it as the syntax highlighting package in the document
+ settings under 
+\family sans
+Listings
+\family default
+.
+\series bold
+minted
+\series default
+ requires also additionally the module 
+\family sans
+pygments
+\family default
+ of the software 
+\noun on
+Python
+\noun default
+
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Under \SpecialChar LyX
+ for Windows 
+\family sans
+pygments
+\family default
+ is already installed.
+\end_layout
+
+\end_inset
+
+ and the option 
+\family typewriter
+-shell-escape
+\family default
+ for the \SpecialChar LaTeX
+ processor.
+ If you want for example view or export your document as the format 
+\family sans
+PDF
+\begin_inset space ~
+\end_inset
+
+(pdflatex)
+\family default
+, go to the \SpecialChar LyX
+ preferences and there to the section 
+\family sans
+File
+\begin_inset space ~
+\end_inset
+
+Handling\SpecialChar menuseparator
+Converters
+\family default
+.
+ There go to the entry 
+\family sans
+LaTeX
+\begin_inset space ~
+\end_inset
+
+(pdflatex) -> PDF
+\begin_inset space ~
+\end_inset
+
+(pdflatex)
+\family default
+ and look at the field 
+\family sans
+Converter
+\family default
+.
+ There you see by default the content
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+pdflatex $$i
+\series default
+
+\begin_inset Newline newline
+\end_inset
+
+Now change it to
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+pdflatex $$i -shell-escape
+\begin_inset Newline newline
+\end_inset
+
+
+\series default
+and press the 
+\family sans
+Modify
+\family default
+ button and subsequently 
+\family sans
+Apply
+\family default
+ or 
+\family sans
+Save
+\family default
+.
+ The same can be done for the output formats 
+\family sans
+PDF
+\begin_inset space ~
+\end_inset
+
+(LuaTeX)
+\family default
+ and 
+\family sans
+PDF
+\begin_inset space ~
+\end_inset
+
+(XeTeX)
+\family default
+.
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Standard
@@ -41003,7 +41190,7 @@ Float
 \end_layout
 
 \begin_layout Standard
-You can add captions to listings with the menu 
+You can add captions to listings that are not inline with the menu 
 \family sans
 Insert\SpecialChar menuseparator
 Caption
@@ -41083,6 +41270,99 @@ def func(param):
 \end_inset
 
 
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+Note: 
+\series default
+The 
+\series bold
+listings
+\series default
+ package places captions before the listing by default.
+\begin_inset Newline newline
+\end_inset
+
+The 
+\series bold
+minted
+\series default
+ package places them after the listing by default if it is floating.
+ If tit is not floating caption will be typeset before the listing if it
+ is inserted to its first line, otherwise it will be typeset after the listing.
+ If you want to force the placement in avery case before the listing, you
+ have to add the following lines as last thing to the preamble:
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+
+\backslash
+@ifundefined{newfloat}
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Phantom HPhantom
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+{
+\backslash
+usepackage{float}}{}
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+floatstyle{plaintop}
+\series default
+
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+The package 
+\series bold
+float
+\series default
+ will be loaded automatically by \SpecialChar LyX
+ when you use special document-wide float
+ placement settings.
+ To avoid that it is loaded twice the command 
+\series bold
+
+\backslash
+@ifundefined
+\series default
+ is used in the above command.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Standard
@@ -41178,8 +41458,12 @@ You can furthermore specify a range of lines; only these will then appear
 \family sans
 Extended character table
 \family default
- should be used when you use national characters like the German umlauts
- in the listing.
+ is only meaningful for the 
+\series bold
+listings
+\series default
+ package and should be used when you use national characters like the German
+ umlauts in the listing.
 \begin_inset Newline newline
 \end_inset
 
@@ -41571,10 +41855,14 @@ For more information about the
 \series bold
 listings
 \series default
- package, we refer to its documentation 
+ and 
+\series bold
+minted
+\series default
+ packages, we refer to their documentation 
 \begin_inset CommandInset citation
 LatexCommand cite
-key "listings"
+key "listings,minted"
 literal "true"
 
 \end_inset
@@ -46923,6 +47211,42 @@ status collapsed
 \end_inset
 
 
+\end_layout
+
+\begin_layout Bibliography
+\begin_inset CommandInset bibitem
+LatexCommand bibitem
+key "minted"
+literal "false"
+
+\end_inset
+
+Documentation of the \SpecialChar LaTeX
+-package 
+\series bold
+
+\begin_inset CommandInset href
+LatexCommand href
+name "minted"
+target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/minted/minted.pdf"
+literal "false"
+
+\end_inset
+
+
+\series default
+
+\begin_inset Index idx
+status collapsed
+
+\begin_layout Plain Layout
+\SpecialChar LaTeX
+-packages ! minted
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Bibliography