Skip to content

Commit

Permalink
pdf documentation
Browse files Browse the repository at this point in the history
Use pdflatex to create the Doxygen refman.pdf
  • Loading branch information
maitbot committed Oct 15, 2023
1 parent 748b18d commit 52a997d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ find_package(MathJax2)
# Register components
########################################################################
include(GrComponent)
gr_register_component("doxygen" ENABLE_DOXYGEN DOXYGEN_FOUND)
gr_register_component("man-pages" ENABLE_MANPAGES)

########################################################################
# Begin conditional configuration
########################################################################
gr_register_component("doxygen" ENABLE_DOXYGEN DOXYGEN_FOUND)
if(ENABLE_DOXYGEN)
add_subdirectory(doxygen)
endif(ENABLE_DOXYGEN)

gr_register_component("man-pages" ENABLE_MANPAGES)
if(ENABLE_MANPAGES)
add_subdirectory(man)
endif(ENABLE_MANPAGES)
38 changes: 34 additions & 4 deletions docs/doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} top_builddir)
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} abs_top_srcdir)
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} abs_top_builddir)

set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
find_package(LATEX COMPONENTS PDFLATEX)
option(ENABLE_DOXYGEN_PDF "Build Doxygen PDF" OFF)

if(ENABLE_DOXYGEN_PDF AND LATEX_FOUND)
set(HAVE_DOT NO) # Otherwise latex fails on large diagrams
set(enable_pdf_docs YES)
else()
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
set(enable_pdf_docs NO)
endif()

set(enable_html_docs YES)
set(enable_latex_docs NO)
set(enable_xml_docs YES)

if(MATHJAX2_FOUND)
Expand All @@ -35,6 +44,7 @@ set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html)
########################################################################
# Make and install doxygen docs
########################################################################
gr_append_subcomponent("HTML Docs")
add_custom_command(
OUTPUT ${BUILT_DIRS}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
Expand All @@ -44,7 +54,8 @@ add_custom_command(

add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS})

if(ENABLE_DOXYGEN)
if(enable_xml_docs)
gr_append_subcomponent("XML Docs")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gnuradio_docstrings.json
COMMAND
Expand All @@ -56,6 +67,25 @@ if(ENABLE_DOXYGEN)

add_custom_target(gnuradio_docstrings ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gnuradio_docstrings.json)
endif(ENABLE_DOXYGEN)
endif(enable_xml_docs)

install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR})

########################################################################
# Make and install doxygen pdf - without HAVE_DOT, only via latex
########################################################################
if(enable_pdf_docs)
gr_append_subcomponent("PDF Docs")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex
DEPENDS doxygen_target
COMMENT "Generating PDF documentation with latex")

add_custom_target(doxygen_pdf_target ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
DESTINATION ${GR_PKG_DOC_DIR})
endif()
3 changes: 2 additions & 1 deletion docs/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,8 @@ LATEX_OUTPUT = latex
# generating bitmaps for formulas in the HTML output, but not in the
# Makefile that is written to the output directory.

LATEX_CMD_NAME = latex
#LATEX_CMD_NAME = latex
LATEX_CMD_NAME = "\"pdflatex\" -cnf-line=extra_mem_top=12000000 -cnf-line=extra_mem_bot=12000000 -cnf-line=main_memory=12000000"

# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
Expand Down
2 changes: 1 addition & 1 deletion gr-analog/include/gnuradio/analog/fastnoise_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ANALOG_API fastnoise_source : virtual public sync_block
* \param ampl the standard deviation of a 1-d noise process. If
* this is the complex source, this parameter is split
* among the real and imaginary parts:
* <pre>(ampl/sqrt(2))x + j(ampl/sqrt(2))y</pre>
* (ampl/sqrt(2))x + j(ampl/sqrt(2))y
* \param seed seed for random generators. seed = 0 initializes
* the random number generator with the system time.
* \param samples Number of samples to pre-generate. For performance
Expand Down
2 changes: 1 addition & 1 deletion gr-analog/include/gnuradio/analog/noise_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ANALOG_API noise_source : virtual public sync_block
* \param ampl the standard deviation of a 1-d noise process. If
* this is the complex source, this parameter is split
* among the real and imaginary parts:
* <pre>(ampl/sqrt(2))x + j(ampl/sqrt(2))y</pre>
* (ampl/sqrt(2))x + j(ampl/sqrt(2))y
* \param seed seed for random generators. seed = 0 initializes
* the random number generator with the system time.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(fastnoise_source.h) */
/* BINDTOOL_HEADER_FILE_HASH(716bd3e691b8b3dc215d05b0d4f6835d) */
/* BINDTOOL_HEADER_FILE_HASH(d2c812002207d70440e715f15d673f0a) */
/***********************************************************************************/

#include <pybind11/complex.h>
Expand Down
4 changes: 2 additions & 2 deletions gr-analog/python/analog/bindings/noise_source_python.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(noise_source.h) */
/* BINDTOOL_HEADER_FILE_HASH(1225d21c7d3f1525c34938764ac179bf) */
/* BINDTOOL_HEADER_FILE(noise_source.h) */
/* BINDTOOL_HEADER_FILE_HASH(5711fb85be9977ff5de33e6788af1d0f) */
/***********************************************************************************/

#include <pybind11/complex.h>
Expand Down

0 comments on commit 52a997d

Please sign in to comment.