我正在尝试编写预算提案,并且正在使用计数器来控制每件商品的数量和价格。我还创建了一个表,并使用\ ifnum来控制是否应将该项目包括在提案中(仅当数量大于0时)。
我在第一个\ ifnum中插入了“ Missing}”,但是我似乎找不到为什么。我缺少明显的东西吗?
还有一个问题,当一个项目的数量为0时,尽管在\ ifnum里面应该为假,但在生成表时仍会包括该行(只是忽略第一个单元格)。这还会在第二个\ ifnum上提示“额外的\ fi”错误。
这是下面的代码和它生成的表:
\section{Serviços executados em Outubro de 2018 com validade até Outubro de 2019}
\newcounter{p_4}
\newcounter{p_4Q}
\newcounter{p_6}
\newcounter{p_6Q}
\newcounter{ap_10}
\newcounter{ap_10Q}
\newcounter{co_4}
\newcounter{co_4Q}
\newcounter{co_6}
\newcounter{co_6Q}
\newcounter{mangueira}
\newcounter{mangueiraQ}
\setcounter{p_4} {20} %pqsp 4kg
\setcounter{p_4Q} {2} %quantidade psqp 4kg
\setcounter{p_6} {45} %pqsp 6kg
\setcounter{p_6Q} {0} %quantidade pqsp 6kg
\setcounter{ap_10} {20} %ap 10 litros
\setcounter{ap_10Q} {1} %quantidade ap 10 litros
\setcounter{co_4} {18} %co2 4kg
\setcounter{co_4Q} {4} %quantidade co2 4kg
\setcounter{co_6} {28} %co2 6kg
\setcounter{co_6Q} {3} %quantidade co2 6kg
\setcounter{mangueira} {15} %reteste mangueira
\setcounter{mangueiraQ} {22} %quantidade reteste mangueira
\newcounter{itemCounter}
\setcounter{itemCounter}{1}
%\ifnum \value{p_4Q}>0
%{01 p_6SP 4Kg \arabic{p_4Q} R\$ \arabic{p_4},00 R\$ \the\numexpr\p_6Quatro*\p_6QuatroQ\relax,00 \\}
\begin{table}[H]
\begin{tabular}{|c|l|c|c|c|}
\hline
\multicolumn{1}{|l|}{Item} & Especificação & \multicolumn{1}{l|}{Quantidade} & Valor Unitário & \multicolumn{1}{l|}{Valor Total} \\ \hline
\ifnum\value{p_4Q}>0
{
\arabic{itemCounter} & PQSP 4Kg & \arabic{p_4Q} & R\$ \arabic{p_4},00 & R\$ \the\numexpr\value{p_4}*\value{p_4Q}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
\ifnum\value{p_6Q}>0
{
\arabic{itemCounter} & PQSP 6Kg & \arabic{p_6Q} & R\$ \arabic{p_6},00 & R\$ \the\numexpr\value{p_6}*\value{p_6Q}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
\ifnum\value{ap_10Q}>0
{
\arabic{itemCounter} & AP 10L & \arabic{ap_10Q} & R\$ \arabic{ap_10},00 & R\$ \the\numexpr\value{ap_10}*\value{ap_10Q}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
\ifnum\value{co_4Q}>0
{
\arabic{itemCounter} & CO2 4Kg & \arabic{co_4Q} & R\$ \arabic{co_4},00 & R\$ \the\numexpr\value{co_4}*\value{co_4Q}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
\ifnum\value{co_6Q}>0
{
\arabic{itemCounter} & CO2 6Kg & \arabic{co_6Q} & R\$ \arabic{co_6},00 & R\$ \the\numexpr\value{co_6}*\value{co_6Q}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
\ifnum\value{mangueiraQ}>0
{
\arabic{itemCounter} & Reteste de mangueiras de incêndio tipo 1 & \arabic{mangueiraQ} & R\$ \arabic{mangueira},00 & R\$ \the\numexpr\value{mangueira}*\value{mangueiraQ}\relax,00 \\ \hline
\stepcounter{itemCounter}
}
\fi
Total & & & & R\$
\the\numexpr\value{p_4}*\value{p_4Q} +
\the\numexpr\value{p_6}*\value{p_6Q} +
\the\numexpr\value{ap_10}*\value{ap_10Q} +
\the\numexpr\value{co_4}*\value{co_4Q} +
\the\numexpr\value{co_6}*\value{co_6Q} +
\the\numexpr\value{mangueira}*\value{mangueiraQ}\relax,00 \\ \hline
\end{tabular}
\end{table}
在此先感谢您的回复。
答案 0 :(得分:3)
基于https://tex.stackexchange.com/a/131284/36296的小技巧,将filter
的“&”号隐藏在表中
另外
每行周围的组都需要删除
空行已删除
在行中移动arrayformula
,否则它将开始一个新单元格
Traceback (most recent call last):
File "<ipython-input-20-64156d691fe5>", line 1, in <module>
import tensorflow as tf
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\ProgramData\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime