Embedding math into Doxygen docs - formula

I am sending a test case where the second
"\f$" item is replaced with the previous "\f["
(using 1.8.13)
(It could be some temporary filename issue:
the replacement can also be some fragment that already gone)
/*!
* \f[
* \frac{dV_m}{dt} = \sum_{i=0}^{n} g{sin,i}(t)\frac{E_{sin,i}-V_{m}}{C} + \frac{V_{rest}-V_{m}}{RC}
* \f]
* The routine replaces \f$ dt \f$ with \f$ \Delta t \f$
*/

Doxygen 1.8.13 is from December 2016, the current version is 1.8.20.
The question lacks very important information: what is the problem, which output format is used, which other doxygen settings are used.
Seen this it is hard to tell what goes wrong but some ideas.
Version 1.8.13 might have problems with newer versions of LaTeX (like giving: Error: /undefinedfilename in (_form0.ps)).
Solutions for this:
use MathJax for rendering formulas (in HTML), by setting USE_MATHJAX=YES
upgrade to a newer version of doxygen
downgrade the LaTeX version

Related

R CMD check note: Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’

How to avoid the following NOTE that is appearing in R CMD check with the new R development version ( R Under development (unstable) (2017-02-15 r72179))?
• checking for unstated dependencies in examples ... OK
• checking line endings in C/C++/Fortran sources/headers ... OK
• checking compiled code ... NOTE
File ‘pkgname/libs/pkgname.so’:
Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
It is good practice to register native routines and to disable symbol
search.
For example in Hmisc
The message is somewhat arcane. I looked around also in other packages and I found that the useDynLib(packagename) in the NAMESPACE file was replaced by useDynLib(packagename, .registration = TRUE).
In addition, I added a .c file, named registerDynamicSymbol in the src/ directory with the following code:
// RegisteringDynamic Symbols
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void R_init_markovchain(DllInfo* info) {
R_registerRoutines(info, NULL, NULL, NULL, NULL);
R_useDynamicSymbols(info, TRUE);
}
I took this suggestion from GitHub Rcpp. The canonical reference is in Writing R Extensions
Also R Devel Mailinglist provided supplementary infos.
UPDATE
The most direct straightforward approach is:
use the current R Development Version (that will eventually become 3.4)
Run the tools::package_native_routine_registration_skeleton(".") and copy and paste the full output in a packagename_init.c file to be put in src/
update NAMESPACE, verifying that useDynLib(packagename, .registration = TRUE)
If necessary, replace the exportPattern with export( list of object to be exported )
UPDATE 18th July
As noted by #Symbolix using the most recent version of R and RStudio's devtools the point 2. (init.c files) appears handled by either devtools (using RStudio check digit) or tools packages.
I ran into a persistent issue with a Windows build package. (.dll instead of .so)
The accepted answer above should also resolve this issue for Windows, but if it does not resolve it. Make sure that objdump.exe is pointing the appropriate arch. i.e. .../Mingw_64/bin/objdump.exe. This can be checked from a command prompt with which objdump.exe. Somehow a 32-bit objdump.exe found its way into a higher priority position in my path. This arch mismatch will produce a File format not recognized error.
First I did exactly what Giorgio Spedicato says. But still got NOTE warnings. Finally I got problem solved by doing this:
Sys.setenv(PATH = paste(Sys.getenv("PATH"),
"C:\RTools40",
"C:\RTools40\mingw64\bin",
sep = ";"))
Have to add mingw64\bin to PATH because that's where objdump.exe is located

errors compiling lyx 2.1.2 document with Lyx 2.1.3

