minipage
我在使用或及其参数时遇到了问题\parbox
。目前,我尝试使用名为ticket
。因此我修改了软件包附带的一个例子:
%%%%
%
% ticket.sty example file for visiting cards
%
%%%%
% use the corresponding paper size for your ticket definition
\documentclass[a4paper,10pt]{letter}
% load ticket.sty with the appropriate ticket definition
\usepackage[crossmark]{ticket}
\unitlength=1mm
\hoffset=-1.1cm
\voffset=-2cm
\ticketNumbers{2}{5}
\ticketSize{85}{55} % in unitlength
\ticketDistance{10}{0} %in unitlength
% load misc stuff
\usepackage{graphicx}
\usepackage{color}
% define something
\definecolor{uni}{rgb}{.3019,.7216,.7019}
% make your default ticket. \ticketdefault is somewhat like a background
% here it is empty, because we use different tickets for the front an
% the back of our card
\renewcommand{\ticketdefault}{%
}
% now what do you like to put in your ticket
\newcommand{\vcardfront}[5]{\ticket{%
\put(1,1){\parbox[c][55mm][c]{85mm}{#1}}%
}}
\newcommand{\vcardback}[1]{\ticket{%
\put( 7, 26){\small private:}
\put( 5, 23){\color{uni}\line(1,0){56}}
\put( 7,19){\small%
\begin{minipage}[t]{50mm}%
{#1}\hss%
\end{minipage}}%
}}
% a counter, which makes life easier...
\newcounter{numcards}
\begin{document}
\sffamily
% ten cards for the front
\whiledo{\thenumcards<10}{%
\stepcounter{numcards}%
\vcardfront{Mr. XYZ}}
\setcounter{numcards}{0}
% and ten for the backside
\whiledo{\thenumcards<10}{%
\stepcounter{numcards}%
\vcardback{phone: ---/HH HH HHH\\fax: ---/HH HH HHH\\homestreet 7\\everywhere}}
\end{document}
好吧,问题在于\vcardfront
命令:只要我\parbox
以这种方式使用命令内部,pdfLaTeX 就不会结束并开始在日志文件中计数:
...
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 452.
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 55.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 55.
[1
{/usr/local/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
[2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]
[18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32]
[33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47]
[48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62]
[63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77]
[78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92]
[93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106]
...
而且它不会停止。但如果我使用\parbox
或,它minipage
就会\vcardback
起作用。我做错了什么?为什么会这样?
我正在使用 texlive 2014。
答案1
你不说你想生产什么,就说这个吧(我把5改成了1)
%%%%
%
% ticket.sty example file for visiting cards
%
%%%%
% use the corresponding paper size for your ticket definition
\documentclass[a4paper,10pt]{letter}
% load ticket.sty with the appropriate ticket definition
\usepackage[crossmark]{ticket}
\unitlength=1mm
\hoffset=-1.1cm
\voffset=-2cm
\ticketNumbers{2}{5}
\ticketSize{85}{55} % in unitlength
\ticketDistance{10}{0} %in unitlength
% load misc stuff
\usepackage{graphicx}
\usepackage{color}
% define something
\definecolor{uni}{rgb}{.3019,.7216,.7019}
% make your default ticket. \ticketdefault is somewhat like a background
% here it is empty, because we use different tickets for the front an
% the back of our card
\renewcommand{\ticketdefault}{%
}
% now what do you like to put in your ticket
\newcommand{\vcardfront}[1]{\ticket{%
% 5????
\put(1,1){\parbox[c][55mm][c]{85mm}{#1}}%
}}
\newcommand{\vcardback}[1]{\ticket{%
\put( 7, 26){\small private:}
\put( 5, 23){\color{uni}\line(1,0){56}}
\put( 7,19){\small%
\begin{minipage}[t]{50mm}%
{#1}\hss%
\end{minipage}}%
}}
% a counter, which makes life easier...
\newcounter{numcards}
\begin{document}
\sffamily
% ten cards for the front
\whiledo{\value{numcards}<10 }{%
\stepcounter{numcards}%
\vcardfront{Mr. XYZ}%
}
\setcounter{numcards}{0}
% and ten for the backside
\whiledo{\value{numcards}<10 }{%
\stepcounter{numcards}%
\vcardback{phone: ---/HH HH HHH\\fax: ---/HH HH HHH\\homestreet 7\\everywhere}}
\end{document}