logo

LATEKSA GALDS

Tabulas ir kopīga iezīme, ko izmanto akadēmiskajā rakstniecībā. Šajā tēmā ir izskaidrotas darbības, lai izveidotu tabulu un veiktu dažādas funkcijas tabulā. Tabulas ir efektīvs veids, kā attēlot informāciju, un tās bieži izmanto lielākajā daļā dokumentu vai failu. Apspriežot zinātniskos darbus, datu atspoguļošanai tiek izmantotas tabulas.

Tabulas izveide lateksā ir nedaudz sarežģīta salīdzinājumā ar citiem. Bet šeit soļi un process, lai izveidotu tabulu no pamatiem, atvieglos procesu.

Latekss nav izklājlapa, bet tas ir īpašs rīks tabulu veidošanai un šo tabulu eksportēšanai uz jūsu dokumentu.

Lateksa tabulas ir izveidotas ar kombināciju a tabulas veidā vide un tabula vidi. Tabulu vidēs ir ietverts faktiskais tabulas saturs, savukārt citās vidēs ir ietverts paraksts.

Komandas, ko izmanto, lai izveidotu tabula vide ir:

egin{table}{ kur }

Tabula

eigu tabula}

Komandas, ko izmanto, lai izveidotu tabulas veidā vide ir:

egin{tabular}{lcr}

Tabula

end{tabular}

Šeit tabula apzīmē tabulas vidi kopā ar paraksts komandu. Komanda kur tiek izmantots, lai noteiktu tabulas atrašanās vietu. Piemēram, egin{table}{t} nozīmē, ka tabula parādīsies pie tops no lapas.

Tabulu vide izmanto & (& zīmes) simbols kolonnu atdalīšanai.

Burti, kas izmantoti satura pielīdzināšanai kreisais, centrs un labais ir l , c , un r katrai kolonnai. Izlīdzināšanai nodotā ​​komanda ir egin{tabular}{l c r}.

Komanda, ko izmanto, lai zīmētu vertikālas līnijas, kas atdala tabulas kolonnas, ir egin{tabular}l, kur ( | ) tiek pieņemts kā arguments. The | simbolu izmanto, lai novilktu vertikālās līnijas starp kolonnām.

Varat arī izmantot vline komanda zīmēt vertikālas līnijas. The vline komanda zīmē vertikālo līniju kopā ar rindas augstumu.

Ja mēs vēlamies uzzīmēt horizontālu līniju kā rindu atdalītāju, mēs varam izmantot māls komandu.

Komanda cline{ i-j } tiek izmantots, lai uzzīmētu daļēju horizontālu līniju, kas sākas ar i un beidzas ar j .

Apskatīsim dažus tabulas piemērus, izmantojot iepriekš aprakstītās komandas.

1.

 documentclass{article} egin{document} egin{center} TABLE end{center} egin{tabular}{lcr} a&b&c\ d&e&f\ g&h&i end{tabular} end{document} 

Izvade:

Lateksa GALDS

2.

 documentclass{article} egin{document} egin{center} egin{tabular}c hline a&b&c\ hline d&e&f\ hline g&h&i\ hline end{tabular} end{center} end{document} 

Izvade:

Lateksa GALDS

3.

 documentclass{article} egin{document} egin{tabular}r hline I, II, III, IV...& uppercase Roman i, ii, iii... & lowercase roman numerals \ cline{2-2} 1, 2, 3.. & Arabic format \ hline hline 1684 & decimal digits \ hline end{tabular} end{document} 

Izvade:

Lateksa GALDS

Tagad skatiet tālāk norādīto kodu, lai izveidotu pamata tabulu:

4.

 documentclass{article} egin{document} egin{table}[h!] egin{center} caption{ the basic table} label{tab:Table1} egin{tabular}r 	extbf{heading 1} & 	extbf{heading 2} & 	extbf{heading 3}\ $alpha$ & $eta$ & $gamma$ \ hline 1 & 1.34 & a\ 2 & 18.54 & b\ 3 & 735.765231 & c\ end{tabular} end{center} end{table} end{document} 

