Code Only (No Results in Appendix)

Introduction

This document demonstrates show-output-results: false, which includes only code in the appendix without execution results.

This is useful when you want readers to see output inline but have a clean code reference at the end.

Python Example

Let’s do some calculations:

print("Hello from Python!")
Hello from Python!
result = 2 + 2
print(f"2 + 2 = {result}")
2 + 2 = 4

The output appears above inline, but won’t be repeated in the appendix.

R Example

Some R calculations:

# Create a vector
numbers <- c(1, 2, 3, 4, 5)
print(paste("Sum:", sum(numbers)))
[1] "Sum: 15"
print(paste("Mean:", mean(numbers)))
[1] "Mean: 3"

Conclusion

In the Code Appendix at the end, you’ll see:

  • All code blocks grouped by language
  • No execution results/output (because show-output-results: false)

This creates a cleaner code reference while keeping output visible inline for understanding.


Code Appendix

Python

print("Hello from Python!")
result = 2 + 2
print(f"2 + 2 = {result}")

R

# Create a vector
numbers <- c(1, 2, 3, 4, 5)
print(paste("Sum:", sum(numbers)))
print(paste("Mean:", mean(numbers)))