Examples of RnwWeave


Examples of org.rstudio.studio.client.common.rnw.RnwWeave

   {
      // set concordance value if we need to
      String concordance = new String();
      if (uiPrefs_.alwaysEnableRnwConcordance().getValue())
      {
         RnwWeave activeWeave = rnwWeaveRegistry_.findTypeIgnoreCase(
                                    uiPrefs_.defaultSweaveEngine().getValue());
         if (activeWeave.getInjectConcordance())
            concordance = "\\SweaveOpts{concordance=TRUE}\n";
      }
      final String concordanceValue = concordance;
    
      // show progress
View Full Code Here

Examples of org.rstudio.studio.client.common.rnw.RnwWeave

         boolean sweave =
            fileType_.canCompilePDF() ||
            fileType_.canKnitToHTML() ||
            fileType_.isRpres();
        
         RnwWeave rnwWeave = compilePdfHelper_.getActiveRnwWeave();
         final boolean forceEcho = sweave && (rnwWeave != null) ? rnwWeave.forceEchoOnExec() : false;
        
         // NOTE: we always set echo to true for knitr because knitr doesn't
         // require print statements so if you don't echo to the console
         // then you don't see any of the output
        
View Full Code Here

Examples of org.rstudio.studio.client.common.rnw.RnwWeave

   // request for chunk options
   public void getChunkOptions(
                   final ServerRequestCallback<RnwChunkOptions> requestCallback)
   {
      // determine the current rnw weave type
      final RnwWeave rnwWeave = getActiveRnwWeave();
      if (rnwWeave == null)
         return;
     
      // look it up in the cache
      if (chunkOptionsCache_.containsKey(rnwWeave.getName()))
      {
         requestCallback.onResponseReceived(
                                    chunkOptionsCache_.get(rnwWeave.getName()));
      }
      else
      {
         server_.getChunkOptions(
            rnwWeave.getName(),
            new ServerRequestCallback<RnwChunkOptions>() {
               @Override
               public void onResponseReceived(RnwChunkOptions options)
               {
                  chunkOptionsCache_.put(rnwWeave.getName(), options);
                  requestCallback.onResponseReceived(options);
               }

               @Override
               public void onError(ServerError error)
View Full Code Here

Examples of org.rstudio.studio.client.common.rnw.RnwWeave

      }
   }
  
   public void ensureRnwConcordance()
   {
      RnwWeave rnwWeave = getActiveRnwWeave();
      if ( (rnwWeave != null) && rnwWeave.getInjectConcordance())
      {
         if (!hasConcordanceDirective(docDisplay_.getCode()))
         {   
            InputEditorSelection doc = docDisplay_.search(
                                          "\\\\begin{document}",
View Full Code Here

Examples of org.rstudio.studio.client.common.rnw.RnwWeave

            }
         }
      }
  
      // for Rnw we first determine the RnwWeave type
      RnwWeave rnwWeave = null;
      RnwWeaveDirective rnwWeaveDirective = null;
      if (fileType.isRnw())
      {
         rnwWeaveDirective = detectRnwWeaveDirective(magicComments);
         if (rnwWeaveDirective != null)
         {
            rnwWeave = rnwWeaveDirective.getRnwWeave();
            if (rnwWeave == null)
            {
               // show warning and bail
               display.showWarningBar(
                  "Unknown Rnw weave method '" + rnwWeaveDirective.getName() +
                  "' specified (valid types are " +
                  rnwWeaveRegistry_.getPrintableTypeNames() ")");
              
               return;
            }   
         }
         else
         {
            rnwWeave = rnwWeaveRegistry_.findTypeIgnoreCase(
                                    prefs_.defaultSweaveEngine().getValue());
         }    
      }
           
      
      final SessionInfo sessionInfo = session_.getSessionInfo();
      TexCapabilities texCap = sessionInfo.getTexCapabilities();

      final boolean checkForTeX = fileType.canCompilePDF() &&
                                  !texCap.isTexInstalled();
     
      final boolean checkForRnwWeave = (rnwWeave != null) &&
                                       !texCap.isRnwWeaveAvailable(rnwWeave);
                                
      if (checkForTeX || checkForRnwWeave)
      {
         // alias variables to finals
         final boolean hasRnwWeaveDirective = rnwWeaveDirective != null;
         final RnwWeave fRnwWeave = rnwWeave;
        
         server_.getTexCapabilities(new ServerRequestCallback<TexCapabilities>()
         {
            @Override
            public void onResponseReceived(TexCapabilities response)
            {
               if (checkForTeX && !response.isTexInstalled())
               {
                  String warning;
                  if (Desktop.isDesktop())
                     warning = "No TeX installation detected. Please install " +
                               "TeX before compiling.";
                  else
                     warning = "This server does not have TeX installed. You " +
                               "may not be able to compile.";
                  display.showWarningBar(warning);
               }
               else if (checkForRnwWeave &&
                        !response.isRnwWeaveAvailable(fRnwWeave))
               {
                  String forContext = "";
                  if (hasRnwWeaveDirective)
                     forContext = "this file";
                  else if (sessionInfo.getActiveProjectFile() != null)
                     forContext = "Rnw files for this project";
                  else
                     forContext = "Rnw files";
                 
                  display.showWarningBar(
                     fRnwWeave.getName() + " is configured to weave " +
                     forContext + " " + "however the " +
                     fRnwWeave.getPackageName() + " package is not installed.");
               }
               else
               {
                  display.hideWarningBar();
               }
View Full Code Here

Examples of org.rstudio.studio.client.common.rnw.RnwWeave

      RnwWeaveDirective rnwWeaveDirective = detectRnwWeaveDirective(
                         TexMagicComment.parseComments(docDisplay_.getCode()));
      if (rnwWeaveDirective != null)
      {
         RnwWeave rnwWeave = rnwWeaveDirective.getRnwWeave();
         if (rnwWeave != null)
            return rnwWeave.getName();
      }
       
      return rnwWeaveRegistry_.findTypeIgnoreCase(
                           prefs_.defaultSweaveEngine().getValue()).getName();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.