Paskaidrojums:

    labelkomanda tiek izmantota kā tabulas marķieris vai tabulas marķieris. parakstsir iekļauts pašā tabulā.

Vietā egin{center}… end{center}, uz centrēšana var izmantot komandu document able sākumā.

Izvade:

Lateksa GALDS

Apvienotās rindas un kolonnas

Apvienotajām kolonnām multicolumn{ uz viena }{ kol }{ tekstu } tiek izmantota komanda. The uz viena komanda tiek izmantota, lai apvienotu uz viena kolonnas vienā kolonnā kopā ar platumu. Komanda kol satur simbolus l, c vai r. The tekstu satur kolonnas saturu.

Kombinētajām rindām aisedbox{ lifts }{ tekstu } tiek izmantota komanda. Tas izdrukā tekstu , kas ir paaugstināts virs pašreizējās bāzes līnijas par summu lifts . Vienai atstarpei starp rindām [-lex] tiek izmantota komanda. Dubultajai atstarpei starp pirmo un otro rindu [1ex] tiek izmantota komanda.

Varat arī līdzināt daudzas identiskas kolonnas, izmantojot *{number} sintakse . Tas ir noderīgi, ja jūsu tabulā ir daudz kolonnu. Komanda tiks uzrakstīta šādi:

egin{tabular}{1*{6}{c}r}

Apskatīsim piemēru. Kods ir uzrakstīts zemāk:

 documentclass{article} egin{document} egin{table}[h] caption{Marks after exams} % title name of the table centering % centering table egin{tabular}{l c c rrrrrrr} % creating 10 columns hlinehline Subject &No. of Students &category &multicolumn{7}{c}{the list of marks} \ [0.5ex] hline % Entering 1st row & &lowest &43 & 34 & 65 & 41 & 33 & 46 & 51 \[-1ex] 
aisebox{1.5ex}{Science} & 
aisebox{1.5ex}{32}&highest & 88 & 94 & 93 & 89 & 91 & 90 & 88 \[1ex] % Entering 2nd row & &lowest & 41 & 33 & 42 & 35 & 36 & 40 & 31 \[-1ex] 
aisebox{1ex}{Maths} & 
aisebox{1.5ex}{32}& highest &87 & 89 & 87 & 98 & 96 & 94 & 90 \[1ex] % Entering 3rd row & &lowest & 43 & 41 & 37 & 34 & 39 & 41 & 44 \[-1ex] 
aisebox{1ex}{English} & 
aisebox{1.5ex}{32}& highest &79 & 87 & 85 & 91 & 84 & 83 & 90 \[1ex] % [1ex] adds vertical space hline % inserts single-line end{tabular} end{table} end{document} 

Izvade:

Lateksa GALDS

Varat arī mainīt režīmu uz ainava režīmā, izmantojot usepackage{adjustbox} komandu.

Tabula šeit sākas ar egin{adjustbox} un beidzas ar beigas{adjustbox}.

Apskatīsim vienkāršu tabulas piemēru, lai to saprastu.

Kods ir norādīts zemāk:

 documentclass{article} usepackage{adjustbox} egin{document} egin{adjustbox}{angle=90} egin{tabular}l 	extbf{heading 1} & 	extbf{heading 2} & 	extbf{heading 3}\ $alpha$ & $eta$ & $gamma$ \ hline 1 & 11.34 & a\ 2 & 10.5 & b\ 3 & 765.5231 & c\ end{tabular} end{adjustbox} end{document} 

Izvade:

Lateksa GALDS

Piemēram, ja mēs iestatām leņķi uz 150 grādiem tajā pašā kodā, kā minēts iepriekš, izvade izskatīsies kā zemāk redzamais attēls:

Lateksa GALDS

