\今天不显示除“0”之外的内容

\今天不显示除“0”之外的内容

晚上好,我不知道如何在第一页上获取正确的日期,\maketitle过去我已经这样做过,没有任何问题。大文档,因此嵌套:

root: -> title
      -> any other file needed
      -> the one forgotten file

我得到以下文档在此处输入图片描述

主要的:

\documentclass[10pt,a4paper,twoside]{article}
\usepackage{ragged2e}   % toglie il rientro anglosassone dei paragrafi nuovi
%\usepackage[T1]{fontenc}       % non necessario con XeLaTeX
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{datetime}
\usepackage{mwe}
\usepackage{blindtext}
\usepackage{fontspec}   % per selezionare nuovi font
\setmainfont{Arial}
\setsansfont{Arial}
\setlength\evensidemargin{0.0in}
\setlength\oddsidemargin{0.0in}
\setlength\textwidth{6.5in}
\setlength\textheight{9.5in}
\setlength\topmargin{-0.5in}
\usepackage[raggedright]{titlesec}
\usepackage{nicefrac}
\usepackage[dvipsnames]{xcolor}
%\usepackage{fr3d-colors}     %% my personal defined colors, will change in something dvipsname
\usepackage{float}
\usepackage{wrapfig}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{positioning,calc}
\usepackage{lscape}
\usepackage{csvsimple}
\usepackage{anyfontsize}
\usepackage{rotating}
\usepackage[normalem]{ulem} % permette di avere testo barrato
\usepackage{tocloft}
\usepackage{titletoc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For "Outlining pain"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \def\Vicodin{Vicodin 150mg}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf} 
%\usepackage{}  % Ps fill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For Footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.2pt}
%\rhead{Share\LaTeX}
%\lhead{Guides and tutorials}
\rhead{\month \year}
\rfoot{\thepage}
\def\day{}
\cfoot{\scriptsize \textit{\textsf{\sffamily\textcopyright} Stupid \textsc{Guy}} 2023}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For Multiple Columns within Text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{multicol}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For Links to Websites
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% https://www.sharelatex.com/learn/Hyperlinks
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=cyan,
}

\urlstyle{same}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  More customisation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\setcounter{secnumdepth}{1}
%\setcounter{tocdepth}{1}

%\copyright symbol
\usepackage{textcomp}

% note a piè pagina per altre parti nel corpo di testo
%\usepackage{scrextend}
\usepackage{footmisc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %Title Page
    % \begin{titlepage}
        \include{title}
        \newpage
        \pagestyle{empty}
        \cleardoublepage    %in aggiunta alla paginabianca
    % \end{titlepage}
%   \newpage
%   \thispagestyle{empty}
%   \cleardoublepage    %in aggiunta alla paginabianca
    \include{otherFile}
\end{document}

Title.tex,应该显示\today

\begin{titlepage}   

    \pagestyle{empty}
    
    \begin{tikzpicture}[remember picture, overlay]
        \draw[fill=black] (current page.north west) rectangle (current page.south east);
        
        %Striscia verticale Green4!25
        \node[rectangle, fill=OliveGreen!30, anchor=south west, minimum width=12mm, minimum height=\paperheight](sidebar) at ($(current page.south west)+(0,0)$){};
    
        \node [anchor=north west, xshift=-1mm, yshift=2mm] (colVert) at ($(sidebar.north east)+(-.02,0)$) {\includegraphics[width=0.5\paperwidth]{example-image-c}};
        
        %Striscia orizontale 
        \node[rectangle, fill=OliveGreen, anchor=north west, minimum width=\paperwidth, minimum height=24mm](footbar) at ($(colVert.south west)+(0.1,0.12)$){};
        
        \node [anchor=east, text width=\paperwidth, color=white, 
    %   below right=of colVert,
        ] (titolo) at ($(footbar.east)+(-.3,-.0)+(-1.3,0)$)
        {
            \begin{flushright}
                \fontsize{32pt}{32pt}\selectfont \bfseries Spinal surgery
            \end{flushright}
        };
    %   \node (sTitolo) {Diario medico postoperatorio}
    
        \node [anchor=east, text width=\textwidth, color=white, 
        %   below right=of colVert,
        ] (sTitolo) 
        at ($(footbar.east)+(-.3,-2.25)+(-1.3,-0)$)
        {
            \begin{flushright}
                \fontsize{26pt}{30pt}\selectfont  \itshape Journal
            \end{flushright}
        };
        
        \node [anchor=east, text width=\textwidth, color=white, 
        %   below right=of colVert,
        ] (autore) 
        at ($(footbar.east)+(-.3,-5.25)+(-1.3,-0)$)
        {
            \begin{flushright}
                \fontsize{16pt}{20pt}\selectfont  \bfseries \scshape Stupid guy
            \end{flushright}
        };
        
        \node [anchor=east, text width=\textwidth, color=white, 
        %   below right=of colVert,
        ] (info) 
        at ($(footbar.east)+(-.3,-15.75)+(-1.3,-0)$)
        {
    %       \raggedright
            \begin{flushright}
                \fontsize{12pt}{18pt}\selectfont  
                    \begin{tabular}{rl}
    %                   %more text as Admission date ,ecc
                        \textbf{v 1.16}&   \today   \\
                    \end{tabular}
            \end{flushright}
        };
        
    \end{tikzpicture}
\end{titlepage}

最后是简化版本,其中包含 5 个不同的文件,如下所示,它们也将合并到主文件或根文件中:

\section*{1st day}
\blindtext

\section*{2nd day}
\begin{wrapfigure}[22]{l}{0.63\textwidth}
    \centering
    \includegraphics[\width=0.6\textwidth]{example-image-a}
\end{wrapfigure}
\blindtext
\blindtext

\subsection*{3rd day}
\begin{wrapfigure}[22]{l}{0.63\textwidth}
    \centering
    \includegraphics[\width=0.6\textwidth]{example-image-a}
\end{wrapfigure}
\blindtext
\blindtext

\section*{4th day}
\begin{wrapfigure}[22]{l}{0.63\textwidth}
    \centering
    \includegraphics[\width=0.6\textwidth]{example-image-a}
\end{wrapfigure}
\blindtext
\blindtext

\subsection*{6th day}
\begin{wrapfigure}[22]{l}{0.63\textwidth}
    \centering
    \includegraphics[\width=0.6\textwidth]{example-image-a}
\end{wrapfigure}
\blindtext
\blindtext

and so on for the other important days

是的,wrapfig 与 PS 技巧一起使用来突出显示重要内容,并且许多包用于进一步绘制一些 pgf 图,而且我还在进行一场战争以让siunitx命令\qty{}{}使用文本字体相应地显示数字,但这不是他的帖子的目的。

我已经尝试创建一个虚假的\maketitle,我打算把它放在哪里,但什么也没有,也\date{\today}没有用,所以我尝试在titlepage env包含的文件内部和外部进行操作(看看所有那些注释行)。

如果有必要的话,2周前我将 TeXstudio 从 4.6.3 升级到了 4.7.0 版本。

谢谢大家的帮助。

我根据在 overleaf 中找到的个人日记模板进行了一些工作(https://www.overleaf.com/latex/templates/personal-journal-template/cnhkpjpfkrdn), 阅读 @campa 的评论时,我怀疑日志中对 \day 的递归重新定义可能会影响 \today 的行为。我说得对吗?

如果是这样的话,我应该失去 100 分声誉,因为我没有注意到如此明显的事情......我很抱歉让你浪费时间在我这个愚蠢的问题上。

答案1

看看@campa 的评论,我盲目地遵循了 overleaf 模板…… https://www.overleaf.com/latex/templates/personal-journal-template/cnhkpjpfkrdn

第 11 条戒律,永远不要相信互联网上的任何东西。很抱歉你们浪费了一个小时来帮助我,非常感谢大家

因此,使用大写字母的新定义解决了问题,直到它没有解决问题……但最终罪魁祸首是\def\day{}fancyhf序言部分。现在它按预期工作了!

呼呼呼

相关内容