我只是想定义一种新的风格,一种非常简单的风格,align left, text width=6cm
但我发现更简单的代码也行不通。基本上,我认为我的安装有问题,或者我以某种秘密错误的方式运行代码。我已经在 Google 上搜索了大约 20 分钟,但我就是搞不清楚。
编辑顺便说一句,我的眼睛仍然很好。漫长的一天。
平均能量损失
\documentclass[
a4paper
]{scrartcl}
\usepackage{
newtxtext,
amsmath,
}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\tikzset{
sometest/.style{
align=left,
text width=5cm
},
asdfasdf/.style{
rectangle
},
}
\listfiles
\begin{document}
Test.
\begin{center}
\begin{tikzpicture}
\node {Something text.};
\node[sometest] {AAA};
\end{tikzpicture}
\end{center}
\end{document}
\end{document}
生产
文件列表
*File List*
scrartcl.cls 2013/12/19 v3.12 KOMA-Script document class (article)
scrkbase.sty 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent bas
ics and keyval usage)
scrbase.sty 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent b
asics and keyval usage)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty 2013/12/19 v3.12 KOMA-Script package (loading files)
tocbasic.sty 2013/12/19 v3.12 KOMA-Script package (handling toc-files)
scrsize11pt.clo 2013/12/19 v3.12 KOMA-Script font size class option (11pt)
typearea.sty 2013/12/19 v3.12 KOMA-Script package (type area)
newtxtext.sty 2014/04/07 v1.25
fontaxes.sty 2014/03/23 v1.0d Font selection axes
xkeyval.sty 2012/10/14 v2.6b package option processing (HA)
xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
textcomp.sty 2005/09/27 v1.99g Standard LaTeX package
ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
amsmath.sty 2013/01/14 v2.14 AMS math features
amstext.sty 2000/06/29 v2.01
amsgen.sty 1999/11/30 v2.0
amsbsy.sty 1999/11/29 v1.2d
amsopn.sty 1999/12/14 v2.01 operator names
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
inputenc.sty 2008/03/30 v1.1d Input encoding file
utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
ts1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
tikz.sty 2013/12/13 v3.0.0 (rcs-revision 1.142)
pgf.sty 2013/12/18 v3.0.0 (rcs-revision 1.14)
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
pgfcore.sty 2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o 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)
pgffor.sty 2013/12/13 v3.0.0 (rcs-revision 1.25)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
t1ntxrx.fd 2012/12/25 v1.0
supp-pdf.mkii
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (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
您缺少=
以下内容.style={}
。
代码:
\documentclass[
a4paper
]{scrartcl}
\usepackage{
newtxtext,
amsmath,
}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\tikzset{
sometest/.style={
align=left,
text width=5cm
},
asdfasdf/.style={
rectangle
},
}
\listfiles
\begin{document}
Test.
\begin{center}
\begin{tikzpicture}
\node {Something text.};
\node[sometest] {AAA};
\end{tikzpicture}
\end{center}
\end{document}
\end{document}