tikzpicture 中出现奇怪的倾斜行为

tikzpicture 中出现奇怪的倾斜行为

我正在运行 LuaLaTeX,如果我删除任何下面的包,或者甚至通过直接加载包来更改我的布局控制,然后我的tikzpicture编译就会按预期进行。然而,通过这种精确的设置,我得到了所示的倾斜图像。

\documentclass{exam}

%Layout control
\makeatletter
\@ifclassloaded{beamer}{}{\usepackage[letterpaper]{geometry}}
\@ifclassloaded{exam}{}{\usepackage{fancyhdr}}
\makeatother

%Packages for handling language
\usepackage[english]{babel}
\usepackage{siunitx}

%Packages for nice formatting
\usepackage{booktabs}
\usepackage{floatflt}
\usepackage{multicol}

%packages to allow creation of certain commands
\usepackage{mathtools}
\usepackage{pgffor}

%packages and options to draw figures
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\draw (0,0) to (8,0);
\end{tikzpicture}

\end{document}

tikzpicture 环境中的倾斜行为

我真的不知道是什么原因造成的。 截屏

 *File List*
    exam.cls    2015/05/07 Version 2.5 by Philip Hirschhorn
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
geometry.sty    2010/09/12 v5.6 Page Geometry
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
   babel.sty    2014/09/25 3.9l The Babel package
 english.ldf    2012/08/20 v3.3p English support from the babel system
 siunitx.sty    2015/07/17 v2.6h A comprehensive (SI) units package
   expl3.sty    2015/06/15 v5630 L3 programming layer (loader) 
expl3-code.tex    2015/06/15 v5630 L3 programming layer 
l3unicode-data.def    2015/03/01 v5544 L3 Unicode data
l3pdfmode.def    2015/05/21 v5613 L3 Experimental driver: PDF mode
  xparse.sty    2015/06/15 v5630 L3 Experimental document command parser
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
   array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
l3keys2e.sty    2015/06/15 v5630 LaTeX2e option processing using LaTeX3 keys
translator.sty    2010/06/12 ver 1.10
translator-language-mappings.tex
booktabs.sty    2005/04/14 v1.61803 publication quality tables
floatflt.sty    1997/07/16 v. 1.31
multicol.sty    2015/03/31 v1.8m multicolumn formatting (FMi)
mathtools.sty    2015/06/17 v1.17 mathematical typesetting tools
    calc.sty    2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
 mhsetup.sty    2010/01/21 v1.2a programming setup (MH)
 amsmath.sty    2013/01/14 v2.14 AMS math features
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
pgfplots.sty    2015/05/02 v1.12.1 Data Visualization (1.12.1)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 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    2013/11/30 v3.0.0 (rcs-revision 1.47)
  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
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
    tikz.code.tex
luatexbase.sty    2013/05/11 v0.6 Resource management for the LuaTeX macro progr
ammer
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  luatex.sty    2010/03/09 v0.4 LuaTeX basic definition package (HO)
    etex.sty    2015/03/02 v2.1 eTeX basic definition package (PEB,DPC)
luatex-loader.sty    2010/03/09 v0.4 Lua module loader (HO)
luatexbase-compat.sty    2011/05/24 v0.4 Compatibility tools for LuaTeX
luatexbase-modutils.sty    2013/05/11 v0.6 Module utilities for LuaTeX
luatexbase-loader.sty    2013/05/11 v0.6 Lua module loader for LuaTeX
luatexbase-regs.sty    2011/05/24 v0.4 Registers allocation for LuaTeX
luatexbase-attr.sty    2013/05/11 v0.6 Attributes allocation for LuaTeX
luatexbase-cctb.sty    2013/05/11 v0.6 Catcodetable allocation for LuaTeX
luatexbase-mcb.sty    2013/05/11 v0.6 Callback management for LuaTeX
translator-basic-dictionary-English.dict    
siunitx-abbreviations.cfg    2015/07/17 v2.6h siunitx: Abbreviated units
supp-pdf.mkii
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

答案1

如果你注释掉该行\usepackage{pgffor},该线就会被正确绘制。

(由于pgffor已被加载pgfplots,因此您不需要单独加载它即可使用\foreach等)。

相关内容