Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Svend Juul Thanks for your reply. I did take a look - cmdlog looks good but I don't think it'll help me with my latest question on how to write a .tex file's preamble.

    Comment


    • #17
      Andy dB Your code is correct. You can begin writing your complete LaTeX document as you did or import/input other tex files. There is no option for adding a package because I don't want to make the package more complex to use... here's why you got weird results:
      1. it seems your MarkDoc is not the latest version 3.6.0 because the erase option has not been supported for a long time!
      2. As noted in the help file, MarkDoc by default expects Markdown language. If you write in HTML or LaTeX, you should tell MarkDoc that you are not using Markdown, in your case you should add the following option markup(latex)
      markdoc report, export(tex) markup(latex) replace

      I tried it and it worked. It seems that it adds unnecessary \verbatum at the beginning and ending of the document. This is a tiny bug and by removing it you can typeset the document. I'll get it fixed in the next release.

      I'm glad that you're thoroughly examining the LaTeX functionalities of MarkDoc!

      ——————————————
      E. F. Haghish, IMBI, University of Freiburg
      [email protected]
      http://www.haghish.com/

      Comment


      • #18
        Perfect - thank you very much, haghish! I saw the erase option on your website - I believe it was here. Anyways, thanks a lot for pointing me to the right command and for fixing the verbatim bug. There is another redundant verbatim environment at the end of the file, but it shouldn't cause any problems. If your next release takes a while, it would be great if you could email me your updated .ado file.

        Comment


        • #19
          Andy dB

          Markdoc 3.6.2 is already up and both of the bugs you mentioned are fixed! So there should be no additional Verbatim. Thanks for the bug report.
          ——————————————
          E. F. Haghish, IMBI, University of Freiburg
          [email protected]
          http://www.haghish.com/

          Comment


          • #20
            haghish : Two more questions about this:

            1) How can I use MarkDoc within a loop? The above example simply vanishes if I want to write, say, 10 reports and loop over my values 1 to 10

            2) How can I use locals within my latex document? As the above uses a huge comment field, locals don't get interpreted.

            Thanks again for your help!

            Comment


            • #21
              Andy dB

              - "How can I use MarkDoc within a loop?" You mean calling markdoc within a loop? Perhaps you could upload a do-file to allow me reproduce the problem you're facing. There shouldn't be a problem with looping...

              - Regardless of the markup language (LaTeX, HTML, Markdown), local macros (as well as globals, scalars) do not get interpreted in the report, naturally. That's why the txt command was written to support dynamic text. You can use any markup language with it to style your text. type help txt (requires Wever package)
              ——————————————
              E. F. Haghish, IMBI, University of Freiburg
              [email protected]
              http://www.haghish.com/

              Comment


              • #22
                Thank you, haghish.

                1) Here is a MWE of a loop. Stata does not log comments in a loop, which is why everything between /*** and ***/ disappears. What is your recommended solution?

                Code:
                forvalues x = 1(1)3 {
                
                    set linesize 80
                    cap: log close
                    qui log using report_`x', replace
                
                    /***
                    \documentclass[a4paper]{article}
                    \usepackage{amsmath}
                    \usepackage[english]{babel}
                    \usepackage{blindtext}
                    
                    \begin{document}
                    ***/        
                    txt "Loop number `x'"
                    /***
                    \blinddocument    
                    \end{document}
                    ***/
                    qui log c
                
                    markdoc report_`x', export(tex) markup(latex) replace
                
                }
                2) Sorry my question about locals was repetitive. I remember you pointed to txt before. However, I believe that there is still a bug, as you will see by simply running the inner part of the loop manually. See "report_.tex" for the output, which has an extra "***/" and an extra "\end{verbatim}".

                Code:
                set linesize 80
                cap: log close
                qui log using report_`x', replace
                /***
                \documentclass[a4paper]{article}
                \usepackage{amsmath}
                \usepackage[english]{babel}
                \usepackage{blindtext}
                 
                \begin{document}
                ***/        
                txt "Loop number `x'"
                /***
                \blinddocument    
                \end{document}
                ***/
                qui: set trace off
                qui log c
                
                markdoc report_`x', export(tex) markup(latex) replace
                My apologies if this is simply due to my limited understanding.

                Comment


                • #23
                  Andy dB

                  Andy I won't have time till tomorrow to test the looping problem. But I just wanted to point out that last week I discovered a "bug" in the txt command which was caused by a missing "new line" directive. I updated it but haven't submitted Weaver to ssc because I'm trying to add a new feature to this command. For now, see if the attached txt command solves your problem. I will run your example later this evening or tomorrow.
                  Attached Files
                  ——————————————
                  E. F. Haghish, IMBI, University of Freiburg
                  [email protected]
                  http://www.haghish.com/

                  Comment


                  • #24
                    Thank you very much. Just to report that this updated txt.ado file unfortunately did not solve the problem reported above (under 2)). Also, of course, 1) persists as it is unaffected by txt. Looking forward to hearing from you!

                    Comment


                    • #25
                      Andy dB
                      1. You can use the template option to load the heading of your LaTeX or any extra package
                      2. When you use the txt command, between Stata commands, you have to manually end the \verbatim because MarkDoc considers anything between the Static text as Stata command and output. Just keep an eye on that.
                      3. Replace the following files and see how it works
                      Attached Files
                      ——————————————
                      E. F. Haghish, IMBI, University of Freiburg
                      [email protected]
                      http://www.haghish.com/

                      Comment

                      Working...
                      X