0

I get warning which I can't understand.

This is my latex code:

\documentclass[a4paper,10]{article}
\usepackage[zw32010,crossmark]{ticket}
\usepackage{graphicx}

\usepackage{fontspec}

\usepackage[paperwidth=80mm, paperheight=50mm]{geometry}

\usepackage{xcolor}
\definecolor{red}{RGB}{218,37,29}

\renewcommand{\ticketdefault}{}
\newcommand{\vcard}[6]{\ticket{
    \put(4.5, 49.5){\tt #1}
    \put(4.5, 47){\tt #2}
    \put(4.5, 44){\tt #3}
    \put(39, 25){\tt #4}
    \put(4.5, 11){\tt #5}
    \put(35, 11){\tt #6}
}}

\newcounter{numcards}
\begin{document}

\setcounter{numcards}{0}

\whiledo{\thenumcards<1}{
  \stepcounter{numcards}
  \vcard
  {\parbox{\textwidth}{ {\fontsize{10.5pt}{10.5pt}{ Matija Lukic,}} \fontsize{9pt}{9pt} M.Sc.EE.} }
  {\includegraphics[width=50mm, height=1mm]{example-image}}
  {\parbox{\textwidth}{\fontsize{7.5pt}{7.5pt} Engineer}}
  {\includegraphics[width=40mm, height=20mm]{example-image}}
  {\parbox{\textwidth}{\scriptsize Company LTD \\Address \\ 11070 Belgrade, Serbia \\ \color{red} www.COMPANY.com}}
  {\parbox{.8\textwidth}{\scriptsize \raggedleft M: 064534444\\  T: +381 (0)11 22 22 222\\ F: +381 (0)11 65 333 333\\ matija.lukic@email.com}}
}

\end{document}
  • Maybe my images are problematic. This is more descriptive warning message. File: nic_int_logo_logobitmapmid_1v0.jpg Graphic file (type jpg) <use nic_int_logo_logobitmapmid_1v0.jpg> Package luatex.def Info: nic_int_logo_logobitmapmid_1v0.jpg used on input line 52. on input line 52. Package luatex.def Info: Requested size: 113.81102pt x 34.144pt on input line 52 . (load luc: /tmp/.texlive2013/texmf-var/luatex-cache/generic/fonts/otl/lmmono8-re gular.luc) Underfull \hbox (badness 10000) in paragraph at lines 52--53 – Matija Lukic Nov 7 '18 at 12:55
  • And when I use python to generate pdf from this latex template I get this error: !LuaTeX error: cannot find OpenType font file for reading () ==> Fatal error occurred, no output PDF file produced! – Matija Lukic Nov 7 '18 at 12:56
  • can you not make an example using example-image (which is generally available) and standard fonts? so people can run the code without unrelated errors? unrelated but note font family commands do not take an argument so \centuryItalic{Engineer} should be \centuryItalic Engineer – David Carlisle Nov 7 '18 at 12:59
  • I've just edited my question, and also get the same underfull \hbox warning. – Matija Lukic Nov 7 '18 at 13:08
1

Substituting the dubious \\[-\baselineskip] instructions with \vspace*{-\baselineskip} removes the warning.

\documentclass[a4paper]{article}
\usepackage[zw32010,crossmark]{ticket}

\usepackage{regexpatch}

\makeatletter
\xpatchcmd*{\ticket@counter}{\\[-\baselineskip]}{\vspace*{-\baselineskip}}{}{}
\makeatother

\usepackage{graphicx}

\usepackage{fontspec}

\usepackage[paperwidth=80mm, paperheight=50mm]{geometry}

\usepackage{xcolor}
\definecolor{red}{RGB}{218,37,29}

\renewcommand{\ticketdefault}{}
\newcommand{\vcard}[6]{\ticket{
    \put(4.5, 49.5){\tt #1}
    \put(4.5, 47){\tt #2}
    \put(4.5, 44){\tt #3}
    \put(39, 25){\tt #4}
    \put(4.5, 11){\tt #5}
    \put(35, 11){\tt #6}
}}

\newcounter{numcards}

\begin{document}

\setcounter{numcards}{0}

\whiledo{\value{numcards}<4}{
  \stepcounter{numcards}
  \vcard
  {\parbox{\textwidth}{ {\fontsize{10.5pt}{10.5pt}\selectfont Matija Lukic,} \fontsize{9pt}{9pt}\selectfont M.Sc.EE.} }
  {\includegraphics[width=50mm, height=1mm]{example-image}}
  {\parbox{\textwidth}{\fontsize{7.5pt}{7.5pt}\selectfont Engineer}}
  {\includegraphics[width=40mm, height=20mm]{example-image}}
  {\parbox{\textwidth}{\scriptsize Company LTD \\Address \\ 11070 Belgrade, Serbia \\ \color{red} www.COMPANY.com}}
  {\parbox{.8\textwidth}{\scriptsize \raggedleft M: 0645383256\\  T: +381 (0)11 22 22 222\\ F: +381 (0)11 65 333 333\\ matija.lukic@email.com}}
}

\end{document}

Note that \fontsize{100}{200} does nothing at all unless it is followed by \selectfont.

enter image description here

  • Thanks. Now I don't see warning but I get error when I use python to generate pdf using this latex file and lualatex engine, but that is not related with this question - !LuaTeX error: cannot find OpenType font file for reading () ==> Fatal error occurred, no output PDF file produced! – Matija Lukic Nov 7 '18 at 13:40
0

You can simplify your example to

\documentclass[a4paper]{article}
\usepackage[zw32010,crossmark]{ticket}

\begin{document}

  \ticket{}
\end{document}

As usual, the warning is due to mis-use of \\ and in this case a quick workaround to avoid the warning would be

 \ticket{}\mbox{}

Although that silences the warning, it still leaves an extra spurious white line after the last ticket.

and get the same warning, perhaps report it to the maintainer of the ticket package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.