Announcement

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

  • Updated markstat for handling bibliographic citations

    Thanks to Kit Baum, markstat 2.6 is now available on SSC. To update type -ado update markstat, update-

    This release fixes a breaking change in Pandoc version 2.11, which uses --citeproc instead of --filter pandoc-citeproc to process bibliographies. If you want to use a bibliography you must update markstat and make sure you have installed Pandoc 2.11 or higher. Hat tip to Sam Harper for alerting me to this issue, which also bit Philip Miller.

    The update also moves the injected CSS in HTML output files so it appears after the styles in the default Pandoc template. This allows users to override any style by creating a custom markstat.css file. Hat tip to Sam Stewart for this suggestion.

  • #2
    Dear German,

    I have installed Pandoc and your package.
    Next, I visited your example web page:
    Code:
    https://data.princeton.edu/stata/markdown/wfsx
    https://data.princeton.edu/stata/markdown/wfs.stmd
    and tried to run markstat with the syntax:
    Code:
    markstat using "wfs.stmd" , pdf
    But, during processing I get the following error:
    Code:
    . //_1
    . wfs v011 v110 using cosr02, dhs clear
    command wfs is unrecognized
    r(199);
    Might this be because wfs is a 'fantasy' package used here as an example?
    If so, then wfs.stmd needs some tweaking to be able to create the PDF.
    If not, from where can wfs be installed (using net install wfs, from(http://wfs.dhsprogram.com) will not work)?
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Hi ericmelse. Sorry you had difficulties with this example. It is a paper describing the wfs command. This is a real command that can be installed using net install wfs, from(https://wfs.dhsprogram.com). Note the use of the secure https protocol rather than http, which changed since the paper was published. Once the command is installed, the example should run fine. I have modified the web page introducing this example to note the need to install the wfs command first.

      Comment


      • #4
        Dear German,

        Thank you for your helpful explanation. It solved my problem up to the next issue.
        First, after installing wfs, I got an error that whereis could not be found, another package created by you.
        That was easy to install with the regular command to install Stata packages: ssc install whereis
        But, then, the user has to use whereis to set the location where the pandoc exe can be found while running your do file, like in my case:
        Code:
        whereis pandoc "C:\Program Files\Pandoc"
        markstat using "wfs.stmd" , pdf
        Note that the second line is the command to run your example and then I get the following in Stata's result window:
        Code:
        * results omitted *
        Running Pandoc
        C:\Program Files\Pandoc
        file wfs.pdx not found
        I could not locate wfs.pdx, it is not in the working folder where wfs.do is running from.
        So, further help from you is required.

        Best,
        Eric
        http://publicationslist.org/eric.melse

        Comment


        • #5
          Hi ericmelse. Good to hear we solved one problem. The pdx file is supposed to be created by pandoc. The fact that it was not found suggests pandoc did not run, perhaps because it was not found. Looks like you are running on windows, so the first thing I would try is to tell whereis the full name of the executable, in your case probably something like

          whereis pandoc "c:\program files\Pandoc\pandoc.exe"

          If you are generating a pdf file you will also need to use whereis to record the location of pdflatex to convert latex to pdf. Or you could try generating html first (which needs no other programs) and add the pdf option later.

          The getting started page at https://data.princeton.edu/stata/mar...gettingStarted goes through these steps and provides examples. Hope this helps.

          Comment


          • #6
            Dear German,

            Thank you again for your helpful explanation. I should have visited your 'getting Started' webpage first.
            Indeed, I am running Stata (16.1) on a windows system.
            I can confirm that I am able to generate the html file of the example just fine.

            Next, I corrected the whereis statement for pandoc and that also runs fine now.
            But, my troubles are not over yet. First, I had to install also MiKTeX and I did this with a more recent version from here (version 21.1).
            Next, I included a whereis statement for pdflatex.exe and all seems to run well up to the moment this error is prompted in the command window:
            Click image for larger version

Name:	MiKTeX_21_1_issue_running_with_markstat.png
Views:	1
Size:	9.5 KB
ID:	1590688


            So, my thinking was I really need to use MiKTeX version 2.9 instead.
            Thus, I uninstalled 21.1, rebooted my system and downloaded version 2.9 from here.
            Actually, I used the proTeXt installation package to select the MiKTeX 2.9 installation.
            Next, I ran your example with all the required whereis statements, but, sadly, I get a very similar error in the command window:
            Click image for larger version

Name:	MiKTeX_2_9_issue_running_with_markstat.png
Views:	1
Size:	9.4 KB
ID:	1590689


            Possibly, German, you can write me what I am still doing wrong here.
            Last edited by ericmelse; 22 Jan 2021, 00:05.
            http://publicationslist.org/eric.melse

            Comment


            • #7
              Hi ericmelse. Ok, we are making progress, with markstat and pandoc working fine and an issue with miktex. Looks to me like the amsmath and amssymb packages are not installed. I set up my copy so missing packages are installed automatically. You may find helpful advice at https://miktex.org/howto/miktex-console, including how to install packages manually. Make sure you also have the stata.sty file in the current folder or installed as part of LaTeX. Hope this helps.

              Comment


              • #8
                Dear German. I worked further to try to complete the installation. But I have to admit that after searching on the Internet for more information I am somewhat puzzled. Here is a snapshot of the MiKTeX 2.9 console in which the amsfont and amsmath packages are listed (installed):
                Click image for larger version

Name:	MiKTeX_2_9_issue_running_with_markstat_20210124_3.png
Views:	1
Size:	61.3 KB
ID:	1591142


                The amssymb package is included in the amsfonts package, according to this website. Maybe that information is now obsolete, but, I did use the Updates option (and have set the packages update to Always in the Settings, General tab).
                Nevertheless, my system again fails to find these two packages and complete your Stata syntax:
                Click image for larger version

Name:	MiKTeX_2_9_issue_running_with_markstat_20210124_2.png
Views:	1
Size:	9.5 KB
ID:	1591143


                So, I suppose all of this has nothing to do with Stata, but if you (or anyone else) has a suggestion how I can solve this error, that is much appreciated.
                http://publicationslist.org/eric.melse

                Comment


                • #9
                  Hi ericmelse. I am puzzled too. Unfortunately I can't reproduce the error, as the example runs fine on my system, using the latest markstat and Pandoc. I am not sure what the error message about an extra } means. Googling "Argument of \@fileswith@pti@ns has an extra }." wasn't helpful, other than showing other LaTeX users have run into this issue. I wonder if it has something to do with installing a later version of MiKTeX and then reverting to 2.9. As far as markstat is concerned, the option keep(tex) lets you keep the generated LaTeX file, so you can troubleshoot MiKTeX separately from markstat. I don't know what else to suggest.

                  Comment


                  • #10
                    OK German, thank you again. I will experiment further with a clean installation on another system and report about that if it makes a difference.
                    http://publicationslist.org/eric.melse

                    Comment


                    • #11
                      Hi German Rodriguez, hopefully it is okay to resurrect this old post with a relevant reply.

                      I am getting the "file *.pdx not found" error message when attempting to include a bibliography in markstat-generated LaTeX PDF; I can produce PDFs from markstat without bibliographies, however.

                      I noticed that if I use the keep option the *.pdx file is generated in the same directory as my *.stmd file, so I tried running markstat, keep without the bib option and then running again with, but I still get the "*.pdx not found" error. I watched the directory in Visual Studio Code and it looks like the *.pdx file is being deleted (maybe overwritten?) just before the error message. I am using the latest version of Pandoc, Pandoc 3.1, the latest version of markstat on ssc, and basic MikTeX 22.10 with all packages updated. markstat, pdf works perfectly without the bib option.
                      Last edited by Andrew Padovani; 05 Mar 2023, 16:54.

                      Comment


                      • #12
                        Hi Dr German Rodriguez. is there any option/command for stmd file to automatically include multiple "pictures and text lines " through loop function please? some thing like
                        sysuse auto, clear foreach var in price mpg weight { scatter `var' mpg local graph_name "scatter_`var'.png" graph export graph_name_`var', replace display "Scatter Plot of `var' vs MPG" display "![Scatter Plot of `var' vs MPG](graph_name_`var')" } Could the two display code lines be automatically rendered as markdown command and inserting the text line and pictures in output when running the markstat file? currently I have to write the text line and insert a picuture using ![]() one by one . it is ok for 3 variables, but not very efficient for 30+ variables. any help please? Boliang thanks for help.

                        Comment

                        Working...
                        X