From 6a5c812fb0bbd99af4562f7454bbf331c2754b2b Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Wed, 11 Sep 2019 12:16:16 +1000 Subject: [PATCH] Allow first column heading to overflow --- example.md | 2 +- example.pdf | Bin 12719 -> 12964 bytes example.rtf | 2 +- legalmd/latex_renderer.py | 14 ++++++++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/example.md b/example.md index 759f7a7..3b36983 100644 --- a/example.md +++ b/example.md @@ -28,7 +28,7 @@ This is the *blah blah*. ### 3 Table example -| 1 First column | 2 Second column | +| 1 This is a long column header that will overflow onto multiple lines | 2[4] Second column | |----------------|-----------------| | 1 First row | Foo bar | | 2 Second row | Baz qux | diff --git a/example.pdf b/example.pdf index 200abca909f6a3a11c14af6e134bb69eb8e87dc1..50fdf72d092dad6d1a105a6374b1ada545bab44d 100644 GIT binary patch delta 6591 zcmai%Rb148gTxU5$)y`9X_1gv7FK!*>5!6;5|D0@_`%XFy|DBWN_Usi(k&neNOyPR z-T&_1Z=U919_RC!`Bqwfv#w&pd@3d;k|0e9Wa+6n&kGR#*wWu7)+L8UB?fj$pH0X) zce}m(@~7(8msvXi_{R3$ZME(_35^$T+PW_rQ@zwt8??_hZ)D<0>e<+H8cr#JpjS4+ zg0(RG&3h+PrYyN5V?uH)pRlj)9;uAy5GW5lC)`I&^ z03unO){?fKmR-$KSrFoG?2*aXVaFW6<6WKSG+iV$inE52 zIUY?!q)-`-$0JpET@>qYpY?4#*lo~#Tw?JSSat+Si-}*Md4t4KV6g%c#KNxTYB#QQ z!~0x0Pl;Q;R@llWeVV*$Ta45B_gU5-h=uk%AyXtN+;gy03e&0CrUJp4Lv=fOy~N#AFoagQ!Lu@7ZgH=LEiv^#AMjQ7LnJpUKv^gVj&a{5Xjyq_gB!ZcJLg zJqVwW^Ah!K6aN18Qgq;tcJv(16RBWHUN-w)Ble9nU44RL7sfS9;A@b@3l*tEK;bUQ z&CV+9!;dqSVdGDOp+2b3=g9A6}Upi#3W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hXFbZ$@{&P_xl9v{(ceP(Q@$mEF00DG{REJc4k>zgT`ce zJ)&?m9a9*pu1W$oJqTM@&&4frHP=wCI_K+VnWS}<3`mU7KXO*qBXyHhc-Zndeb$C> z|5~{aw&e!>ju917E5N;1lj-Js@a1e{ zO^?#W>^Umo&fHhHv*Y3)5qC_NO6GYg(X0-Y_*Np}vfd(+5gj5K{#HbK-tVV0GU_Rf zjQnXD?Fjh>iK2!?{+E$xopH)^nrkAJ>C}*@X3aAss&d-$Z9Bbn%}#Hlrs{|#WP^W% z>MmRJ302=r_p+|mO;b0C9~IHttdh;Vh|H2e3Ac1+O)ipN>!jD^sHvOUW2(CvBF09^u+|XolwNPb~h5^UAm`&FovzY^Up6m=5iGbyn6x*iJ1F0=SQ`Y_TCaXC}@W~SXSvyRmTJp?r0 zqQ*38)K)d+%&h=qGn02_TE6-WQ^rEKVo@WgW6@VDjl@F=^4>{0?Ozp>tk{32FJdIS zcaH_3SBiA4cCt?&&dPTCB_sJpAD$FaZ1mx>FXcubuH3Tnf3KL_E-HgfvY#b)NwJA< zEx3N$#W}>RcuI)l2^gQwSLwC-dekJ&DrQw6tXu_j9-o6_;Y}W|M9a>z$!)yI4-UeM zhr4{lQMn4U!$VP4P7V*p^cWBPa33!RrGKnJ^gr!HO5v0FFmXdSLqs$}H8?{vF+@T# zIYKcpMMXnGMKM7#I7BfxG&nFmAUroiL^MJ*I72frL_#t-LNPH#MMFYGF+nmoL@_ut zI53l~F(UyulhH93e@jxr01$-X?vOwrq7ehgOH>Rmf#NC@E04qlI1L-l*5yqG}`;oJo+&;y>8Qw5=F_VjnJUqwz8v~zMcyyP?Te-f*yv7PU e>~Zkg^0CxE$B+\tabucolX-\tabcolsep\relax}', + colx=sum(col.weight for col in token.children[1:]), + colnd=2 * (len(token.children) - 1) + ) + cells1.append(format('\\multicolumn{2}{}{\\bfseries Column