LaTeX forum ⇒ Generall3doc for dummies Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
erwann
Posts: 65
Joined: Thu Aug 25, 2016 2:24 am

l3doc for dummies

Postby erwann » Sun May 06, 2018 3:03 am

Question # 1 : generating the doc and sty files in the directory where they belong.
  1. $ find $PWD -type d -name foo
  2. /home/er/Documents/dev/LaTeX/texmf-dist/tex/latex/foo
  3. /home/er/Documents/dev/LaTeX/texmf-dist/source/foo
  4. /home/er/Documents/dev/LaTeX/texmf-dist/doc/latex/foo

I tried to put either of
  1. \usedir{tex/latex/foo}
  2. \usedir{./texmf-dist/tex/latex/foo}
  3. \usedir{home/er/the rest of the path/texmf-dist/tex/latex/foo}
just before\endpostamble, as in the code excerpted from conteq below, but it seems to be ignored (sty and pdf created in the same directory as that of dtx), so I must have misunderstood its purpose.

Here's an excerpt from conteq.dtx, from which foo.dtx is based:
  1. \endpostamble
  2. \usedir{tex/latex/conteq}
  3. \generate{
  4. \file{\jobname.sty}{\from{\jobname.dtx}{package}
  5. \from{\jobname.dtx}{layouts}}
  6. }
  7. %</install>
  8. %<install>\endbatchfile
  9. %<*internal>
  10. \generate{
  11. \file{\jobname.ins}{\from{\jobname.dtx}{install}}
  12. }
  13. \nopreamble\nopostamble
  14. \generate{
  15. \file{README.txt}{\from{\jobname.dtx}{readme}}
  16. }


Question #2