I have a Lyx document created with Lyx 2.1.2 on Windows 7 and everything compiles well.
After upgrading to Lyx 2.1.3 the same document gives many errors when compiled.
I noticed that they are related to floating figures, for example uder view source I can see:
**
Figure \ref{fig:ErasOfComputingWant (2010)} adopted from \citep{Want2010}
illustrates conceptually three eras of modern computing.
The Internet of Things initially thought of as connecting things to
the Internet for the purpose of remote monitoring and control it is
now moving into the concept of ubiquitous and pervasive computing
as it creates an intelligent, invisible network fabric that can be
sensed, controlled and programmed.
\begin{figure}[th]
\begin{centering}
\includegraphics[scale=0.5]{Images/0-ComputingEras}
\par\end{centering}
\protect\caption{Three eras of modern computing, source\citep{Want2010}{\footnotesize{}\label{fig:ErasOfComputingWant (2010)}}{\footnotesize \par}}
\end{figure}
**
The Lyx 2.1.3 gives corresponding errors:
*****Runaway argument?
{Three eras of modern computing, source\citep {Want2010}{\footnotesize \ETC.
! Paragraph ended before \NR#gettitle was complete.
<to be read again>
\par
l.283 ...mputingWant (2010)}}{\footnotesize \par}}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
! Extra }, or forgotten \endgroup.
<argument> ...gWant (2010)}}{\footnotesize \par }}
l.283 ...mputingWant (2010)}}{\footnotesize \par}}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.*****
How to fix it?
Jan
Thanks for your help, although my thoughts are that maybe the Lyx version 2.1.3 should be removed from the Lyx download section as problematic. At least I am not able to use it and I stay with 2.1.2

How do I add a Changelog or NEWS file to my R package?