Tālāk ir izskaidrotas dažas biežāk lietotās komandas, ko izmanto tabulas izveidošanai:

    masīvs: tiek pievienotas kolonnas m {< platums >} un b {< platums >} līdzīgi lpp komanda, bet vertikāli līdzināta centrā vai apakšā.bookstab: nodrošina radošas komandas horizontālai līnijai ar atstarpi augšā un apakšā.tabularx: ievada kolonnas veidu X , kas darbojas kā komanda p- ar automātisku platuma aprēķināšanas līdzekli. aggedright: tiek atpazīts kā tabulas rindu beigas. abularnewline: šī komanda tiek izmantota vietā \. arraybackslash: To izmanto atjaunošanas procesā.

Priekš atstarpe starp kolonnām uz setlength{ abcolsep}{5pt} tiek izmantota komanda. Noklusējuma izmērs ir 6 punkti . Šī komanda tiek ievietota starp kolonnām atstarpēm.

Priekš atstarpe starp rindām , arraystretch tiek izmantota komanda.

Teksta ietīšana tabulās

Lateksa algoritmiem ir daži trūkumi. Ja teksts pārsniedz lapas platumu, latekss automātiski nepielāgo/aplauza tekstu. Šim nolūkam īpaša komanda p ( iepriekš noteikts platums ) tiek izmantots, lai iestatītu platumu.

Piemērs ir sniegts zemāk.

Šis piemērs izskaidro gan procesus, kas notiek bez platuma iestatīšanas, gan ar platumu. Jūs varat pamanīt atšķirību starp šīm divām metodēm.

  • Pirmais process (nenorādot platumu}

Kods ir norādīts zemāk:

 documentclass{article} egin{document} Without specifying the width. egin{center} egin{tabular} l hline Name &amp; Type &amp; popular in &amp; Explanation \ hline Orange &amp; Fruit &amp; Vitamin C &amp; It is fruit, which is full of nutrients and low in calories. They can promote clear, healthy skin and also lowers the risk for many diseases. It reduces cholesterol and also helps in building a healthy immune system.\ hline Cauliflower &amp; vegetable &amp; B-Vitamins &amp; It is the vegetable, which is high in fiber and B-Vitamins. It also provides antioxidants, which help in fighting or protect against cancer. It enhances digestion and has many other nutrients.\ hline end{tabular} end{center} end{document} 

Izvade:

Lateksa GALDS

Var pamanīt, ka informācija netiek rādīta, jo nav norādīts platums.

  • Tagad apsveriet otro procesu, kurā platums tiek norādīts, izmantojot lpp Kods ir norādīts zemāk:
 documentclass{article} egin{document} specifying with the width. egin{center} egin{tabular}{ | l | l | l | p{5cm} |} % you can change the dimension according to the spacing requirements hline Name &amp; Type &amp; popular in &amp; Explanation \ hline Orange &amp; Fruit &amp; Vitamin C &amp; It is fruit, which is full of nutrients and low in calories. They can promote clear, healthy skin and also lowers the risk for many diseases. It reduces cholesterol and also helps in building a healthy immune system.\ hline Cauliflower &amp; vegetable &amp; B-Vitamins &amp; It is the vegetable, which is high in fiber and B-Vitamins. It also provides antioxidants, which help in fighting or protect against cancer. It enhances digestion and has many other nutrients.\ hline end{tabular} end{center} end{document} 

Izvade:

Lateksa GALDS

Daudzrindu un daudzu kolonnu

To izmanto, lai formatētu datus, kas satur vairākas rindas un kolonnas. Šajā gadījumā vairākas rindas tiek sadalītas apakšrindās, izmantojot vairāku rindu pakotni.

Piezīme:Kolonnu aplaušana vairāku rindu vidē nedarbosies ar izmantoto sintaksi.

