不幸的是,在 debian 9 和 ubuntu 16.04 上,minted 与 beamer 结合使用时的行为有所不同。这不是代码的生成(我检查过,它们是相同的),而是布局。我遇到了几个问题,甚至是一个错误,但我将其归结为一个非常简单的示例,该示例显示了 debian 版本的顶部偏移量增加,这显然会扰乱一切。
这是代码
\documentclass[10pt,t,aspectratio=1610]{beamer}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{minted}
\usetheme{Madrid}
\definecolor{mintedbackground}{rgb}{0.92,0.92,0.92}
\newmintedfile[javacode]{java}{bgcolor=mintedbackground,fontfamily=tt}
\begin{document}
\begin{frame}
\frametitle{Text is fine}
Text
\end{frame}
\begin{frame}
\frametitle{Code has different top offset}
\javacode{error.inc}
\end{frame}
\end{document}
两个系统上 minted 生成的代码是
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{Hello}
\end{Verbatim}
这是故意设计的,相当简单。default-pyg-prefix.pygstyle 和 default.pygstyle 生成的代码的差异如下所示 (diff -c0 )。
*** 21 ****
- \expandafter\def\csname PYG@tok@vm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
--- 20 ----
***************
*** 46 ****
- \expandafter\def\csname PYG@tok@dl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
--- 44 ----
***************
*** 55 ****
- \expandafter\def\csname PYG@tok@fm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
--- 52 ----
***************
*** 76 ****
- \expandafter\def\csname PYG@tok@sa\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
--- 72 ----
*** 21 ****
- \expandafter\def\csname PYGdefault@tok@vm\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
--- 20 ----
***************
*** 46 ****
- \expandafter\def\csname PYGdefault@tok@dl\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
--- 44 ----
***************
*** 55 ****
- \expandafter\def\csname PYGdefault@tok@fm\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
--- 52 ----
***************
*** 76 ****
- \expandafter\def\csname PYGdefault@tok@sa\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
--- 72 ----
显然,生成的pyg名字不同,但是内容是一样的。
我已经习惯了在 LaTeX-Sources 上使用相同的布局,这真的让我很烦恼。请不要建议只在一个系统上工作,这不会持续很长时间,这也是我不使用其他软件处理文档而只使用 LaTeX 的主要原因。
感谢您的帮助或建议
根据要求添加了两个文件列表(div 太大),有很多不同的版本......
文件列表.debian
beamer.cls 2017/01/22 v3.40 A class for typesetting presentations
etoolbox.sty 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
beamerbasemodes.sty
beamerbasedecode.sty
ifpdf.sty 2016/05/14 v3.1 Provides the ifpdf switch
beamerbaseoptions.sty
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
geometry.sty 2010/09/12 v5.6 Page Geometry
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/06/04 v1.11 sample graphics configuration
pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48)
pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfsys.code.tex
pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
xxcolor.sty 2003/10/24 ver 0.1
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
hyperref.sty 2016/06/24 v6.83q Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
pdftexcmds.sty 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
pd1enc.def 2016/06/24 v6.83q Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hpdftex.def 2016/06/24 v6.83q Hyperref driver for pdfTeX
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty
beamerbasecompatibility.sty
beamerbasefont.sty
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
sansmathaccent.sty 2013/03/28
filehook.sty 2011/10/12 v0.5d Hooks for input files
beamerbasetranslator.sty
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty
beamerbasetwoscreens.sty
beamerbaseoverlay.sty
beamerbasetitle.sty
beamerbasesection.sty
beamerbaseframe.sty
beamerbaseverbatim.sty
beamerbaseframesize.sty
beamerbaseframecomponents.sty
beamerbasecolor.sty
beamerbasenotes.sty
beamerbasetoc.sty
beamerbasetemplates.sty
beamerbaseauxtemplates.sty
beamerbaseboxes.sty
beamerbaselocalstructure.sty
enumerate.sty 2015/07/23 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty
beamerbasetheorems.sty
amsmath.sty 2016/11/05 v2.16a AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
amsthm.sty 2015/03/04 v2.20.2
beamerbasethemes.sty
beamerthemedefault.sty
beamerfontthemedefault.sty
beamercolorthemedefault.sty
beamerinnerthemedefault.sty
beamerouterthemedefault.sty
babel.sty 2016/04/23 3.9r The Babel package
english.ldf 2012/08/20 v3.3p English support from the babel system
inputenc.sty 2015/03/17 v1.2c Input encoding file
utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
fontenc.sty
t1enc.def 2017/02/22 v2.0g Standard LaTeX file
minted.sty 2016/10/31 v2.4.1 Yet another Pygments shim for LaTeX
fvextra.sty 2016/09/02 v1.2.1 fvextra - extensions and patches for fancyvrb
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
fancyvrb.sty 2008/02/07
upquote.sty 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verbat
im
textcomp.sty 2017/02/22 v2.0g Standard LaTeX package
ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
ts1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
lineno.sty 2005/11/02 line numbers on paragraphs v4.41
t1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions
float.sty 2001/11/08 v1.3d Float enhancements (AL)
calc.sty 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
shellesc.sty 2016/06/07 v0.02a unified shell escape interface for LaTeX
ifplatform.sty 2010/10/22 v0.4 Testing for the operating system
catchfile.sty 2016/05/16 v1.7 Catch the contents of a file (HO)
error.w18
xstring.sty 2013/10/13 v1.7c String manipulations (C Tellechea)
framed.sty 2011/10/22 v 0.96: framed or shaded text with page breaks
beamerthemeMadrid.sty
beamercolorthemewhale.sty
beamercolorthemeorchid.sty
beamerinnerthemerounded.sty
beamerouterthemeinfolines.sty
ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
supp-pdf.mkii
epstopdf-base.sty 2016/05/15 v2.6 Base part for package epstopdf
grfext.sty 2016/05/16 v1.2 Manage graphics extensions (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
文件列表.ubuntu
beamer.cls 2015/01/05 3.36 A class for typesetting presentations (rcs-revi
sion 8a39122e1f63)
beamerbasercs.sty 2015/03/08 (rcs-revision 368aa9ba9d38)
beamerbasemodes.sty 2013/09/03 (rcs-revision 768f2d98ca64)
beamerbasedecode.sty 2010/05/01 (rcs-revision efa082c6111d)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
beamerbaseoptions.sty 2013/03/10 (rcs-revision 47431932db0d)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
geometry.sty 2010/09/12 v5.6 Page Geometry
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2016/01/03 v1.0q Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48)
pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfsys.code.tex
pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pgfcore.code.tex
xxcolor.sty 2003/10/24 ver 0.1
atbegshi.sty 2011/10/05 v1.16 At begin shipout hook (HO)
hyperref.sty 2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty 2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
hobsub.sty 2012/05/28 v1.13 Construct package bundles (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
intcalc.sty 2007/09/27 v1.1 Expandable calculations with integers (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2012/04/08 v1.3 Expandable calculations on big integers (HO)
bitset.sty 2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty 2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty 2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
hopatch.sty 2012/05/28 v1.2 Wrapper for package hooks (HO)
xcolor-patch.sty 2011/01/30 xcolor patch
atveryend.sty 2011/06/30 v1.8 Hooks at the very end of document (HO)
refcount.sty 2011/10/16 v3.4 Data extraction from label references (HO)
hycolor.sty 2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
auxhook.sty 2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hpdftex.def 2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty 2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbasecompatibility.sty 2012/05/01 (rcs-revision 67c48b3b652d)
beamerbasefont.sty 2015/01/05 (rcs-revision b4b4bee242e2)
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
sansmathaccent.sty 2013/03/28
filehook.sty 2011/10/12 v0.5d Hooks for input files
beamerbasetranslator.sty 2010/06/11 (rcs-revision 85fd1cc7fc42)
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty 2013/09/03 (rcs-revision a55719c41d85)
beamerbasetwoscreens.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbaseoverlay.sty 2013/12/25 (rcs-revision f6bd5e3805da)
beamerbasetitle.sty 2010/09/21 (rcs-revision f0446ed0b6ae)
beamerbasesection.sty 2013/06/07 (rcs-revision 60b9fe0f342f)
beamerbaseframe.sty 2014/02/20 (rcs-revision 4b8ceeeff434)
beamerbaseverbatim.sty 2015/01/05 (rcs-revision 431510bb5890)
beamerbaseframesize.sty 2011/09/12 (rcs-revision 70f9d8411e54)
beamerbaseframecomponents.sty 2013/10/18 (rcs-revision 5cf6c5555a45)
beamerbasecolor.sty 2015/02/21 (rcs-revision d944b04ee2d5)
beamerbasenotes.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamerbasetoc.sty 2015/03/08 (rcs-revision 7270298bbaae)
beamerbasetemplates.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbaseauxtemplates.sty 2014/06/30 (rcs-revision 580088513a67)
beamerbaseboxes.sty 2012/05/13 (rcs-revision 56972908a390)
beamerbaselocalstructure.sty 2014/09/10 (rcs-revision 393f6dcff371)
enumerate.sty 2015/07/23 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty 2015/02/27 (rcs-revision 923f4bf87efa)
beamerbasetheorems.sty 2010/06/06 (rcs-revision 7e7cc5e53e9d)
amsmath.sty 2016/03/03 v2.15a AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 1999/12/14 v2.01 operator names
amsthm.sty 2015/03/04 v2.20.2
beamerbasethemes.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerthemedefault.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamerfontthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamercolorthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamerinnerthemedefault.sty 2014/06/30 (rcs-revision 580088513a67)
beamerouterthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
babel.sty 2016/02/24 3.9q The Babel package
english.ldf 2012/08/20 v3.3p English support from the babel system
inputenc.sty 2015/03/17 v1.2c Input encoding file
utf8.def 2015/12/03 v1.1r UTF-8 support for inputenc
t1enc.dfu 2015/12/03 v1.1r UTF-8 support for inputenc
ot1enc.dfu 2015/12/03 v1.1r UTF-8 support for inputenc
omsenc.dfu 2015/12/03 v1.1r UTF-8 support for inputenc
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
minted.sty 2015/09/09 v2.1 Yet another Pygments shim for LaTeX
fancyvrb.sty 2008/02/07
float.sty 2001/11/08 v1.3d Float enhancements (AL)
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
calc.sty 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
ifplatform.sty 2010/10/22 v0.4 Testing for the operating system
catchfile.sty 2011/03/01 v1.6 Catch the contents of a file (HO)
error.w18
etoolbox.sty 2015/08/02 v2.2a e-TeX tools for LaTeX (JAW)
xstring.sty 2013/10/13 v1.7c String manipulations (C Tellechea)
lineno.sty 2005/11/02 line numbers on paragraphs v4.41
t1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions
_minted-error/default.pygstyle
beamerthemeMadrid.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamercolorthemewhale.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamercolorthemeorchid.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamerinnerthemerounded.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamerouterthemeinfolines.sty 2012/10/16 (rcs-revision 51a8c72084af)
supp-pdf.mkii
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Manage graphics extensions (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
nameref.sty 2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)