Guest User

sample_1.md

a guest
Aug 24th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. ---
  2. title: Boilerplating Pandoc for Academic Writing
  3. subtitle: or How I Learned to Stop Typesetting and Concentrate on the Math
  4. author: Mort Yao
  5. date: 17 November 2016
  6. abstract: |
  7. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  8. sed do eiusmod tempor incididunt ut labore et dolore magna
  9. aliqua. Ut enim ad minim veniam, quis nostrud exercitation
  10. ullamco laboris nisi ut aliquip ex ea commodo consequat.
  11. ---
  12.  
  13. # Introduction
  14.  
  15. This is a sample [GitHub style markdown](https://github.github.com/gfm/) file.
  16. Top level headers are chapters and other headings are for sub-sections.
  17.  
  18. # Python
  19.  
  20. * Lists are declared within `[]` and elements are separated by `,`
  21. * Each element can be of any data type, including list data type
  22.  
  23. ## Example
  24.  
  25. Use `for` loop to iterate over a list.
  26.  
  27. ```python
  28. numbers = [2, 12, 3, 25, 624, 21, 5, 9, 12]
  29. odd_numbers = []
  30. even_numbers = []
  31.  
  32. for num in numbers:
  33. odd_numbers.append(num) if(num % 2) else even_numbers.append(num)
  34.  
  35. print(f'numbers: {numbers}')
  36. print(f'odd_numbers: {odd_numbers}')
  37. print(f'even_numbers: {even_numbers}')
  38. ```
  39.  
  40. # Ruby
  41.  
  42. * Arrays are declared within `[]` and elements are separated by `,`
  43. * Each element can be of any data type, including array data type
  44.  
  45. ## Example
  46.  
  47. Use `each` method to iterate over an array.
  48.  
  49. ```ruby
  50. numbers = [2, 12, 3, 25, 624, 21, 5, 9, 12]
  51. odd_numbers = []
  52. even_numbers = []
  53.  
  54. numbers.each { |n| n.even? ? even_numbers.append(n) : odd_numbers.append(n) }
  55.  
  56. puts "numbers: #{numbers}"
  57. puts "odd_numbers: #{odd_numbers}"
  58. puts "even_numbers: #{even_numbers}"
  59. ```
  60.  
  61. # CLI
  62.  
  63. Executing the Python and Ruby programs mentioned in previous chapters:
  64.  
  65. ```bash
  66. $ python3.7 list_looping.py
  67. numbers: [2, 12, 3, 25, 624, 21, 5, 9, 12]
  68. odd_numbers: [3, 25, 21, 5, 9]
  69. even_numbers: [2, 12, 624, 12]
  70.  
  71. $ ruby array_looping.rb
  72. numbers: [2, 12, 3, 25, 624, 21, 5, 9, 12]
  73. odd_numbers: [3, 25, 21, 5, 9]
  74. even_numbers: [2, 12, 624, 12]
  75. ```
  76.  
  77. # Conclusion
  78.  
  79. This sample file helps you see a demo for `markdown` to `pdf` conversion using `pandoc`.
Add Comment
Please, Sign In to add comment