1

I tried \renewcommand{\today}{\the\day/\the\month} intendint to change the date format to dd/mm. It didn't work.

I searched for similar questions, but found no answer to my case (I'm using exclusively the \advdate package). Is there any work around?

Thank you!

Edit

As required, here it goes a MWE:

\documentclass{article}
\usepackage{advdate}
\usepackage[brazil]{babel}

\ThisDay{1}
\ThisMonth{2}
\ThisYear{2019}

\newcommand{\nextevent}{%
    \section*{\today}
    \vspace{-3mm}
    \AdvanceDate[15]
}

\begin{document}

\begin{center}
    \Large
    My schedule
\end{center}

\nextevent
I will travel.

\nextevent
I will come back.

\end{document}
  • Can you make a minimal working example (MWE)? – user36296 Jan 30 at 14:22
  • Hi, @samcarter. I just edited the question to answer your request. Observe that the date is in the format 1 de fevereiro de 2019, while I would like it to display 01/02. Thank you! – Brasil Jan 30 at 14:30
  • Sorry to bother you here, but you didn't have to delete your question tex.stackexchange.com/q/477713/35864. Marking questions as duplicates instead of just deleting them helps the community because duplicate questions remain searchable and therefore can serve as signposts with slightly different search terms, which makes stuff overall easier to search for. It just doesn't make a whole lot of sense to add a separate answer if there is a perfectly good answer elsewhere already. – moewe Mar 4 at 21:44
  • Hi, @moewe, thank you for this tip. I still new to the community and I thought that keeping duplicate question would make me less contributive. So I deleted it because I want the very contrary and then help {TEX} improve. You don't bother, and I just have to thank you! – Brasil Mar 6 at 21:56
  • Some people think that duplicate closures look bad (presumably because other closures are indication of a unsuitable or lower-quality question). I happen to disagree and think that duplicates are a fundamental part of the working of this site. There should be no stigma attached to having one's question closed as a duplicate. As I said good duplicate questions (with an accurate description of the problem, good tags, etc.) can be extremely beneficial to the community. – moewe Mar 7 at 5:11
2

Quick hack: instead of using \today build the date yourself

\documentclass{article}
\usepackage{advdate}
\usepackage[brazil]{babel}

\ThisDay{1}
\ThisMonth{2}
\ThisYear{2019}

\newcommand{\nextevent}{%
    \section*{%
        \ifnum \number\day < 10 0\fi \number\day
        /%
        \ifnum \number\month < 10 0\fi \number\month
    }
    \vspace{-3mm}
    \AdvanceDate[15]
}

\begin{document}

\begin{center}
    \Large
    My schedule
\end{center}

\nextevent
I will travel.

\nextevent
I will come back.

\end{document}

enter image description here

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.