Guest User

Untitled

a guest
May 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. begin{equation}
  2. A =
  3. begin{bmatrix}
  4. pgfplotsforeachungrouped m in {1,...,3}
  5. {
  6. pgfplotsforeachungrouped n in {1,...,3}
  7. {
  8. a_{m,n} &
  9. } \
  10. }
  11. end{bmatrix}
  12. end{equation}
  13.  
  14. documentclass{article}
  15. usepackage{amsmath,bm}
  16. usepackage{xparse}
  17.  
  18. ExplSyntaxOn
  19.  
  20. NewDocumentCommand{symbolicmatrix}{O{#2}mm}
  21. {% #1 = optional number of rows (default square)
  22. % #2 = number of columns
  23. % #3 = symbol to repeat
  24. scumcoder_matrix:nnn { #1 } { #2 } { #3 }
  25. }
  26.  
  27. tl_new:N l__scumcoder_matrix_body_tl
  28.  
  29. cs_new_protected:Nn scumcoder_matrix:nnn
  30. {
  31. tl_clear:N l__scumcoder_matrix_body_tl
  32. int_step_inline:nnnn { 1 } { 1 } { #1 }
  33. {
  34. int_step_inline:nnnn { 1 } { 1 } { #2 - 1 }
  35. {
  36. tl_put_right:Nn l__scumcoder_matrix_body_tl { #3sb{##1 ####1} & }
  37. }
  38. tl_put_right:Nn l__scumcoder_matrix_body_tl { #3sb{##1 #2} \ }
  39. }
  40. begin{bmatrix}
  41. tl_use:N l__scumcoder_matrix_body_tl
  42. end{bmatrix}
  43. }
  44.  
  45. ExplSyntaxOff
  46.  
  47. begin{document}
  48.  
  49. [
  50. frac{d}{dt}
  51. begin{bmatrix}
  52. bm{varepsilon} \
  53. dot{bm{varepsilon}} \
  54. bm{rho}
  55. end{bmatrix}
  56. =
  57. symbolicmatrix{3}{mathbf{F}}
  58. begin{bmatrix}
  59. bm{varepsilon} \
  60. dot{bm{varepsilon}} \
  61. bm{rho}
  62. end{bmatrix}
  63. ]
  64.  
  65. [
  66. symbolicmatrix[2]{4}{a}
  67. ]
  68.  
  69. end{document}
Add Comment
Please, Sign In to add comment