In the section Example, the same code is repeated twice, once verbatim, the other not. Is there a way to avoid this duplication?

  1. % \iffalse meta-comment
  2. % !TEX program = pdfLaTeX
  3. %<*internal>
  4. \iffalse
  5. %</internal>
  6. %<*readme>
  7. ----------------------------------------------------------------
  8. foopckg --- Foo package
  9. Source repository: TODO
  10. Source repository mirror: TODO
  11. Released under the LaTeX Project Public License v1.3c or later
  12. See <!-- m --><a class="postlink" href="http://www.latex-project.org/lppl.txt">http://www.latex-project.org/lppl.txt</a><!-- m -->
  13. ----------------------------------------------------------------
  14.  
  15. %</readme>
  16. %<*internal>
  17. \fi
  18. \def\nameofplainTeX{plain}
  19. \ifx\fmtname\nameofplainTeX\else
  20. \expandafter\begingroup
  21. \fi
  22. %</internal>
  23. %<*install>
  24. \input docstrip.tex
  25. \keepsilent
  26. \askforoverwritefalse
  27. \preamble
  28. ----------------------------------------------------------------
  29. foopckg --- Foo package
  30. Released under the LaTeX Project Public License v1.3c or later
  31. See <!-- m --><a class="postlink" href="http://www.latex-project.org/lppl.txt">http://www.latex-project.org/lppl.txt</a><!-- m -->
  32. ----------------------------------------------------------------
  33.  
  34. \endpreamble
  35. \postamble
  36.  
  37. Copyright (C) 2018 by AUTHOR
  38.  
  39. This work may be distributed and/or modified under the
  40. conditions of the LaTeX Project Public License (LPPL), either
  41. version 1.3c of this license or (at your option) any later
  42. version. The latest version of this license is in the file:
  43.  
  44. <!-- m --><a class="postlink" href="http://www.latex-project.org/lppl.txt">http://www.latex-project.org/lppl.txt</a><!-- m -->
  45.  
  46. This work is "maintained" (as per LPPL maintenance status) by
  47. AUTHOR.
  48.  
  49. This work consists of the file foopckg.dtx
  50. and the derived files foopckg.ins,
  51. foopckg.pdf and
  52. foopckg.sty.
  53.  
  54. \endpostamble
  55. \usedir{/home/er/Documents/dev/LaTeX/texmf-dist/tex/latex/foo}
  56. \generate{
  57. \file{\jobname.sty}{\from{\jobname.dtx}{package}}
  58. }
  59. %</install>
  60. %<install>\endbatchfile
  61. %<*internal>
  62. \generate{
  63. \file{\jobname.ins}{\from{\jobname.dtx}{install}}
  64. }
  65. \nopreamble\nopostamble
  66. \generate{
  67. \file{README.txt}{\from{\jobname.dtx}{readme}}
  68. }
  69. \ifx\fmtname\nameofplainTeX
  70. \expandafter\endbatchfile
  71. \else
  72. \expandafter\endgroup
  73. \fi
  74. %</internal>
  75. %<package>\NeedsTeXFormat{LaTeX2e}
  76. %<package>\RequirePackage{expl3}[2012/07/02]
  77. %<package>\ProvidesExplPackage
  78. %<package> {foopckg} % Package name
  79. %<package> {2018/05/05} % Release date
  80. %<package> {0.1} % Release version
  81. %<package> {Foo package} % Description
  82. %
  83. %<*driver>
  84. \documentclass[full]{l3doc}
  85. \usepackage{foopckg}
  86. \usepackage{amsmath}
  87. \EnableCrossrefs
  88. \CodelineIndex
  89. \RecordChanges
  90. \begin{document}
  91. \DocInput{\jobname.dtx}
  92. \end{document}
  93. %</driver>
  94. % \fi
  95. %
  96. % \GetFileInfo{\jobname.sty}
  97. %
  98. %
  99. %\title{^^A
  100. % \textsf{foopckg} --- Dummy package\thanks{^^A
  101. % This file describes version \fileversion, last revised \filedate.^^A
  102. % }^^A
  103. %}
  104. %\author{AUTHOR}
  105. %
  106. %\date{Released \filedate}
  107. %
  108. %\maketitle
  109. %
  110. %\changes{0.1}{2018/05/05}{First version}
  111. %
  112. % \begin{abstract}
  113. % \cs{foo} won't even say `Hello, world! '.
  114. % \end{abstract}
  115. %
  116. % \section{Example}
  117. % \textbf{Input}
  118. % \begin{verbatim}
  119. % \section*{Foo}\label{foo}
  120. % \tl_set:Nn \bar \foo
  121. % \foo
  122. % \end{verbatim}
  123. % \textbf{Output}
  124. % \ExplSyntaxOn
  125. % \section*{Foo}\label{foo}
  126. % \tl_set:Nn \bar \foo
  127. % \foo
  128. % \ExplSyntaxOff
  129. %
  130. %\StopEventually{^^A
  131. % \PrintChanges
  132. % \PrintIndex
  133. %}
  134. %
  135. % \section{Implementation}
  136. %
  137. % \iffalse
  138. %<*package>
  139. % \fi
  140. %
  141. % \begin{macrocode}
  142. \msg_new:nnn
  143. { foopckg }
  144. { generic }
  145. { #1 }
  146. \tl_set:Nn \foo{ANYTHING}
  147. % \end{macrocode}
  148. %
  149. % \iffalse
  150. %</package>
  151. % \fi
  152. %
  153. % \Finale
  154. \endinput
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Tags:

erwann
Posts: 65
Joined: Thu Aug 25, 2016 2:24 am

Postby erwann » Thu May 24, 2018 2:00 am

Another question about l3doc: how to do you get the index and the changes to appear in the generated pdf? I was hoping removing ^^A from this would do it. Not.

  1. %\StopEventually{^^A
  2. % \PrintChanges
  3. % \PrintIndex
  4. %}


A full example here (my repository) : https://github.com/er-cpp/erw-l3/blob/master/erw-l3.dtx
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

erwann
Posts: 65
Joined: Thu Aug 25, 2016 2:24 am

Postby erwann » Mon Jun 18, 2018 2:51 am

erwann wrote:Another question about l3doc: how to do you get the index and the changes to appear in the generated pdf?


Answer is in the log file: to generate the change history, do

  1. $ makeindex -s gglo.ist -o cooking-units.gls cooking-units.glo


and then run pdflatex once more.
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)


Return to “General”

Who is online

Users browsing this forum: No registered users and 9 guests