Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #+LATEX_CLASS: article
  2. #+LATEX_HEADER: usepackage{graphicx}
  3.  
  4.  
  5. #+begin_src latex :exports results :results latex
  6. begin{table}
  7. caption{a table that scales to the linewidth}
  8. centering
  9. resizebox{linewidth}{!}{%
  10. begin{tabular}{ll}
  11. A & 1\
  12. B & 2\
  13. end{tabular}}
  14. label{tab:scaled}
  15. end{table}
  16. #+end_src
  17.  
  18. #+LATEX_CLASS: article
  19. #+LATEX_HEADER: usepackage{graphicx}
  20. #+CAPTION: a table that does not scale to the linewidth
  21. #+LABEL: tab:uncaled
  22. | A | 1 |
  23. | B | 2 |
  24.  
  25. #+LATEX_CLASS: article
  26. #+LATEX_HEADER: usepackage{graphicx}
  27. #+CAPTION: a table that does not scale to the linewidth
  28. #+ATTR_LATEX: :math-prefix resizebox{linewidth}{!}{% :math-suffix }
  29. | A | 1 |
  30. | B | 2 |
  31.  
  32. #+LATEX_CLASS: article
  33. #+LATEX_HEADER: usepackage{graphicx}
  34. #+LATEX_HEADER: usepackage{adjustbox}
  35. #+begin_src latex :exports results :results latex
  36. begin{table}
  37. caption{a table that scales to the linewidth}
  38. centering
  39. begin{adjustbox}{width=textwidth}
  40. begin{tabular}{ll}
  41. A & 1\
  42. B & 2\
  43. end{tabular}
  44. end{adjustbox}
  45. label{tab:scaled}
  46. end{table}
  47. #+end_src
  48.  
  49. begin{center}
  50. begin{tabular}{lr}
  51. A & 1\
  52. B & 2\
  53. end{tabular}
  54. end{center}
  55.  
  56. #+begin_table
  57. #+LATEX: caption{Description of table.}
  58. #+LATEX: label{tab:my-table}
  59. #+LATEX: centering
  60. #+LATEX: adjustbox{max width=linewidth}{
  61. #+ATTR_LATEX: :center nil
  62. | A | 1 |
  63. | B | 2 |
  64. #+end_table
  65.  
  66. #+caption: Your table
  67. #+ATTR_LATEX: :environment tabularx :width textwidth :align XX
  68. | A | 1 |
  69. | B | 2 |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement