chiehrosswang / TRB_LaTeX_tex

A LaTeX template for Transportation Research Board Annual Meeting papers
MIT License
45 stars 22 forks source link

Suggestion to improve WordCount (line 194) #23

Open TheRoadBug opened 9 months ago

TheRoadBug commented 9 months ago

I would like to make a suggestion to avoid having to edit the .cls file in line 194. Currently, that line contains:

Word Count: \quickwordcount{trb_template}~words $+$ \total{table} table(s) $\times$ \@WordsPerTable\ $=$ \totalwordcount~words\\

My suggestion is modify the trbunofficial.cls file to include a new command \thisfilename{...} which would be used to provide the TeX file name to be included in line 194. Thus, in the LaTeX file preamble, one would include a line with:

\thisfilename{main} % main.tex is the file with the manuscript for TRB

The trbunofficial.cls file would have to be modified to replace the current \renewcommand{\maketitle} macro with this code:

\newcommand{\thisfilename}[1]{\newcommand{\@filename}{#1}}
\renewcommand{\maketitle}{%
    \thispagestyle{empty}
    \begin{flushleft}
        {\MakeUppercase{\bfseries\@title}}\\
        \hfill\break%
        \hfill\break%
        \hfill\break%
        \@author\\
        \hfill\break%
        \hfill\break%
        \if\@TotalWords 0
        Word Count: \quickwordcount{\@filename}~words $+$ \total{table} table(s) $\times$ \@WordsPerTable\ $=$ \totalwordcount~words\\
        \else
        Word Count: \@TotalWords\ words $+$ \total{table} table(s) $\times$ \@WordsPerTable\ $=$ \the\numexpr\@TotalWords + \totvalue{table}*\@WordsPerTable~words\\
        \fi
        \hfill\break%
        \hfill\break%
        \hfill\break%
        \hfill\break%
        \hfill\break%
        \hfill\break%
        Submission Date: \today
    \end{flushleft}
    \newpage
}

I hope this would help.

gregmacfarlane commented 8 months ago

How would you like to send this in a pull request? Its an interesting idea that I would lie to try out.