I have a package on CRAN that I would like to add a ChangeLog for, but I cannot find information anywhere on how to do this.
I looked on the "Writing R Extensions" document that CRAN provides, but it only mentions ChangeLogs and gives no direction (I could find) about how to create one.
I noticed from downloading tarballs from other packages on CRAN (e.g. seacarb) that their ChangeLogs are Unix Executable Files (I'm on a Mac) so that's not too helpful.
I imagine this is a common problem, but Googling "changelog R package" just brings up ChangeLogs for really popular packages...
You can either provide a NEWS file or a ChangeLog file, or both, to describe changes in your package. You have to add these files in the top level folder of your project, i.e. in the same folder as your DESCRIPTION and NAMESPACE.
This is documented in the R package manual in paragraph 1.1 Package structure. In particular, this paragraph points to the GNU standard:
For the conventions for files NEWS and ChangeLog in the GNU project see http://www.gnu.org/prep/standards/standards.html#Documentation.
Hadley points out that "Generally you should use a NEWS file, and not ChangeLog. I think the purpose of ChangeLog (to list every change), has been subsumed by source code control".
To create a NEWS file, simply create a text file called NEWS in the top level folder of your package. You maintain this file by hand.
Here is an extract from the NEWS file from my package miniCRAN (CRAN link):
miniCRAN v0.0-21 (Release date: 2014-08-18)
==============
Changes:
* Changes to defaults in plot.pkgDepGraph() to move legend to left of plot area.
miniCRAN v0.0-20 (Release date: 2014-08-18)
==============
Changes:
* Modified examples to reduce running time, mostly using \dontrun{} sections
NEWS.md files are now also supported by CRAN (Which renders them as html) and more recently by the news() function.
https://cran.r-project.org/doc/manuals/r-devel/NEWS.html
If you are following this and opting for NEWS.md then make sure news() reads the same correctly (at the same time it looks great on GitHub).
You can do the same in your local builds of the packages.
It seems like it has a specific format you have to adhere with.
I tried like this (and it works) (check here)
# *News*
# tidycells 0.1.9 (2019-07-31)
## Initial Submission
* **CRAN** Initial Submission
# tidycells 0.1.5 (2019-07-30)
## Final Codebase Release in GitHub
* Final Release in GitHub for **CRAN** Submission
* Only Minor Documentation Change after this and before next **CRAN** Submission
# tidycells 0.1.0 (2019-07-25)
## Initial Release to GitHub
* Initial Release to GitHub
* Prior to this it was private package

GNAT Programming Suite: Cross-Reference Info Not Up To Date (this is a guess)

I'm trying to get package references resolved during a build, using GNAT Programming Suite (hosted on Win XP). In the Builder Results, I get errors like this one:
file "ac_configuration_s.ada" not found
Clicking on the error takes me to a line like this:
with
Ac_Configuration,
Dispense_Timer,
...
The first item (Ac_Configuration) isn't resolved, but the second item (Dispense_Time) is resolved. I have several others that do or don't resolve. All of the files in question (spec and body) are identified as source files.
When I hover my mouse over the line with the error, a popup shows up that offers this:
(Cross-references info not up to date. This is a guess.)
Ac_Configuration
local package declared at D_Ac_Config_S.Ada:85
The guess is correct, but I don't know how to use this. How do I get this to correctly build?
Update
Here is teh call to gcc
gcc -c "-gnatec=C:\Source\build\GNAT-TEMP-000001.TMP" -I- -gnatA
-x ada "-gnatem=C:\Source\build\GNAT-TEMP-000002.TMP" "C:\Source\C_Cbt_Main_B.Ada"
I don't see a reference to teh "miimal" switch.
In this case, there is no corresponding body file file D_Ac_Config_S.Ada. So the is no body file to compile separately.
When I right click on the package reference inside the with, I can goto the declaration of Ac_Configuration and every other package name that is the source of an error. So these lreferences are being resolved somehow.
By the way, I have not used ADA before, so I'm still trying to understand everything.
It looks as though you're using _s.ada as the suffix for specs, and I'm guessing _b.ada for bodies?
GNAT may have difficulty with this naming convention. It's possible, using a GNAT Project file (.gpr), to alter GNAT's default convention ({unit-name}.ads for specs, {unit-name}.adb for bodies) but the rules (see "Spec_Suffix") say "It cannot start with an underscore followed by an alphanumeric character" (I haven't tried this, but you can see that it would confuse the issue if you had a package Foo_S, for example).
LATER: It turns out that GNAT (GPL, 4.7, 4.8) is quite happy with your suffixes!
If the package Ac_Configuration is really a local package declared at line 85 of D_Ac_Config_S.Ada, then there's your problem; you can only with a library unit, which in this case would be D_Ac_Config.
with D_Ac_Config;
...
package Foo is
...
Bar : D_Ac_Config.Ac_Configuration.Baz;
I wonder whether D_Ac_Config_S.Ada (for example) actually contains multiple Ada units? (if so, compiling that file should result in a compilation error such as end of file expected, file can have only one compilation unit). GNAT doesn't support this at compile time, providing instead a utility gnatchop.
Would it be possible to just gnatchop all the source and be done with it?
Hm, I think it sounds like the compiler's got a bad set of objects/ALIs it's working with, hence the cross-reference not up to date error. (Usually the compiler's good about keeping things up to date; but you may want to check to see if the "minimal recompilation" switch is set for the project.)
Have you tried compiling just the ["owning"] file D_Ac_Config_S.Ada? (i.e. if it were a spec, go to the corresponding body and compile that.) That should force its ALI/object files to be updated.
Then try building as normal.
-- PS: you might have to clean first.

Geshi syntax highlighting for the R programming language

Does Geshi support the R programming language?
This table (Geshi for MediaWiki) does not list R, so I guess the answer is no, but I just wanted to check. Is there any programming language with a similar sintax that could help highlight, at least partially, the syntax of an R script/function?
Thanks
Edit
rsplus was removed from the table linked to by the OP on 14 April with the commit note: Not supported by this installation.
Not sure what that means, but Geshi has supported R in the past, though I note it is not listed on the Geshi website front page. It was added to Geshi in version 1.0.8.5 (as indicated from the CHANGES file (snippet thereof):
Version 1.0.8.5
- Added language files
* AutoHotkey (Naveen Garg)
* Awk (George Pollard)
* GADV 4CS (Jason Curl)
* jQuery (Rob Loach)
* PowerBuilder (Doug Porter)
* PureBasic (Gustavo Julio Fiorenza)
* R / S+ (Ron Fredericks, Benilton Carvalho)
....
And there is no indication it was removed at a later date.
So it appears Geshi itself supports R, but perhaps the Mediawiki plugin doesn't yet?
Original
You did read the list fully, didn't you? ;-)
It is listed in the second column under the moniker rsplus.

Resources