मैं अपने दस्तावेज़ में शब्दों की संख्या कैसे प्रदर्शित कर सकता हूं?
Jan 12 2021
एक पत्रिका के लिए मुझे अधिकतम का एक छोटा लेख लिखना होगा। 700 शब्द। मैं अंत में एक शब्दकूट रखना चाहता हूं। मुझे StackExchange पर यहाँ निम्न कोड मिला । लेकिन जब मैंने इसे स्वयं आजमाया तो यह काम नहीं आया। दुर्भाग्य से, मुझे इस विषय पर प्रतिक्रिया देने की अनुमति नहीं है।
\documentclass{article}
\newcommand\wordcount{\input{|"texcount -inc -sum -0 -template={SUM} \jobname.tex"}}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend pulvinar quam, vel suscipit urna tincidunt eget.
This document has \wordcount words.
\end{document}
मुझे निम्नलिखित त्रुटि मिलती है:
! LaTeX त्रुटि: फ़ाइल `| texcount -inc -sum -0 -template = {SUM} test.tex नहीं मिला।
टाइप करने के लिए X छोड़ें या आगे बढ़ें, या नया नाम दर्ज करें। (डिफ़ॉल्ट एक्सटेंशन: टेक्स)
फ़ाइल का नाम दर्ज करें:
क्या किसी को पता है कि क्या गलत हो रहा है?
जवाब
1 Fran Jan 13 2021 at 04:28

\documentclass{article}
\parskip1em\parindent0pt
\immediate\write18{texcount -1 -sum \jobname.tex > wordcount.aux }
\begin{document}
\section*{How to compile this file}
From the command line (The damn buttonless black window): \par
\hfil\texttt{pdflatex --shell-escape \jobname .tex}\par
From your favourite \LaTeX\ editor: \par
\hangindent1em\hangafter0 Edit your editor configuration to enable the option \texttt{--shell-escape} of the \texttt{pdflatex} compiler. You should {\em not} use this option by foreing documents (like this) without know if the source is safe.\par
% This part is not counted
%TC:ignore
Word count = {\bfseries\large \input{wordcount.aux}}
%TC:endignore
\end{document}