Announcement

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

  • #31
    On my office computer, I got the same of message of installing weaver. However, after re-installing weaver, it worked fine. Yes, I use the most update version of markdoc 3.6.4 February, 2016
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #32
      Originally posted by Attaullah Shah View Post
      can we simply skip the div prefix with Stata command and still be able to pass commands and results to the dynamic document in weave package.
      Attaullah Shah Reviving an old part of this thread, but for this part of your question..... when I prepare -weaver- files that will be shared with other computers or want to run the file with/without compiling weaver, I use macros to turn on/off the weaver div and txt tags. Here's an example that will turn on/off weaver in the do file by changing the macro. Note that I use the global macros t0 - t3 to turn on/off the div/txt tags and that those are all turned on/off together by changing "${useweaver}" global macro at the top of the do-file.





      Code:
          
      **use weaver to document
      sysuse auto, clear
      cap weave close
      
      
      
      
      **change useweaver flag to control using weaver:
      
      global useweaver "TRUE"
      for A in numlist 0/3: global tA "" //reset globals
      if `"${useweaver}"' == "FALSE"  global t0 "**"
      
          ${t0} weave using test, replace 
      
      
          ${t0}  global t1 "div code  "
          ${t0}  global t2 "div result  "
          ${t0}  global t3 "txt     " 
      
      
      ${t3}  *_
      ${t3}  *_    
      ${t3}  *-- QUICK LOOK a the data.
      ${t3}  *_
      ${t3}  *_    
      
      ${t1} desc, sh
      ${t2} desc, fulln
      ${t3}  * <font size="2"> That tables shows how many vars/obs there are </font>
      
      
      ${t3}  *_
      ${t3}  *_    
      ${t3}  * <P STYLE="border: double #CCFFCC 15px"> Quick look at the data:: </P>
      ${t2} codebook, c
      
      
      foreach j in t*   {
          di `"`j'"'
          ${t2} ta `j'
            }
      
      
      ${t3}  ** Look at data broken out by "foreign"::
      
      ${t3} *<h3> CODE:  graph hbar mpg , over(for) blabel(bar)  xsize(9) ysize(6) </h3>
      ${t2} graph hbar mpg , over(for) blabel(bar)  xsize(9) ysize(6)
      
      ${t1} graph export students_served1.png, as(png) replace height(210) width(250)
      img students_served1.png, left
      ${t2} regress price mpg turn i.for
      
      ${t0} weave close
      ${t0} weave pdf
      - Eric Booth

      Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

      Comment


      • #33
        haghish could not agree more about the torture test that is the Windoze platform.

        Comment


        • #34
          Thank you Eric for your reply. My intention in the quoted text was to avoid writing any thing extra so that less a Stata-savvy user does not get confused by the additional prefixes with regular commands.
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          FinTechProfessor.com
          https://asdocx.com
          Check out my asdoc program, which sends outputs to MS Word.
          For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

          Comment


          • #35
            Attaullah Shah Glad to hear it's working fine now.
            wbuchanan Windows is the trouble maker :-)

            eric_a_booth Your solution is clever. I would name the Globals with the same name though. i.e. $div $img $txt. This helps to keep things simpler (a fewer names to memorize). But I like the idea of deactivating Weaver, in case of passing the code to someone who doesn't have/or willing to have the package installed is smart. Thanks.

            Comment


            • #36
              eric_a_booth your code looks rather "not easy to read." have you tried "Weaver Markup" (type help weaver_markup)? Weaver Markup can make writing in Weaver very pleasant, avoiding the HTML tags and yet, styling the document nicely. And if you like to change the style, just add your CSS file to over rule the classes.

              Comment


              • #37
                Originally posted by haghish View Post
                eric_a_booth your code looks rather "not easy to read." have you tried "Weaver Markup" (type help weaver_markup)? Weaver Markup can make writing in Weaver very pleasant, avoiding the HTML tags and yet, styling the document nicely. And if you like to change the style, just add your CSS file to over rule the classes.
                Nope - I will now though. Thanks!
                Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

                Comment


                • #38
                  Hello,

                  I 've just noticed that using some folder path before the name of the desired output leads to an errror.
                  Indeed, the following syntax is OK

                  Code:
                  markdoc MarkDoc_slidesPDF, export(slide) replace install
                  but the following one leads to an error:

                  Code:
                  markdoc `SavePath'/MarkDoc_slidesPDF, export(slide) replace install
                  where `SavePath' is a local containing the desired path of saving (smcl saved in the same folder).

                  The message I received indicate a problem with the printer.
                  [pdfLaTeX not found...)
                  MarkDoc could not produce .....MarkDoc_slidesPDF.pdf]

                  It seems strange to me.

                  Comment


                  • #39
                    Is it possible, to use markdoc in a way it considers Stata LaTeX output ? (some command like "esttab" are really appreciated since they allow a synthesis of previous estimations in a nice format).
                    Thank you for your help.

                    Comment


                    • #40
                      valérie orozco What is the value of `SavePath'? If it contains embedded spaces that will cause the failure. Have you tried wrapping the entire filepath in quotation marks?

                      Comment


                      • #41
                        wbuchanan thanks for your answer. SavePath is defined :

                        Code:
                        local SavePath "d:\......\...\..."
                        I tried to add quotation marks like this:

                        Code:
                         
                         markdoc "`SavePath'/MarkDoc_slidesPDF", export(slide) replace install
                        or

                        Code:
                         
                         markdoc "`SavePath'"/MarkDoc_slidesPDF, export(slide) replace install
                        but no success.

                        Comment


                        • #42
                          valérie orozco showing :

                          Originally posted by valérie orozco View Post
                          Code:
                          local SavePath "d:\......\...\..."
                          Isn't the most helpful if there are embedded spaces in the file path. If there are spaces in the filepath you might want to try something like:

                          Code:
                          markdoc `"`SavePath'/MarkDoc_slidesPDF"', export(slide) replace install
                          You'd also save yourself many headaches by using POSIX style path delimiters (e.g., /) instead of DOS path delimiters (e.g., \). The reason for that is the '\' character can sometimes be interpreted as part of an escape sequence. So eliminating them at least reduces one possible place for things to go wrong.

                          Comment


                          • #43
                            valérie orozco
                            ​Besides the points that wbuchanan is made, the error you get seems not reasonable. Particularly, if the filename you define is not valid, you should receive a relevant error and not something about pdfLaTeX, which is only in the last step, for producing the PDF output. So, as usual, make sure you're using the latest version of MarkDoc, currently 3.6.7. Based on your examples, it seems you're a Microsoft Windows user.

                            Then you're better off trying the paths you are trying to access. The question that I should think about is whether the error is happening inside or outside MarkDoc. The easiest way to figure out is to try to access the file outside MarkDoc to see if the path you have defined is a valid path recognizable by Stata. For example:

                            Code:
                            confirm file "`SavePath'/MarkDoc_slidesPDF.smcl"
                            if Stata does not return an error, it means it has been able to confirm that the file exists in the defined path, which means we should move to the next level of debugging MarkDoc. If it returns an error, however, it means the problem is happening outside MarkDoc. If that is the case, try ti use compound double-quotations and also, put the FULL REAL PATHS here, and not just d:\......\...... so that we can think about all the possible mistakes.
                            Last edited by haghish; 01 Mar 2016, 17:01.

                            Comment


                            • #44
                              Thank you Wbuchanan and Haghish for trying to help me.

                              haghish . Yes I use the latest 3.6.7 version of markdoc.
                              It isn't a filename problem since when I use (before using the log and before the markdoc command)
                              Code:
                              cd "`SavePath'"
                              and not precise any file path in the syntac of markdoc, it works perfectly. I also try the confirm file command and I have no problem.

                              wbuchanan no more success with your quotes.

                              I have no space in my file path :

                              Code:
                              local SavePath "d:/CATI"
                              depending on the syntax inside the markdoc command, I consider, I have different messages:

                              Code:
                              . markdoc `SavePath'/MarkDoc_slidesPDF, export(slide) replace
                              (The printer option is not defined, but MarkDoc attempts to access pdfLaTeX automatically)
                              
                              (warning! pdfLaTeX not found...)
                              MarkDoc could not produce d:/CATI/MarkDoc_slidesPDF.pdf

                              Code:
                              . markdoc "`SavePath'/MarkDoc_slidesPDF", export(slide) replace  
                              (The printer option is not defined, but MarkDoc attempts to access pdfLaTeX automatically)
                              
                              (warning! pdfLaTeX not found...)
                              CATI not found
                              r(111);
                              
                              end of do-file
                              
                              r(111);
                              Code:
                              . markdoc `"`SavePath'/MarkDoc_slidesPDF"', export(slide) replace install
                              (The printer option is not defined, but MarkDoc attempts to access pdfLaTeX automatically)
                              
                              (warning! pdfLaTeX not found...)
                              CATI not found
                              r(111);
                              
                              end of do-file
                              
                              r(111);

                              Comment


                              • #45
                                I'm assuming you have pdfLaTeX installed on your system? At this point my next step would be to use:

                                Code:
                                set tracedepth 2
                                set trace on 
                                command...
                                This should give you an idea of exactly where in the source things are starting to breakdown.

                                Comment

                                Working...
                                X