Sapratīsim ar piemēru. Kods ir norādīts zemāk:

 documentclass{article} usepackage{multirow} egin{document} egin{table} egin{tabular}{c|lp{1.1in}|lp{1in}|l|} hline Name&amp; Occupation &amp; salary &amp; Children &amp; Savings percentage \hline multirow{3}{*}{Henry}&amp;multirow{3}{*}{$0,000$}&amp;windsurfing&amp;lisa&amp;multirow{3}{*}{20}\ ~&amp;~&amp;jumping on&amp;John&amp;~\ ~&amp;~&amp;a trampoline &amp; tia &amp;~\hline multirow{3}{*}{Shefy} &amp; $multirow{3}{*}{,000} $ &amp;heavy metal music&amp;multirow{3}{*}{Tyra} &amp;15\ ~&amp;~&amp;Paris&amp;~&amp;multirow{2}{*}{12}\ ~&amp;~&amp; dancing with pop music &amp;~&amp;~\hline multirow{3}{*}{Ben} &amp; $multirow{3}{*}{,000}$ &amp;chocolate &amp; multirow{3}{*}{None}&amp;18\ ~&amp;~&amp;fast cars &amp;~&amp;multirow{2}{*}{ 22}\ ~&amp;~&amp;Ramen&amp;~&amp;~\hline multirow{3}{*}{Sam} &amp; $multirow{3}{*}{,000}$ &amp; paintingit&amp;Donal &amp; multirow{3}{*}{11}\ ~&amp;~&amp;motorcycles&amp;multirow{2}{*}{Peter}&amp;~\ ~&amp;~&amp;Reddit&amp;~&amp;~ \ hline end{tabular} end{table} end{document} 

Izvade:

Lateksa GALDS

Varat uzzīmēt tik daudz līniju, izmantojot māls komandu. Apsveriet līdzīgu attēlu kā iepriekš ar vairākām rindām:

Lateksa GALDS

Tabulas ar grāmatu cilnēm

The grāmatu cilnes komanda tiek izmantota, lai padarītu dokumentu daudz profesionālu, jo māls komanda to nedara. Komandas, piemēram, pārvalda , mazais , un apakšnoteikums ko nodrošina bookstab pakotne, tiek izmantoti komandas hline vietā.

Bookstab pakotnes kods ir norādīts zemāk:

 documentclass{article} usepackage{booktabs} % For prettier tables egin{document} egin{table}[h!] egin{center} caption{Table using booktabs.} label{tab:table1} egin{tabular}r 	oprule % Toprule applied here 	extbf{Heading 1} &amp; 	extbf{Heading 2} &amp; 	extbf{Heading 3}\ $alpha$ &amp; $eta$ &amp; $gamma$ \ midrule % Midrule applied here 1 &amp; 1.101 &amp; a\ 2 &amp; 103.145 &amp; b\ 3 &amp; 289.1 &amp; c\ 4 &amp; 17.132114 &amp; d\ ottomrule % Bottomrule applied here end{tabular} end{center} end{table} end{document} 

Izvade:

Lateksa GALDS

Vairāku lappušu tabulas

Ja tabulā ir vairākas rindas, tabula tiks apgriezta no apakšas. Komanda garais galds tiek izmantots, lai izveidotu vairākas lapas, kas jāpievieno iepakojumam.

Nav nekādas nozīmes a tabula vai tabulas veidā komandas, kad garais galds komanda tiek izmantota. Tas aizstāj tabulu un tabulas komandu izmantošanu un apvieno abas vides vienā vidē. Tā vietā tabulām tiek izmantots vides longtable.

Iepriekš minētās tēmas kods ir norādīts zemāk:

 documentclass[12pt]{article} usepackage{longtable} egin{document} egin{center} egin{longtable}c caption{A simple example of longtable}\ hline 	extbf{First heading} &amp; 	extbf{Second heading} &amp; 	extbf{Third heading} &amp; 	extbf{Fourth heading} \ hline endfirsthead multicolumn{4}{c}% {	ablename 	hetable -- 	extit{Continued from previous page}} \ hline 	extbf{First heading} &amp; 	extbf{Second heading} &amp; 	extbf{Third heading} &amp; 	extbf{Fourth heading} \ hline endhead hline multicolumn{4}{r}{	extit{Continued on next page}} \ endfoot hline endlastfoot ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ ab &amp; bc &amp; ac &amp; da \ ef &amp; fg &amp; gh &amp; he \ ij &amp; jk &amp; kl &amp; lj \ mn &amp; no &amp; op &amp; po \ end{longtable} end{center} end{document} 

