scielo-edo / SPS-TeX

LaTeX for SciELO Publishing Schema
0 stars 0 forks source link

\formatdate{} % Tratar zeros #34

Open yamadapc opened 7 years ago

jorgesallum commented 7 years ago

@yamadapc está estranho. Se a há dia, mês e ano, ele corta o dia... se há mês e ano, ele corta o mês... Favor conferir em https://jats2tex.beijaflor.io/workspaces/20

yamadapc commented 6 years ago

Template

pub-date:
  head: |

    \date{
      \selectlanguage{portuges}
      @@lua(
        day = find "//day"
        month = find "//month"
        year = find "//year"

        if month == "" then
          return "\\formatdate{" .. year .. "}"
        end

        if day == "" then
          return "\\formatdate{" .. month .. "}{" .. year .. "}"
        end

        return "\\formatdate{" .. day .. "}{" .. month .. "}{" .. year .. "}"
      )@@
    }

XML

<root>     
<pub-date pub-type="epub-ppub">
        <day>21</day>
        <month>08</month>
        <year>2013</year>
      </pub-date>

      <pub-date pub-type="epub-ppub">
        <month>08</month>
        <year>2013</year>
      </pub-date>

      <pub-date pub-type="epub-ppub">
        <year>2013</year>
      </pub-date>
</root>

LaTeX

% Generated by jats2tex@0.11.1.0

\date{
\selectlanguage{portuges}
\formatdate{21}{08}{2013}
}
\date{
\selectlanguage{portuges}
\formatdate{08}{2013}
}
\date{
\selectlanguage{portuges}
\formatdate{2013}
}
yamadapc commented 6 years ago

Adicionar ao repositório