Paskaidrojums:

    endfirsthead: tā ir rinda, kas pirmajā lapā parādās kā tabulas virsraksts.endhead: rinda, kas parādās katras lapas augšdaļā, izņemot pirmoendfoot: rinda, kas parādās katras lapas apakšā, izņemot pēdējoendlastfoot: tā ir rinda, kas parādās tabulas beigās

Izvade:

sed komanda

Iepriekš minētā koda izvade tiks uzskaitīta divās lapās, kā parādīts zemāk:

Abas lapas ir sadalītas trīs attēlos.

Attēli ir sniegti zemāk:

Lateksa GALDS
Lateksa GALDS

Varat pamanīt, ka tabula tika sadalīta vairākās lapās, izmantojot garais galds kolonnu, nezaudējot datus.

Komata līdzināšana

Tālāk aplūkotajā piemērā izteiksme un atbilstošā vērtība tiks līdzināta tās decimālpunktam.

Kods ir norādīts zemāk:

 documentclass[12pt]{article} egin{document} egin{tabular}{c |r @{.} l} % @{.} is used to display the decimal point expression Pi &amp; multicolumn{2}{c}{corresponding Value} \ hline $pi$ &amp; 3&amp;1416 \ $pi^{pi}$ &amp; 36&amp;46 \ $(pi^{pi})^{pi}$ &amp; 80662&amp;7 \ end{tabular} end{document} 

Izvade:

Lateksa GALDS

Tabulas materiāls

Tabulas materiālam tiek izmantotas divas vides, proti, tabulēšanas vide ( egin{tabbing}…end{tabbing} ) un tabulas vidi ( egin{tabular}…end{tabular} ).

The tabulas veidā ļauj izveidot greznu vidi ar komandām, ko izmanto horizontālo un vertikālo līniju zīmēšanai. Tomēr tabulu nevar sadalīt lapās. Šim nolūkam tabula komanda tiek izmantota, lai sadalītu tabulu vairākās lapās, kā aprakstīts iepriekš.

The cilnes vide tiek izmantota, lai iestatītu cilnes, kas darbojas līdzīgi rakstāmmašīnai. Pēc tam iestatītās cilnes pāriet no vienas uz otru. Tā kā katra rindiņa ciļņu vidē tiek apstrādāta atsevišķi, lappušu pārtraukumi ir atļauti cilnēs.

Tālāk ir norādītas cilnēm izmantotās komandas:

    =iestatiet tabulēšanas pieturu>pāriet pa labi uz nākamo tabulēšanas pieturu\beidz līniju ogalinātrinda, kas beidzas ar šo komandu, tiek izmantota, lai iestatītu cilni, bet ne šīs rindas drukāšanai

Tālāk ir sniegti divi ciļņu vides piemēri.

1. Šī piemēra kods ir norādīts tālāk:

 documentclass[12pt]{article} egin{document} egin{center} egin{tabbing}Heading 1 = Heading a = Heading b = Heading c \ \ H 1 &gt; H 2 &gt; H 3 &gt; H 4 \ \ FIRST &gt; SECOND &gt; THIRD &gt; FOURTH end{tabbing} end{center} end{document} 

Šeit mēs esam izmantojuši divus \ divām jaunajām rindām.

Izvade:

Lateksa GALDS

2. Otrā piemēra kods ir norādīts tālāk:

 documentclass[12pt]{article} egin{document} egin{center} egin{tabbing}hspace{2in} = hspace{2in} = kill % you can change the inch spacing according to your requirements First heading &gt; Second heading &gt; Third heading \ &gt; Second &gt; Third \ hspace{1in} \ % make a blank line This Text extends past tab 1 &gt;&gt; Third column \ &gt; Text spans columns two and three \xxxxxxxx = xxxxx = xxxx = kill % set up new tab stops i.e. to set the stops according to the number of x H 1 &gt; H 2 &gt; H 3 &gt; H 4 \ end{tabbing} end{center} end{document} 

Izvade:

Lateksa GALDS