Issues with longtable environment












3














I have used this site with no problems to generate fast Latex code for small and medium size tables: https://www.tablesgenerator.com/



This time I'm trying to build a very long table which needs more than one page. When I used the table/tabular environment, I didn't encounter issues, but the table was only one page, it did not continue next page, so it's useless. When I tried the longtable environment I get these errors:



! Argument of @let@token has an extra }
! Paragraph ended before @let@token was complete.
! Paragraph ended before contentsline was complete


I think the site is redundant when defining the colors, but this is the whole code:



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{longtable}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{color}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{bookmark}
usepackage{longtable}
tcbuselibrary{skins}
begin{document}
frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}
chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}









share|improve this question




















  • 2




    Could you post a compilable code, not just a snippet?
    – Bernard
    Dec 28 '18 at 15:02










  • My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 15:22






  • 2




    The error seems to be connected to the spanish etc. options of babel
    – Christian Hupfer
    Dec 28 '18 at 15:48






  • 2




    (i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
    – Zarko
    Dec 28 '18 at 16:00






  • 1




    @XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
    – Christian Hupfer
    Dec 28 '18 at 16:42
















3














I have used this site with no problems to generate fast Latex code for small and medium size tables: https://www.tablesgenerator.com/



This time I'm trying to build a very long table which needs more than one page. When I used the table/tabular environment, I didn't encounter issues, but the table was only one page, it did not continue next page, so it's useless. When I tried the longtable environment I get these errors:



! Argument of @let@token has an extra }
! Paragraph ended before @let@token was complete.
! Paragraph ended before contentsline was complete


I think the site is redundant when defining the colors, but this is the whole code:



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{longtable}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{color}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{bookmark}
usepackage{longtable}
tcbuselibrary{skins}
begin{document}
frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}
chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}









share|improve this question




















  • 2




    Could you post a compilable code, not just a snippet?
    – Bernard
    Dec 28 '18 at 15:02










  • My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 15:22






  • 2




    The error seems to be connected to the spanish etc. options of babel
    – Christian Hupfer
    Dec 28 '18 at 15:48






  • 2




    (i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
    – Zarko
    Dec 28 '18 at 16:00






  • 1




    @XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
    – Christian Hupfer
    Dec 28 '18 at 16:42














3












3








3


0





I have used this site with no problems to generate fast Latex code for small and medium size tables: https://www.tablesgenerator.com/



This time I'm trying to build a very long table which needs more than one page. When I used the table/tabular environment, I didn't encounter issues, but the table was only one page, it did not continue next page, so it's useless. When I tried the longtable environment I get these errors:



! Argument of @let@token has an extra }
! Paragraph ended before @let@token was complete.
! Paragraph ended before contentsline was complete


I think the site is redundant when defining the colors, but this is the whole code:



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{longtable}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{color}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{bookmark}
usepackage{longtable}
tcbuselibrary{skins}
begin{document}
frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}
chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}









share|improve this question















I have used this site with no problems to generate fast Latex code for small and medium size tables: https://www.tablesgenerator.com/



This time I'm trying to build a very long table which needs more than one page. When I used the table/tabular environment, I didn't encounter issues, but the table was only one page, it did not continue next page, so it's useless. When I tried the longtable environment I get these errors:



! Argument of @let@token has an extra }
! Paragraph ended before @let@token was complete.
! Paragraph ended before contentsline was complete


I think the site is redundant when defining the colors, but this is the whole code:



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{longtable}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{color}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{bookmark}
usepackage{longtable}
tcbuselibrary{skins}
begin{document}
frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}
chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}






tables longtable






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 28 '18 at 15:40

























asked Dec 28 '18 at 14:50









Xavier Pacheco Paulino

395




395








  • 2




    Could you post a compilable code, not just a snippet?
    – Bernard
    Dec 28 '18 at 15:02










  • My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 15:22






  • 2




    The error seems to be connected to the spanish etc. options of babel
    – Christian Hupfer
    Dec 28 '18 at 15:48






  • 2




    (i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
    – Zarko
    Dec 28 '18 at 16:00






  • 1




    @XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
    – Christian Hupfer
    Dec 28 '18 at 16:42














  • 2




    Could you post a compilable code, not just a snippet?
    – Bernard
    Dec 28 '18 at 15:02










  • My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 15:22






  • 2




    The error seems to be connected to the spanish etc. options of babel
    – Christian Hupfer
    Dec 28 '18 at 15:48






  • 2




    (i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
    – Zarko
    Dec 28 '18 at 16:00






  • 1




    @XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
    – Christian Hupfer
    Dec 28 '18 at 16:42








2




2




Could you post a compilable code, not just a snippet?
– Bernard
Dec 28 '18 at 15:02




Could you post a compilable code, not just a snippet?
– Bernard
Dec 28 '18 at 15:02












My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
– Xavier Pacheco Paulino
Dec 28 '18 at 15:22




My code is way too long. I will update the question adding the packages I'm using. The problem only comes when I use this table.
– Xavier Pacheco Paulino
Dec 28 '18 at 15:22




2




2




The error seems to be connected to the spanish etc. options of babel
– Christian Hupfer
Dec 28 '18 at 15:48




The error seems to be connected to the spanish etc. options of babel
– Christian Hupfer
Dec 28 '18 at 15:48




2




2




(i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
– Zarko
Dec 28 '18 at 16:00




(i) your table is unnecessary complicated, if you will remove all color declaration in table you will obtain the very same result (ii) your table is to wide that can be fit on page (iii) if instead of appendices you will use switch appendix your document is possible to compile without errors.
– Zarko
Dec 28 '18 at 16:00




1




1




@XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
– Christian Hupfer
Dec 28 '18 at 16:42




@XavierPachecoPaulino: You're loading some packages twice or in the wrong order. Also xcolor supersedes color, so keep xcolor
– Christian Hupfer
Dec 28 '18 at 16:42










2 Answers
2






active

oldest

votes


















5














There are two issues here (apart from the table being to be too wide -- I do not address this 'feature', however)



First issue: usepackage[spanish]{babel} needs a special fontencoding, so usepackage[T1]{fontenc} is necessary.



Second issue: The appendix packages uses the babel form of the appendixname, i.e. Apéndice, which is taken by hyperref to create a hyperanchor, resulting in an anchor name with accents, which fails miserably.



The solution is to force another anchor name prefix for chapters within appendices, i.e. defHy@chap{appendixchapters} (or something else not screwing up the linking system and other commands). This is done with the xapptocmd setup before begin{document}.



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[pdfencoding=auto,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{longtable}
usepackage{bookmark}

usepackage{xpatch}

tcbuselibrary{skins}

makeatletter

xapptocmd{appendices}{%
defHy@chapapp{appendixchapters}%
}{}{}
makeatother

begin{document}


frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}



chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}


See also



Tex does not compile when jointly using longtable, appendix, hyperref, and babel (spanish). Error: "! Argument of @let@token has an extra }"



and



Appendix TOC link does not work when using Polyglossia (TeX Live 2015)






share|improve this answer



















  • 1




    hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
    – Ulrike Fischer
    Dec 28 '18 at 16:23






  • 1




    @UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
    – Christian Hupfer
    Dec 28 '18 at 16:25










  • It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 16:53










  • @XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
    – Christian Hupfer
    Dec 28 '18 at 16:59



















3














Two major issues with your code are (a) an unbelievable amount of code clutter, likely caused by the apparent use of tablegenerator.com to create the longtable code, and (b) the fact that it's much wider than the text block.



The following adjustments may go a long way toward fixing both issues: (i) I applied small (for a 10% linear reduction in font size), (ii) reduced the amount of intercolumn whitespace, and (iii) introduced many new line breaks within cells. I also (iv) removed all color-related directives, since they do nothing at all, and (v) switched from center-alignment of all cell contents to left (and top) alignment. I also tried to give the table a more open look by (vi) getting rid of all vertical lines and (vi) replacing most horizontal lines with whitespace.



A separate comment: I strongly recommend you load the siunitx package and use its SI macro to typeset scientific units and their associated numeric values. If you use SI consistently, you'll be assured that all units and numbers are typeset in a way that meets current scientific standards. I would also argue that writing, say, SI{1500}{microfarad} instead of $1500mu F$ makes the input a lot easier to read and, if necessary, debug.



The following screenshot shows just the first few lines of the full longtable.



enter image description here



documentclass[a4paper]{book}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[top=2cm, bottom=1.8cm,hmargin=2.5cm]{geometry}
usepackage[table]{xcolor}
usepackage{siunitx,booktabs}
usepackage{longtable}
newcommandmytab[1]{%
begin{tabular}[t]{@{}l@{}} #1 end{tabular}}

begin{document}
begingroup
small
setlengthtabcolsep{3pt}
begin{longtable}{@{} *{5}{l} @{}}
caption{My caption}
label{my-label}\
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endfirsthead

multicolumn{4}{@{}l}{tablename~ref{my-label}, cont'd}\[0.5ex]
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endhead

midrule
endfoot

bottomrule
endlastfoot

1 & AC/DC Converter &
mytab{Power Module\ SI{20}{watt}, SIrange{85}{264}{volt} in, \ SI{5}{volt} out, SI{4}{ampere}}
& -- & RAC20-05SK
\ addlinespace
7 &
mytab{TP1, TP2, TP3, TP4,\ TP5, TP6, TP7}
& Test points & SMD & 5019
\ addlinespace
7 &
mytab{AC1, AC2, AC3, AC4,\ AC5, M+, M$-$}
& Metal Terminals PCB & -- & 726386-2
\ addlinespace
1 & F1 &
mytab{Fusible Cerámica\ SI{25}{ampere}/250}
& 6.3$times$32mm & 0314025.MXP
\ addlinespace
2 & F1 (Clips) & Clips para fusible & -- & 01220083Z
\ addlinespace
1 & MOV1 & Varistor SI{150}{volt} SI{2.5}{kiloampere}
& Through Hole & B72210S0151K101
\ addlinespace
1 & R28 &
mytab{Termistor \ $2R SI{25}{ampere}}
& -- & SL32 2R025
\ addlinespace
1 & BR1 &
mytab{Puente Rectificador\ SI{35}{ampere}}
& -- & GBPC3506
\ addlinespace
1 & C1 &
mytab{Capacitor Aluminio\ SI{250}{volt} SI{1500}{microfarad}}
& Snap In & 380LX152M250A052
\ addlinespace
1 & C2 & mytab{MLCC Capacitor\ SI{630}{volt} SI{0.1}{microfarad} X7R}
& 2225 & C2225C104KBRACTU
\ addlinespace
1 & R7 & mytab{Resistencia SMD\100k/SI{1}{watt}}
& 2512 & AC2512JK-07100KL
\ addlinespace
4 &
mytab{LD1, LD2, LD3,\ LD6} & SMD LED Red Diffused & 0603
& mytab{EL-19-217/\R6C-ALM2VY/3T}
\ addlinespace
7 & mytab{R4, R6, R15, R9, \R36, R34, R18}
& mytab{Resistencia SMD\10k SI{1/8}{watt}}
& 0805 & AT0805BRD0710KL
\ addlinespace
4 & R1, R2, R11, R35 &
mytab{Resistencia SMD\174R SI{1/8}{watt}}
& 0805 & RC0805FR-07174RL
\ addlinespace
10 & mytab{R3, R14, R20, R21,\
R42, R38, R39, \R16, R17, R33}
& mytab{Resistencia SMD\1k SI{1/8}{watt} }
& 0805 & RT0805CRE071KL
\ addlinespace
1 & R5 & mytab{Resistencia SMD\39R SI{1/4}{watt}}
& 1206 & RT1206BRD0739RL
\ addlinespace
3 & Q1, Q2, Q3 & BJT NPN SI{0.6}{ampere} SI{40}{volt}
& SOT-23-3 & SST2222AHZGT116
\ addlinespace
1 & LD5 & Green SMD LED & 0603 & mytab{19-21SYGC/\S530-E2/TR8}
\ addlinespace

2 & VO1, VO2 & mytab{OPTOISOLATOR\SI{4.17}{kilovolt} TRIAC}
& 6-SMD & MOC3061SM
\ addlinespace
1 & TR1 & Triac SI{600}{volt} SI{35}{ampere}
& TO-220-2 & Q6035RH5
\ addlinespace
2 & C3, C4 &
mytab{Capacitor de película\ SI{0.01}{microfarad} SI{630}{volt}}
& Radial& BFC236969103
\ addlinespace
4 & R8, R10, R12, R13 &
mytab{Resistencia SMD\330R 1/8W}
& 0805 & RE0805FRE07330RL
\ addlinespace
1 & K1 & mytab{Relay SI{5}{volt} DC 1 Form C\(SPDT-NO, NC)}
& -- & ALQ105
\ addlinespace
1 & D6 & Fast Rectifier Diode SI{2.0}{ampere}
& mytab{SMB\ DO-214AA} & 512-ES2D
\ addlinespace
1 & TR2 & Triac 16 A 600 V & D2PAK & T1650-600G-TR
\ addlinespace
1 & LD4 & LED SMD Blue Water Clear & 0603 &
mytab{EL-19-21/\ BHC-AN1P2/3T}
\ addlinespace
1 & R24 & Resistencia SMD 680R 1/8W & 0805 & RC0805FR-07680RL
\ addlinespace
1 & U7 & Gate Drivers & PG-DSO-8-51 & 1EDI60N12AF
\ addlinespace
1 & U6 &
mytab{Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mA}
& SMD & R1SE-0512/H2-R
\ addlinespace
1 & U8 & Board Mount Current Sensors & PG-TISON-8-1 & TLI4970D050T5XUMA1
\ addlinespace
1 & Q4 &
mytab{IGBT TRENCHSTOP\ SI{600}{volt} SI{80}{ampere}}
& TO-247-3 & IKW50N60DTPXKSA1
\ addlinespace
1 & D5 &
mytab{Rectifiers SI{50}{A} SI{600}{volt}\ Ultrafast Diode}
& TO-247-2 & RURG5060-F085
\ addlinespace
10 & mytab{C5, C7, C9, C10, \C13, C15, C10, \
C16, C18, C19} &
mytab{MLCC capacitor\ SI{16}{volt} SI{0.1}{microfarad} X7R}
& 0603 & C0603C104J4RAC
\ addlinespace
3 & C6, C11, C12 &
mytab{Capacitor electrolítico\ SI{16}{volt} SI{100}{microfarad}}
& Radial Leaded & ULD1C101MED1TD
\ addlinespace
1 & C14 &
mytab{MLCC Capacitor\ SI{25}{volt} SI{1}{microfarad} X7R}
& 0805 & C0805C105J3RACTU
\ addlinespace
2 & R29, R30 & Resistencia SMD 10R 1/2W & 1210 & RC1210JR-0710RL
\ addlinespace
1 & R25 & Resistencia SMD 1/8W 100k & 0805 & RC0805DR-07100KL
\ addlinespace
1 & R26 & Resistencia SMD 1/8W 47k & 0805 & RT0805BRD0747KL
\ addlinespace
1 & R41 & Resistencia SMD 1/8W 20k & 0805 & AT0805BRD0720KL
\ addlinespace
1 & D11 & TVS Diodes 600W 5.0V & SMB & SMBJ5.0A-TR
\ addlinespace
1 & J1, J2 &
mytab{CONN HEADER VERT\ 3POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S03-ST-BA}
\ addlinespace
1 & U2 & Op Amps Dual 2.7V & SOIC-8 & MCP602-I/SN
\ addlinespace
3 & JP1, JP2, JP5 &
mytab{2.54mm Hdr 3P Single\ Str Gold} & Straight Pin
& mytab{Pin: 61300311121\ Jumper: 382811-8} \ addlinespace
1 & U1 & Analog Dual Comparators & SOIC-8 & LM393MX/NOPB
\ addlinespace
1 & J3 &
mytab{CONN HEADER VERT\ 4POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S04-ST-BA}
\ addlinespace
2 & R19, R22, R27 &
mytab{Resistencia SMD\ 1/8W 100R} & 0805 & AT0805DRD07100RL
\ addlinespace
1 & Microcontrolador &
mytab{Development Boards & \Kits -- ARM STM32} & - & NUCLEO-L432KC
\ addlinespace
1 & U3 &
mytab{LVDS Interface IC\ Single Full-Duplex} & SOIC-8 150mil & SN65LVDS179DR
\ addlinespace
1 & C8 &
mytab{MLCC Capacitor\ SI{10}{volt} SI{1000}{picofarad}} & 0402 & C0402C102J8RACTU
\ addlinespace
1 & U5 &
mytab{Ethernet Connectors\ Female 8P Vertical} & Through Hole & 615008138021
\ addlinespace
1 & C17 &
mytab{MLCC Capacitor\
SI{16}{volt} SI{1}{microfarad} X7R} & 0603 &
mytab{C0603X105M4-\RACAUTO} \
end{longtable}
endgroup
end{document}





share|improve this answer























  • Amazing! Thank you!
    – Xavier Pacheco Paulino
    Dec 29 '18 at 1:43











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467674%2fissues-with-longtable-environment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














There are two issues here (apart from the table being to be too wide -- I do not address this 'feature', however)



First issue: usepackage[spanish]{babel} needs a special fontencoding, so usepackage[T1]{fontenc} is necessary.



Second issue: The appendix packages uses the babel form of the appendixname, i.e. Apéndice, which is taken by hyperref to create a hyperanchor, resulting in an anchor name with accents, which fails miserably.



The solution is to force another anchor name prefix for chapters within appendices, i.e. defHy@chap{appendixchapters} (or something else not screwing up the linking system and other commands). This is done with the xapptocmd setup before begin{document}.



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[pdfencoding=auto,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{longtable}
usepackage{bookmark}

usepackage{xpatch}

tcbuselibrary{skins}

makeatletter

xapptocmd{appendices}{%
defHy@chapapp{appendixchapters}%
}{}{}
makeatother

begin{document}


frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}



chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}


See also



Tex does not compile when jointly using longtable, appendix, hyperref, and babel (spanish). Error: "! Argument of @let@token has an extra }"



and



Appendix TOC link does not work when using Polyglossia (TeX Live 2015)






share|improve this answer



















  • 1




    hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
    – Ulrike Fischer
    Dec 28 '18 at 16:23






  • 1




    @UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
    – Christian Hupfer
    Dec 28 '18 at 16:25










  • It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 16:53










  • @XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
    – Christian Hupfer
    Dec 28 '18 at 16:59
















5














There are two issues here (apart from the table being to be too wide -- I do not address this 'feature', however)



First issue: usepackage[spanish]{babel} needs a special fontencoding, so usepackage[T1]{fontenc} is necessary.



Second issue: The appendix packages uses the babel form of the appendixname, i.e. Apéndice, which is taken by hyperref to create a hyperanchor, resulting in an anchor name with accents, which fails miserably.



The solution is to force another anchor name prefix for chapters within appendices, i.e. defHy@chap{appendixchapters} (or something else not screwing up the linking system and other commands). This is done with the xapptocmd setup before begin{document}.



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[pdfencoding=auto,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{longtable}
usepackage{bookmark}

usepackage{xpatch}

tcbuselibrary{skins}

makeatletter

xapptocmd{appendices}{%
defHy@chapapp{appendixchapters}%
}{}{}
makeatother

begin{document}


frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}



chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}


See also



Tex does not compile when jointly using longtable, appendix, hyperref, and babel (spanish). Error: "! Argument of @let@token has an extra }"



and



Appendix TOC link does not work when using Polyglossia (TeX Live 2015)






share|improve this answer



















  • 1




    hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
    – Ulrike Fischer
    Dec 28 '18 at 16:23






  • 1




    @UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
    – Christian Hupfer
    Dec 28 '18 at 16:25










  • It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 16:53










  • @XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
    – Christian Hupfer
    Dec 28 '18 at 16:59














5












5








5






There are two issues here (apart from the table being to be too wide -- I do not address this 'feature', however)



First issue: usepackage[spanish]{babel} needs a special fontencoding, so usepackage[T1]{fontenc} is necessary.



Second issue: The appendix packages uses the babel form of the appendixname, i.e. Apéndice, which is taken by hyperref to create a hyperanchor, resulting in an anchor name with accents, which fails miserably.



The solution is to force another anchor name prefix for chapters within appendices, i.e. defHy@chap{appendixchapters} (or something else not screwing up the linking system and other commands). This is done with the xapptocmd setup before begin{document}.



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[pdfencoding=auto,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{longtable}
usepackage{bookmark}

usepackage{xpatch}

tcbuselibrary{skins}

makeatletter

xapptocmd{appendices}{%
defHy@chapapp{appendixchapters}%
}{}{}
makeatother

begin{document}


frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}



chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}


See also



Tex does not compile when jointly using longtable, appendix, hyperref, and babel (spanish). Error: "! Argument of @let@token has an extra }"



and



Appendix TOC link does not work when using Polyglossia (TeX Live 2015)






share|improve this answer














There are two issues here (apart from the table being to be too wide -- I do not address this 'feature', however)



First issue: usepackage[spanish]{babel} needs a special fontencoding, so usepackage[T1]{fontenc} is necessary.



Second issue: The appendix packages uses the babel form of the appendixname, i.e. Apéndice, which is taken by hyperref to create a hyperanchor, resulting in an anchor name with accents, which fails miserably.



The solution is to force another anchor name prefix for chapters within appendices, i.e. defHy@chap{appendixchapters} (or something else not screwing up the linking system and other commands). This is done with the xapptocmd setup before begin{document}.



documentclass[a4paper]{book}
usepackage[table,xcdraw]{xcolor}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[titletoc]{appendix}
usepackage{ragged2e}
usepackage[numbers]{natbib}
usepackage{amssymb}
usepackage{caption}
usepackage{subcaption}
usepackage{enumerate} % needed for some options in enumerate
usepackage{makeidx} % needed for creating an index
usepackage{blindtext}
usepackage{amsmath}
usepackage{bigstrut}
usepackage{upgreek}
usepackage{listings}
usepackage{graphicx}
usepackage{array}
usepackage{tikz}
usepackage[nottoc]{tocbibind}
usepackage{fancyhdr}
usepackage{titlesec}
usepackage{pdfpages}
usepackage{pdflscape}
usepackage{titletoc}
usepackage{tcolorbox}
usepackage[top=2cm, bottom=1.8cm,left=2.5cm,right=2.5cm]{geometry} % needed for page border settings
usepackage[pdfencoding=auto,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}
usepackage{longtable}
usepackage{bookmark}

usepackage{xpatch}

tcbuselibrary{skins}

makeatletter

xapptocmd{appendices}{%
defHy@chapapp{appendixchapters}%
}{}{}
makeatother

begin{document}


frontmatter
listoffigures
newpage
listoftables
newpage
tableofcontents
mainmatter
chapter{First chapter}
section{F1}

begin{appendices}



chapter{Table}
begin{longtable}{|
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |
>{columncolor[HTML]{FFFFFF}}c |}
caption{My caption}
label{my-label}\
hline
{color[HTML]{000000} textbf{Cantidad}} & {color[HTML]{000000} textbf{Designante}} & {color[HTML]{000000} textbf{Referencia}} & {color[HTML]{000000} textbf{Encapsulado}} & {color[HTML]{000000} textbf{No. de parte}} \ hline
endfirsthead
%
endhead
%
{color[HTML]{000000} 1} & {color[HTML]{000000} AC/DC Converter} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Power Module\ 20W 85-264Vin 5Vout 4Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} RAC20-05SK} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}TP1, TP2, TP3, TP4, TP5\ TP6, TP7end{tabular}} & {color[HTML]{000000} Test points} & {color[HTML]{000000} SMD} & {color[HTML]{000000} 5019} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}AC1, AC2, AC3, AC4\ AC5, M+, M-end{tabular}} & {color[HTML]{000000} Metal Terminals PCB} & {color[HTML]{000000} -} & {color[HTML]{000000} 726386-2} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} F1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Fusible Cerámica\ 25A/250end{tabular}} & {color[HTML]{000000} 6.3x32mm} & {color[HTML]{000000} 0314025.MXP} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} F1 (Clips)} & {color[HTML]{000000} Clips para fusible} & {color[HTML]{000000} -} & {color[HTML]{000000} 01220083Z} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} MOV1} & {color[HTML]{000000} Varistor 150V 2.5kA} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} B72210S0151K101} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R28} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Termistor \ $2R 25Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} SL32 2R025} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} BR1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Puente Rectificador\ 35Aend{tabular}} & {color[HTML]{000000} -} & {color[HTML]{000000} GBPC3506} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C1} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Capacitor Aluminio\ 250V $1500mu F$end{tabular}} & {color[HTML]{000000} Snap In} & {color[HTML]{000000} 380LX152M250A052} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C2} & {color[HTML]{000000} MLCC Capacitor630volts $0.1mu F$ X7R} & {color[HTML]{000000} 2225} & {color[HTML]{000000} C2225C104KBRACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R7} & {color[HTML]{000000} Resistencia SMD 100k/1W} & {color[HTML]{000000} 2512} & {color[HTML]{000000} AC2512JK-07100KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} LD1, LD2, LD3, LD6} & {color[HTML]{000000} SMD LED Red Diffused} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-217/R6C-ALM2VY/3T} \ hline
{color[HTML]{000000} 7} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R4, R6, R15, R9, R36, \ R34, R18end{tabular}} & {color[HTML]{000000} Resistencia SMD 10k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0710KL} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R1, R2, R11, R35} & {color[HTML]{000000} Resistencia SMD 174R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07174RL} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}R3, R14, R20, R21, R42\ R38, R39, R16, R17, R33end{tabular}} & {color[HTML]{000000} Resistencia SMD 1k 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805CRE071KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R5} & {color[HTML]{000000} Resistencia SMD 39R 1/4W} & {color[HTML]{000000} 1206} & {color[HTML]{000000} RT1206BRD0739RL} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} Q1, Q2, Q3} & {color[HTML]{000000} BJT NPN 0.6A 40V} & {color[HTML]{000000} SOT-23-3} & {color[HTML]{000000} SST2222AHZGT116} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD5} & {color[HTML]{000000} Green SMD LED} & {color[HTML]{000000} 0603} & {color[HTML]{000000} 19-21SYGC/S530-E2/TR8} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} VO1, VO2} & {color[HTML]{000000} OPTOISOLATOR 4.17KV TRIAC} & {color[HTML]{000000} 6-SMD} & {color[HTML]{000000} MOC3061SM} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR1} & {color[HTML]{000000} Triac 600V 35A} & {color[HTML]{000000} TO-220-2} & {color[HTML]{000000} Q6035RH5} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} C3, C4} & {color[HTML]{000000} Capacitor de película0.01$mu F$ 630V} & {color[HTML]{000000} Radial} & {color[HTML]{000000} BFC236969103} \ hline
{color[HTML]{000000} 4} & {color[HTML]{000000} R8, R10, R12, R13} & {color[HTML]{000000} Resistencia SMD 330R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RE0805FRE07330RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} K1} & {color[HTML]{000000} Relay 5VDC 1 Form C (SPDT-NO, NC)} & {color[HTML]{000000} -} & {color[HTML]{000000} ALQ105} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D6} & {color[HTML]{000000} Fast Rectifier Diode 2.0A} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}SMB\ DO-214AAend{tabular}} & {color[HTML]{000000} 512-ES2D} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} TR2} & {color[HTML]{000000} Triac 16 A 600 V} & {color[HTML]{000000} D2PAK} & {color[HTML]{000000} T1650-600G-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} LD4} & {color[HTML]{000000} LED SMD Blue Water Clear} & {color[HTML]{000000} 0603} & {color[HTML]{000000} EL-19-21/BHC-AN1P2/3T} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R24} & {color[HTML]{000000} Resistencia SMD 680R 1/8W} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805FR-07680RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U7} & {color[HTML]{000000} Gate Drivers} & {color[HTML]{000000} PG-DSO-8-51} & {color[HTML]{000000} 1EDI60N12AF} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U6} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mAend{tabular}} & {color[HTML]{000000} SMD} & {color[HTML]{000000} R1SE-0512/H2-R} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U8} & {color[HTML]{000000} Board Mount Current Sensors} & {color[HTML]{000000} PG-TISON-8-1} & {color[HTML]{000000} TLI4970D050T5XUMA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Q4} & {color[HTML]{000000} IGBT TRENCHSTOP 600V 80A} & {color[HTML]{000000} TO-247-3} & {color[HTML]{000000} IKW50N60DTPXKSA1} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D5} & {color[HTML]{000000} Rectifiers 50A, 600V Ultrafast Diode} & {color[HTML]{000000} TO-247-2} & {color[HTML]{000000} RURG5060-F085} \ hline
{color[HTML]{000000} 10} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}C5, C7, C9, C10, C13, \ C15, C10, C16\ C18, C19,end{tabular}} & {color[HTML]{000000} MLCC capacitor 16V 0.1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603C104J4RAC} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} C6, C11, C12} & {color[HTML]{000000} Capacitor electrolítico 16V 100$mu F$} & {color[HTML]{000000} Radial Leaded} & {color[HTML]{000000} ULD1C101MED1TD} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C14} & {color[HTML]{000000} MLCC Capacitor 25V 1$muF$ X7R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} C0805C105J3RACTU} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R29, R30} & {color[HTML]{000000} Resistencia SMD 10R 1/2W} & {color[HTML]{000000} 1210} & {color[HTML]{000000} RC1210JR-0710RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R25} & {color[HTML]{000000} Resistencia SMD 1/8W 100k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RC0805DR-07100KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R26} & {color[HTML]{000000} Resistencia SMD 1/8W 47k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} RT0805BRD0747KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} R41} & {color[HTML]{000000} Resistencia SMD 1/8W 20k} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805BRD0720KL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} D11} & {color[HTML]{000000} TVS Diodes 600W 5.0V} & {color[HTML]{000000} SMB} & {color[HTML]{000000} SMBJ5.0A-TR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J1, J2} & {color[HTML]{000000} CONN HEADER VERT 3POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S03-ST-BA} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U2} & {color[HTML]{000000} Op Amps Dual 2.7V} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} MCP602-I/SN} \ hline
{color[HTML]{000000} 3} & {color[HTML]{000000} JP1, JP2, JP5} & {color[HTML]{000000} 2.54mm Hdr 3P Single Str Gold} & {color[HTML]{000000} Straight Pin} & {color[HTML]{000000} begin{tabular}[c]{@{}c@{}}Pin: 61300311121\ Jumper: 382811-8end{tabular}} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U1} & {color[HTML]{000000} Analog Dual Comparators} & {color[HTML]{000000} SOIC-8} & {color[HTML]{000000} LM393MX/NOPB} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} J3} & {color[HTML]{000000} CONN HEADER VERT 4POS 2.54MM} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} SWR25X-NRTC-S04-ST-BA} \ hline
{color[HTML]{000000} 2} & {color[HTML]{000000} R19, R22, R27} & {color[HTML]{000000} Resistencia SMD 1/8W 100R} & {color[HTML]{000000} 0805} & {color[HTML]{000000} AT0805DRD07100RL} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} Microcontrolador} & {color[HTML]{000000} Development Boards & Kits - ARM STM32} & {color[HTML]{000000} -} & {color[HTML]{000000} NUCLEO-L432KC} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U3} & {color[HTML]{000000} LVDS Interface IC Single Full-Duplex} & {color[HTML]{000000} SOIC-8 150mil} & {color[HTML]{000000} SN65LVDS179DR} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C8} & {color[HTML]{000000} MLCC Capacitor 10V 1000pF} & {color[HTML]{000000} 0402} & {color[HTML]{000000} C0402C102J8RACTU} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} U5} & {color[HTML]{000000} Ethernet Connectors Female 8P Vertical} & {color[HTML]{000000} Through Hole} & {color[HTML]{000000} 615008138021} \ hline
{color[HTML]{000000} 1} & {color[HTML]{000000} C17} & {color[HTML]{000000} MLCC Capacitor 16V 1$muF$ X7R} & {color[HTML]{000000} 0603} & {color[HTML]{000000} C0603X105M4RACAUTO} \ hline
end{longtable}
newpage
chapter{Another appendix}
end{appendices}
end{document}


See also



Tex does not compile when jointly using longtable, appendix, hyperref, and babel (spanish). Error: "! Argument of @let@token has an extra }"



and



Appendix TOC link does not work when using Polyglossia (TeX Live 2015)







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 28 '18 at 16:24

























answered Dec 28 '18 at 16:18









Christian Hupfer

148k14193387




148k14193387








  • 1




    hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
    – Ulrike Fischer
    Dec 28 '18 at 16:23






  • 1




    @UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
    – Christian Hupfer
    Dec 28 '18 at 16:25










  • It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 16:53










  • @XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
    – Christian Hupfer
    Dec 28 '18 at 16:59














  • 1




    hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
    – Ulrike Fischer
    Dec 28 '18 at 16:23






  • 1




    @UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
    – Christian Hupfer
    Dec 28 '18 at 16:25










  • It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
    – Xavier Pacheco Paulino
    Dec 28 '18 at 16:53










  • @XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
    – Christian Hupfer
    Dec 28 '18 at 16:59








1




1




hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
– Ulrike Fischer
Dec 28 '18 at 16:23




hyperref uses defHy@chapapp, so it would be better to use def in your redefinition too.
– Ulrike Fischer
Dec 28 '18 at 16:23




1




1




@UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
– Christian Hupfer
Dec 28 '18 at 16:25




@UlrikeFischer: Agreed. I can't remember why I used gdef at all in my linked answer
– Christian Hupfer
Dec 28 '18 at 16:25












It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
– Xavier Pacheco Paulino
Dec 28 '18 at 16:53




It works now. Thank you. Now I just need to resize the table to make it fit in one page because it's too wide and looks cut.
– Xavier Pacheco Paulino
Dec 28 '18 at 16:53












@XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
– Christian Hupfer
Dec 28 '18 at 16:59




@XavierPachecoPaulino: Fitting the table to your needs is the bigger issue, I think ;-) Happy TeXing
– Christian Hupfer
Dec 28 '18 at 16:59











3














Two major issues with your code are (a) an unbelievable amount of code clutter, likely caused by the apparent use of tablegenerator.com to create the longtable code, and (b) the fact that it's much wider than the text block.



The following adjustments may go a long way toward fixing both issues: (i) I applied small (for a 10% linear reduction in font size), (ii) reduced the amount of intercolumn whitespace, and (iii) introduced many new line breaks within cells. I also (iv) removed all color-related directives, since they do nothing at all, and (v) switched from center-alignment of all cell contents to left (and top) alignment. I also tried to give the table a more open look by (vi) getting rid of all vertical lines and (vi) replacing most horizontal lines with whitespace.



A separate comment: I strongly recommend you load the siunitx package and use its SI macro to typeset scientific units and their associated numeric values. If you use SI consistently, you'll be assured that all units and numbers are typeset in a way that meets current scientific standards. I would also argue that writing, say, SI{1500}{microfarad} instead of $1500mu F$ makes the input a lot easier to read and, if necessary, debug.



The following screenshot shows just the first few lines of the full longtable.



enter image description here



documentclass[a4paper]{book}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[top=2cm, bottom=1.8cm,hmargin=2.5cm]{geometry}
usepackage[table]{xcolor}
usepackage{siunitx,booktabs}
usepackage{longtable}
newcommandmytab[1]{%
begin{tabular}[t]{@{}l@{}} #1 end{tabular}}

begin{document}
begingroup
small
setlengthtabcolsep{3pt}
begin{longtable}{@{} *{5}{l} @{}}
caption{My caption}
label{my-label}\
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endfirsthead

multicolumn{4}{@{}l}{tablename~ref{my-label}, cont'd}\[0.5ex]
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endhead

midrule
endfoot

bottomrule
endlastfoot

1 & AC/DC Converter &
mytab{Power Module\ SI{20}{watt}, SIrange{85}{264}{volt} in, \ SI{5}{volt} out, SI{4}{ampere}}
& -- & RAC20-05SK
\ addlinespace
7 &
mytab{TP1, TP2, TP3, TP4,\ TP5, TP6, TP7}
& Test points & SMD & 5019
\ addlinespace
7 &
mytab{AC1, AC2, AC3, AC4,\ AC5, M+, M$-$}
& Metal Terminals PCB & -- & 726386-2
\ addlinespace
1 & F1 &
mytab{Fusible Cerámica\ SI{25}{ampere}/250}
& 6.3$times$32mm & 0314025.MXP
\ addlinespace
2 & F1 (Clips) & Clips para fusible & -- & 01220083Z
\ addlinespace
1 & MOV1 & Varistor SI{150}{volt} SI{2.5}{kiloampere}
& Through Hole & B72210S0151K101
\ addlinespace
1 & R28 &
mytab{Termistor \ $2R SI{25}{ampere}}
& -- & SL32 2R025
\ addlinespace
1 & BR1 &
mytab{Puente Rectificador\ SI{35}{ampere}}
& -- & GBPC3506
\ addlinespace
1 & C1 &
mytab{Capacitor Aluminio\ SI{250}{volt} SI{1500}{microfarad}}
& Snap In & 380LX152M250A052
\ addlinespace
1 & C2 & mytab{MLCC Capacitor\ SI{630}{volt} SI{0.1}{microfarad} X7R}
& 2225 & C2225C104KBRACTU
\ addlinespace
1 & R7 & mytab{Resistencia SMD\100k/SI{1}{watt}}
& 2512 & AC2512JK-07100KL
\ addlinespace
4 &
mytab{LD1, LD2, LD3,\ LD6} & SMD LED Red Diffused & 0603
& mytab{EL-19-217/\R6C-ALM2VY/3T}
\ addlinespace
7 & mytab{R4, R6, R15, R9, \R36, R34, R18}
& mytab{Resistencia SMD\10k SI{1/8}{watt}}
& 0805 & AT0805BRD0710KL
\ addlinespace
4 & R1, R2, R11, R35 &
mytab{Resistencia SMD\174R SI{1/8}{watt}}
& 0805 & RC0805FR-07174RL
\ addlinespace
10 & mytab{R3, R14, R20, R21,\
R42, R38, R39, \R16, R17, R33}
& mytab{Resistencia SMD\1k SI{1/8}{watt} }
& 0805 & RT0805CRE071KL
\ addlinespace
1 & R5 & mytab{Resistencia SMD\39R SI{1/4}{watt}}
& 1206 & RT1206BRD0739RL
\ addlinespace
3 & Q1, Q2, Q3 & BJT NPN SI{0.6}{ampere} SI{40}{volt}
& SOT-23-3 & SST2222AHZGT116
\ addlinespace
1 & LD5 & Green SMD LED & 0603 & mytab{19-21SYGC/\S530-E2/TR8}
\ addlinespace

2 & VO1, VO2 & mytab{OPTOISOLATOR\SI{4.17}{kilovolt} TRIAC}
& 6-SMD & MOC3061SM
\ addlinespace
1 & TR1 & Triac SI{600}{volt} SI{35}{ampere}
& TO-220-2 & Q6035RH5
\ addlinespace
2 & C3, C4 &
mytab{Capacitor de película\ SI{0.01}{microfarad} SI{630}{volt}}
& Radial& BFC236969103
\ addlinespace
4 & R8, R10, R12, R13 &
mytab{Resistencia SMD\330R 1/8W}
& 0805 & RE0805FRE07330RL
\ addlinespace
1 & K1 & mytab{Relay SI{5}{volt} DC 1 Form C\(SPDT-NO, NC)}
& -- & ALQ105
\ addlinespace
1 & D6 & Fast Rectifier Diode SI{2.0}{ampere}
& mytab{SMB\ DO-214AA} & 512-ES2D
\ addlinespace
1 & TR2 & Triac 16 A 600 V & D2PAK & T1650-600G-TR
\ addlinespace
1 & LD4 & LED SMD Blue Water Clear & 0603 &
mytab{EL-19-21/\ BHC-AN1P2/3T}
\ addlinespace
1 & R24 & Resistencia SMD 680R 1/8W & 0805 & RC0805FR-07680RL
\ addlinespace
1 & U7 & Gate Drivers & PG-DSO-8-51 & 1EDI60N12AF
\ addlinespace
1 & U6 &
mytab{Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mA}
& SMD & R1SE-0512/H2-R
\ addlinespace
1 & U8 & Board Mount Current Sensors & PG-TISON-8-1 & TLI4970D050T5XUMA1
\ addlinespace
1 & Q4 &
mytab{IGBT TRENCHSTOP\ SI{600}{volt} SI{80}{ampere}}
& TO-247-3 & IKW50N60DTPXKSA1
\ addlinespace
1 & D5 &
mytab{Rectifiers SI{50}{A} SI{600}{volt}\ Ultrafast Diode}
& TO-247-2 & RURG5060-F085
\ addlinespace
10 & mytab{C5, C7, C9, C10, \C13, C15, C10, \
C16, C18, C19} &
mytab{MLCC capacitor\ SI{16}{volt} SI{0.1}{microfarad} X7R}
& 0603 & C0603C104J4RAC
\ addlinespace
3 & C6, C11, C12 &
mytab{Capacitor electrolítico\ SI{16}{volt} SI{100}{microfarad}}
& Radial Leaded & ULD1C101MED1TD
\ addlinespace
1 & C14 &
mytab{MLCC Capacitor\ SI{25}{volt} SI{1}{microfarad} X7R}
& 0805 & C0805C105J3RACTU
\ addlinespace
2 & R29, R30 & Resistencia SMD 10R 1/2W & 1210 & RC1210JR-0710RL
\ addlinespace
1 & R25 & Resistencia SMD 1/8W 100k & 0805 & RC0805DR-07100KL
\ addlinespace
1 & R26 & Resistencia SMD 1/8W 47k & 0805 & RT0805BRD0747KL
\ addlinespace
1 & R41 & Resistencia SMD 1/8W 20k & 0805 & AT0805BRD0720KL
\ addlinespace
1 & D11 & TVS Diodes 600W 5.0V & SMB & SMBJ5.0A-TR
\ addlinespace
1 & J1, J2 &
mytab{CONN HEADER VERT\ 3POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S03-ST-BA}
\ addlinespace
1 & U2 & Op Amps Dual 2.7V & SOIC-8 & MCP602-I/SN
\ addlinespace
3 & JP1, JP2, JP5 &
mytab{2.54mm Hdr 3P Single\ Str Gold} & Straight Pin
& mytab{Pin: 61300311121\ Jumper: 382811-8} \ addlinespace
1 & U1 & Analog Dual Comparators & SOIC-8 & LM393MX/NOPB
\ addlinespace
1 & J3 &
mytab{CONN HEADER VERT\ 4POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S04-ST-BA}
\ addlinespace
2 & R19, R22, R27 &
mytab{Resistencia SMD\ 1/8W 100R} & 0805 & AT0805DRD07100RL
\ addlinespace
1 & Microcontrolador &
mytab{Development Boards & \Kits -- ARM STM32} & - & NUCLEO-L432KC
\ addlinespace
1 & U3 &
mytab{LVDS Interface IC\ Single Full-Duplex} & SOIC-8 150mil & SN65LVDS179DR
\ addlinespace
1 & C8 &
mytab{MLCC Capacitor\ SI{10}{volt} SI{1000}{picofarad}} & 0402 & C0402C102J8RACTU
\ addlinespace
1 & U5 &
mytab{Ethernet Connectors\ Female 8P Vertical} & Through Hole & 615008138021
\ addlinespace
1 & C17 &
mytab{MLCC Capacitor\
SI{16}{volt} SI{1}{microfarad} X7R} & 0603 &
mytab{C0603X105M4-\RACAUTO} \
end{longtable}
endgroup
end{document}





share|improve this answer























  • Amazing! Thank you!
    – Xavier Pacheco Paulino
    Dec 29 '18 at 1:43
















3














Two major issues with your code are (a) an unbelievable amount of code clutter, likely caused by the apparent use of tablegenerator.com to create the longtable code, and (b) the fact that it's much wider than the text block.



The following adjustments may go a long way toward fixing both issues: (i) I applied small (for a 10% linear reduction in font size), (ii) reduced the amount of intercolumn whitespace, and (iii) introduced many new line breaks within cells. I also (iv) removed all color-related directives, since they do nothing at all, and (v) switched from center-alignment of all cell contents to left (and top) alignment. I also tried to give the table a more open look by (vi) getting rid of all vertical lines and (vi) replacing most horizontal lines with whitespace.



A separate comment: I strongly recommend you load the siunitx package and use its SI macro to typeset scientific units and their associated numeric values. If you use SI consistently, you'll be assured that all units and numbers are typeset in a way that meets current scientific standards. I would also argue that writing, say, SI{1500}{microfarad} instead of $1500mu F$ makes the input a lot easier to read and, if necessary, debug.



The following screenshot shows just the first few lines of the full longtable.



enter image description here



documentclass[a4paper]{book}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[top=2cm, bottom=1.8cm,hmargin=2.5cm]{geometry}
usepackage[table]{xcolor}
usepackage{siunitx,booktabs}
usepackage{longtable}
newcommandmytab[1]{%
begin{tabular}[t]{@{}l@{}} #1 end{tabular}}

begin{document}
begingroup
small
setlengthtabcolsep{3pt}
begin{longtable}{@{} *{5}{l} @{}}
caption{My caption}
label{my-label}\
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endfirsthead

multicolumn{4}{@{}l}{tablename~ref{my-label}, cont'd}\[0.5ex]
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endhead

midrule
endfoot

bottomrule
endlastfoot

1 & AC/DC Converter &
mytab{Power Module\ SI{20}{watt}, SIrange{85}{264}{volt} in, \ SI{5}{volt} out, SI{4}{ampere}}
& -- & RAC20-05SK
\ addlinespace
7 &
mytab{TP1, TP2, TP3, TP4,\ TP5, TP6, TP7}
& Test points & SMD & 5019
\ addlinespace
7 &
mytab{AC1, AC2, AC3, AC4,\ AC5, M+, M$-$}
& Metal Terminals PCB & -- & 726386-2
\ addlinespace
1 & F1 &
mytab{Fusible Cerámica\ SI{25}{ampere}/250}
& 6.3$times$32mm & 0314025.MXP
\ addlinespace
2 & F1 (Clips) & Clips para fusible & -- & 01220083Z
\ addlinespace
1 & MOV1 & Varistor SI{150}{volt} SI{2.5}{kiloampere}
& Through Hole & B72210S0151K101
\ addlinespace
1 & R28 &
mytab{Termistor \ $2R SI{25}{ampere}}
& -- & SL32 2R025
\ addlinespace
1 & BR1 &
mytab{Puente Rectificador\ SI{35}{ampere}}
& -- & GBPC3506
\ addlinespace
1 & C1 &
mytab{Capacitor Aluminio\ SI{250}{volt} SI{1500}{microfarad}}
& Snap In & 380LX152M250A052
\ addlinespace
1 & C2 & mytab{MLCC Capacitor\ SI{630}{volt} SI{0.1}{microfarad} X7R}
& 2225 & C2225C104KBRACTU
\ addlinespace
1 & R7 & mytab{Resistencia SMD\100k/SI{1}{watt}}
& 2512 & AC2512JK-07100KL
\ addlinespace
4 &
mytab{LD1, LD2, LD3,\ LD6} & SMD LED Red Diffused & 0603
& mytab{EL-19-217/\R6C-ALM2VY/3T}
\ addlinespace
7 & mytab{R4, R6, R15, R9, \R36, R34, R18}
& mytab{Resistencia SMD\10k SI{1/8}{watt}}
& 0805 & AT0805BRD0710KL
\ addlinespace
4 & R1, R2, R11, R35 &
mytab{Resistencia SMD\174R SI{1/8}{watt}}
& 0805 & RC0805FR-07174RL
\ addlinespace
10 & mytab{R3, R14, R20, R21,\
R42, R38, R39, \R16, R17, R33}
& mytab{Resistencia SMD\1k SI{1/8}{watt} }
& 0805 & RT0805CRE071KL
\ addlinespace
1 & R5 & mytab{Resistencia SMD\39R SI{1/4}{watt}}
& 1206 & RT1206BRD0739RL
\ addlinespace
3 & Q1, Q2, Q3 & BJT NPN SI{0.6}{ampere} SI{40}{volt}
& SOT-23-3 & SST2222AHZGT116
\ addlinespace
1 & LD5 & Green SMD LED & 0603 & mytab{19-21SYGC/\S530-E2/TR8}
\ addlinespace

2 & VO1, VO2 & mytab{OPTOISOLATOR\SI{4.17}{kilovolt} TRIAC}
& 6-SMD & MOC3061SM
\ addlinespace
1 & TR1 & Triac SI{600}{volt} SI{35}{ampere}
& TO-220-2 & Q6035RH5
\ addlinespace
2 & C3, C4 &
mytab{Capacitor de película\ SI{0.01}{microfarad} SI{630}{volt}}
& Radial& BFC236969103
\ addlinespace
4 & R8, R10, R12, R13 &
mytab{Resistencia SMD\330R 1/8W}
& 0805 & RE0805FRE07330RL
\ addlinespace
1 & K1 & mytab{Relay SI{5}{volt} DC 1 Form C\(SPDT-NO, NC)}
& -- & ALQ105
\ addlinespace
1 & D6 & Fast Rectifier Diode SI{2.0}{ampere}
& mytab{SMB\ DO-214AA} & 512-ES2D
\ addlinespace
1 & TR2 & Triac 16 A 600 V & D2PAK & T1650-600G-TR
\ addlinespace
1 & LD4 & LED SMD Blue Water Clear & 0603 &
mytab{EL-19-21/\ BHC-AN1P2/3T}
\ addlinespace
1 & R24 & Resistencia SMD 680R 1/8W & 0805 & RC0805FR-07680RL
\ addlinespace
1 & U7 & Gate Drivers & PG-DSO-8-51 & 1EDI60N12AF
\ addlinespace
1 & U6 &
mytab{Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mA}
& SMD & R1SE-0512/H2-R
\ addlinespace
1 & U8 & Board Mount Current Sensors & PG-TISON-8-1 & TLI4970D050T5XUMA1
\ addlinespace
1 & Q4 &
mytab{IGBT TRENCHSTOP\ SI{600}{volt} SI{80}{ampere}}
& TO-247-3 & IKW50N60DTPXKSA1
\ addlinespace
1 & D5 &
mytab{Rectifiers SI{50}{A} SI{600}{volt}\ Ultrafast Diode}
& TO-247-2 & RURG5060-F085
\ addlinespace
10 & mytab{C5, C7, C9, C10, \C13, C15, C10, \
C16, C18, C19} &
mytab{MLCC capacitor\ SI{16}{volt} SI{0.1}{microfarad} X7R}
& 0603 & C0603C104J4RAC
\ addlinespace
3 & C6, C11, C12 &
mytab{Capacitor electrolítico\ SI{16}{volt} SI{100}{microfarad}}
& Radial Leaded & ULD1C101MED1TD
\ addlinespace
1 & C14 &
mytab{MLCC Capacitor\ SI{25}{volt} SI{1}{microfarad} X7R}
& 0805 & C0805C105J3RACTU
\ addlinespace
2 & R29, R30 & Resistencia SMD 10R 1/2W & 1210 & RC1210JR-0710RL
\ addlinespace
1 & R25 & Resistencia SMD 1/8W 100k & 0805 & RC0805DR-07100KL
\ addlinespace
1 & R26 & Resistencia SMD 1/8W 47k & 0805 & RT0805BRD0747KL
\ addlinespace
1 & R41 & Resistencia SMD 1/8W 20k & 0805 & AT0805BRD0720KL
\ addlinespace
1 & D11 & TVS Diodes 600W 5.0V & SMB & SMBJ5.0A-TR
\ addlinespace
1 & J1, J2 &
mytab{CONN HEADER VERT\ 3POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S03-ST-BA}
\ addlinespace
1 & U2 & Op Amps Dual 2.7V & SOIC-8 & MCP602-I/SN
\ addlinespace
3 & JP1, JP2, JP5 &
mytab{2.54mm Hdr 3P Single\ Str Gold} & Straight Pin
& mytab{Pin: 61300311121\ Jumper: 382811-8} \ addlinespace
1 & U1 & Analog Dual Comparators & SOIC-8 & LM393MX/NOPB
\ addlinespace
1 & J3 &
mytab{CONN HEADER VERT\ 4POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S04-ST-BA}
\ addlinespace
2 & R19, R22, R27 &
mytab{Resistencia SMD\ 1/8W 100R} & 0805 & AT0805DRD07100RL
\ addlinespace
1 & Microcontrolador &
mytab{Development Boards & \Kits -- ARM STM32} & - & NUCLEO-L432KC
\ addlinespace
1 & U3 &
mytab{LVDS Interface IC\ Single Full-Duplex} & SOIC-8 150mil & SN65LVDS179DR
\ addlinespace
1 & C8 &
mytab{MLCC Capacitor\ SI{10}{volt} SI{1000}{picofarad}} & 0402 & C0402C102J8RACTU
\ addlinespace
1 & U5 &
mytab{Ethernet Connectors\ Female 8P Vertical} & Through Hole & 615008138021
\ addlinespace
1 & C17 &
mytab{MLCC Capacitor\
SI{16}{volt} SI{1}{microfarad} X7R} & 0603 &
mytab{C0603X105M4-\RACAUTO} \
end{longtable}
endgroup
end{document}





share|improve this answer























  • Amazing! Thank you!
    – Xavier Pacheco Paulino
    Dec 29 '18 at 1:43














3












3








3






Two major issues with your code are (a) an unbelievable amount of code clutter, likely caused by the apparent use of tablegenerator.com to create the longtable code, and (b) the fact that it's much wider than the text block.



The following adjustments may go a long way toward fixing both issues: (i) I applied small (for a 10% linear reduction in font size), (ii) reduced the amount of intercolumn whitespace, and (iii) introduced many new line breaks within cells. I also (iv) removed all color-related directives, since they do nothing at all, and (v) switched from center-alignment of all cell contents to left (and top) alignment. I also tried to give the table a more open look by (vi) getting rid of all vertical lines and (vi) replacing most horizontal lines with whitespace.



A separate comment: I strongly recommend you load the siunitx package and use its SI macro to typeset scientific units and their associated numeric values. If you use SI consistently, you'll be assured that all units and numbers are typeset in a way that meets current scientific standards. I would also argue that writing, say, SI{1500}{microfarad} instead of $1500mu F$ makes the input a lot easier to read and, if necessary, debug.



The following screenshot shows just the first few lines of the full longtable.



enter image description here



documentclass[a4paper]{book}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[top=2cm, bottom=1.8cm,hmargin=2.5cm]{geometry}
usepackage[table]{xcolor}
usepackage{siunitx,booktabs}
usepackage{longtable}
newcommandmytab[1]{%
begin{tabular}[t]{@{}l@{}} #1 end{tabular}}

begin{document}
begingroup
small
setlengthtabcolsep{3pt}
begin{longtable}{@{} *{5}{l} @{}}
caption{My caption}
label{my-label}\
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endfirsthead

multicolumn{4}{@{}l}{tablename~ref{my-label}, cont'd}\[0.5ex]
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endhead

midrule
endfoot

bottomrule
endlastfoot

1 & AC/DC Converter &
mytab{Power Module\ SI{20}{watt}, SIrange{85}{264}{volt} in, \ SI{5}{volt} out, SI{4}{ampere}}
& -- & RAC20-05SK
\ addlinespace
7 &
mytab{TP1, TP2, TP3, TP4,\ TP5, TP6, TP7}
& Test points & SMD & 5019
\ addlinespace
7 &
mytab{AC1, AC2, AC3, AC4,\ AC5, M+, M$-$}
& Metal Terminals PCB & -- & 726386-2
\ addlinespace
1 & F1 &
mytab{Fusible Cerámica\ SI{25}{ampere}/250}
& 6.3$times$32mm & 0314025.MXP
\ addlinespace
2 & F1 (Clips) & Clips para fusible & -- & 01220083Z
\ addlinespace
1 & MOV1 & Varistor SI{150}{volt} SI{2.5}{kiloampere}
& Through Hole & B72210S0151K101
\ addlinespace
1 & R28 &
mytab{Termistor \ $2R SI{25}{ampere}}
& -- & SL32 2R025
\ addlinespace
1 & BR1 &
mytab{Puente Rectificador\ SI{35}{ampere}}
& -- & GBPC3506
\ addlinespace
1 & C1 &
mytab{Capacitor Aluminio\ SI{250}{volt} SI{1500}{microfarad}}
& Snap In & 380LX152M250A052
\ addlinespace
1 & C2 & mytab{MLCC Capacitor\ SI{630}{volt} SI{0.1}{microfarad} X7R}
& 2225 & C2225C104KBRACTU
\ addlinespace
1 & R7 & mytab{Resistencia SMD\100k/SI{1}{watt}}
& 2512 & AC2512JK-07100KL
\ addlinespace
4 &
mytab{LD1, LD2, LD3,\ LD6} & SMD LED Red Diffused & 0603
& mytab{EL-19-217/\R6C-ALM2VY/3T}
\ addlinespace
7 & mytab{R4, R6, R15, R9, \R36, R34, R18}
& mytab{Resistencia SMD\10k SI{1/8}{watt}}
& 0805 & AT0805BRD0710KL
\ addlinespace
4 & R1, R2, R11, R35 &
mytab{Resistencia SMD\174R SI{1/8}{watt}}
& 0805 & RC0805FR-07174RL
\ addlinespace
10 & mytab{R3, R14, R20, R21,\
R42, R38, R39, \R16, R17, R33}
& mytab{Resistencia SMD\1k SI{1/8}{watt} }
& 0805 & RT0805CRE071KL
\ addlinespace
1 & R5 & mytab{Resistencia SMD\39R SI{1/4}{watt}}
& 1206 & RT1206BRD0739RL
\ addlinespace
3 & Q1, Q2, Q3 & BJT NPN SI{0.6}{ampere} SI{40}{volt}
& SOT-23-3 & SST2222AHZGT116
\ addlinespace
1 & LD5 & Green SMD LED & 0603 & mytab{19-21SYGC/\S530-E2/TR8}
\ addlinespace

2 & VO1, VO2 & mytab{OPTOISOLATOR\SI{4.17}{kilovolt} TRIAC}
& 6-SMD & MOC3061SM
\ addlinespace
1 & TR1 & Triac SI{600}{volt} SI{35}{ampere}
& TO-220-2 & Q6035RH5
\ addlinespace
2 & C3, C4 &
mytab{Capacitor de película\ SI{0.01}{microfarad} SI{630}{volt}}
& Radial& BFC236969103
\ addlinespace
4 & R8, R10, R12, R13 &
mytab{Resistencia SMD\330R 1/8W}
& 0805 & RE0805FRE07330RL
\ addlinespace
1 & K1 & mytab{Relay SI{5}{volt} DC 1 Form C\(SPDT-NO, NC)}
& -- & ALQ105
\ addlinespace
1 & D6 & Fast Rectifier Diode SI{2.0}{ampere}
& mytab{SMB\ DO-214AA} & 512-ES2D
\ addlinespace
1 & TR2 & Triac 16 A 600 V & D2PAK & T1650-600G-TR
\ addlinespace
1 & LD4 & LED SMD Blue Water Clear & 0603 &
mytab{EL-19-21/\ BHC-AN1P2/3T}
\ addlinespace
1 & R24 & Resistencia SMD 680R 1/8W & 0805 & RC0805FR-07680RL
\ addlinespace
1 & U7 & Gate Drivers & PG-DSO-8-51 & 1EDI60N12AF
\ addlinespace
1 & U6 &
mytab{Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mA}
& SMD & R1SE-0512/H2-R
\ addlinespace
1 & U8 & Board Mount Current Sensors & PG-TISON-8-1 & TLI4970D050T5XUMA1
\ addlinespace
1 & Q4 &
mytab{IGBT TRENCHSTOP\ SI{600}{volt} SI{80}{ampere}}
& TO-247-3 & IKW50N60DTPXKSA1
\ addlinespace
1 & D5 &
mytab{Rectifiers SI{50}{A} SI{600}{volt}\ Ultrafast Diode}
& TO-247-2 & RURG5060-F085
\ addlinespace
10 & mytab{C5, C7, C9, C10, \C13, C15, C10, \
C16, C18, C19} &
mytab{MLCC capacitor\ SI{16}{volt} SI{0.1}{microfarad} X7R}
& 0603 & C0603C104J4RAC
\ addlinespace
3 & C6, C11, C12 &
mytab{Capacitor electrolítico\ SI{16}{volt} SI{100}{microfarad}}
& Radial Leaded & ULD1C101MED1TD
\ addlinespace
1 & C14 &
mytab{MLCC Capacitor\ SI{25}{volt} SI{1}{microfarad} X7R}
& 0805 & C0805C105J3RACTU
\ addlinespace
2 & R29, R30 & Resistencia SMD 10R 1/2W & 1210 & RC1210JR-0710RL
\ addlinespace
1 & R25 & Resistencia SMD 1/8W 100k & 0805 & RC0805DR-07100KL
\ addlinespace
1 & R26 & Resistencia SMD 1/8W 47k & 0805 & RT0805BRD0747KL
\ addlinespace
1 & R41 & Resistencia SMD 1/8W 20k & 0805 & AT0805BRD0720KL
\ addlinespace
1 & D11 & TVS Diodes 600W 5.0V & SMB & SMBJ5.0A-TR
\ addlinespace
1 & J1, J2 &
mytab{CONN HEADER VERT\ 3POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S03-ST-BA}
\ addlinespace
1 & U2 & Op Amps Dual 2.7V & SOIC-8 & MCP602-I/SN
\ addlinespace
3 & JP1, JP2, JP5 &
mytab{2.54mm Hdr 3P Single\ Str Gold} & Straight Pin
& mytab{Pin: 61300311121\ Jumper: 382811-8} \ addlinespace
1 & U1 & Analog Dual Comparators & SOIC-8 & LM393MX/NOPB
\ addlinespace
1 & J3 &
mytab{CONN HEADER VERT\ 4POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S04-ST-BA}
\ addlinespace
2 & R19, R22, R27 &
mytab{Resistencia SMD\ 1/8W 100R} & 0805 & AT0805DRD07100RL
\ addlinespace
1 & Microcontrolador &
mytab{Development Boards & \Kits -- ARM STM32} & - & NUCLEO-L432KC
\ addlinespace
1 & U3 &
mytab{LVDS Interface IC\ Single Full-Duplex} & SOIC-8 150mil & SN65LVDS179DR
\ addlinespace
1 & C8 &
mytab{MLCC Capacitor\ SI{10}{volt} SI{1000}{picofarad}} & 0402 & C0402C102J8RACTU
\ addlinespace
1 & U5 &
mytab{Ethernet Connectors\ Female 8P Vertical} & Through Hole & 615008138021
\ addlinespace
1 & C17 &
mytab{MLCC Capacitor\
SI{16}{volt} SI{1}{microfarad} X7R} & 0603 &
mytab{C0603X105M4-\RACAUTO} \
end{longtable}
endgroup
end{document}





share|improve this answer














Two major issues with your code are (a) an unbelievable amount of code clutter, likely caused by the apparent use of tablegenerator.com to create the longtable code, and (b) the fact that it's much wider than the text block.



The following adjustments may go a long way toward fixing both issues: (i) I applied small (for a 10% linear reduction in font size), (ii) reduced the amount of intercolumn whitespace, and (iii) introduced many new line breaks within cells. I also (iv) removed all color-related directives, since they do nothing at all, and (v) switched from center-alignment of all cell contents to left (and top) alignment. I also tried to give the table a more open look by (vi) getting rid of all vertical lines and (vi) replacing most horizontal lines with whitespace.



A separate comment: I strongly recommend you load the siunitx package and use its SI macro to typeset scientific units and their associated numeric values. If you use SI consistently, you'll be assured that all units and numbers are typeset in a way that meets current scientific standards. I would also argue that writing, say, SI{1500}{microfarad} instead of $1500mu F$ makes the input a lot easier to read and, if necessary, debug.



The following screenshot shows just the first few lines of the full longtable.



enter image description here



documentclass[a4paper]{book}
usepackage[T1]{fontenc}
usepackage[spanish,es-tabla,es-nodecimaldot]{babel}
usepackage[top=2cm, bottom=1.8cm,hmargin=2.5cm]{geometry}
usepackage[table]{xcolor}
usepackage{siunitx,booktabs}
usepackage{longtable}
newcommandmytab[1]{%
begin{tabular}[t]{@{}l@{}} #1 end{tabular}}

begin{document}
begingroup
small
setlengthtabcolsep{3pt}
begin{longtable}{@{} *{5}{l} @{}}
caption{My caption}
label{my-label}\
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endfirsthead

multicolumn{4}{@{}l}{tablename~ref{my-label}, cont'd}\[0.5ex]
toprule
textbf{Cantidad} & textbf{Designante} & textbf{Referencia} & textbf{Encapsulado} &
textbf{No. de parte}
\ midrule
endhead

midrule
endfoot

bottomrule
endlastfoot

1 & AC/DC Converter &
mytab{Power Module\ SI{20}{watt}, SIrange{85}{264}{volt} in, \ SI{5}{volt} out, SI{4}{ampere}}
& -- & RAC20-05SK
\ addlinespace
7 &
mytab{TP1, TP2, TP3, TP4,\ TP5, TP6, TP7}
& Test points & SMD & 5019
\ addlinespace
7 &
mytab{AC1, AC2, AC3, AC4,\ AC5, M+, M$-$}
& Metal Terminals PCB & -- & 726386-2
\ addlinespace
1 & F1 &
mytab{Fusible Cerámica\ SI{25}{ampere}/250}
& 6.3$times$32mm & 0314025.MXP
\ addlinespace
2 & F1 (Clips) & Clips para fusible & -- & 01220083Z
\ addlinespace
1 & MOV1 & Varistor SI{150}{volt} SI{2.5}{kiloampere}
& Through Hole & B72210S0151K101
\ addlinespace
1 & R28 &
mytab{Termistor \ $2R SI{25}{ampere}}
& -- & SL32 2R025
\ addlinespace
1 & BR1 &
mytab{Puente Rectificador\ SI{35}{ampere}}
& -- & GBPC3506
\ addlinespace
1 & C1 &
mytab{Capacitor Aluminio\ SI{250}{volt} SI{1500}{microfarad}}
& Snap In & 380LX152M250A052
\ addlinespace
1 & C2 & mytab{MLCC Capacitor\ SI{630}{volt} SI{0.1}{microfarad} X7R}
& 2225 & C2225C104KBRACTU
\ addlinespace
1 & R7 & mytab{Resistencia SMD\100k/SI{1}{watt}}
& 2512 & AC2512JK-07100KL
\ addlinespace
4 &
mytab{LD1, LD2, LD3,\ LD6} & SMD LED Red Diffused & 0603
& mytab{EL-19-217/\R6C-ALM2VY/3T}
\ addlinespace
7 & mytab{R4, R6, R15, R9, \R36, R34, R18}
& mytab{Resistencia SMD\10k SI{1/8}{watt}}
& 0805 & AT0805BRD0710KL
\ addlinespace
4 & R1, R2, R11, R35 &
mytab{Resistencia SMD\174R SI{1/8}{watt}}
& 0805 & RC0805FR-07174RL
\ addlinespace
10 & mytab{R3, R14, R20, R21,\
R42, R38, R39, \R16, R17, R33}
& mytab{Resistencia SMD\1k SI{1/8}{watt} }
& 0805 & RT0805CRE071KL
\ addlinespace
1 & R5 & mytab{Resistencia SMD\39R SI{1/4}{watt}}
& 1206 & RT1206BRD0739RL
\ addlinespace
3 & Q1, Q2, Q3 & BJT NPN SI{0.6}{ampere} SI{40}{volt}
& SOT-23-3 & SST2222AHZGT116
\ addlinespace
1 & LD5 & Green SMD LED & 0603 & mytab{19-21SYGC/\S530-E2/TR8}
\ addlinespace

2 & VO1, VO2 & mytab{OPTOISOLATOR\SI{4.17}{kilovolt} TRIAC}
& 6-SMD & MOC3061SM
\ addlinespace
1 & TR1 & Triac SI{600}{volt} SI{35}{ampere}
& TO-220-2 & Q6035RH5
\ addlinespace
2 & C3, C4 &
mytab{Capacitor de película\ SI{0.01}{microfarad} SI{630}{volt}}
& Radial& BFC236969103
\ addlinespace
4 & R8, R10, R12, R13 &
mytab{Resistencia SMD\330R 1/8W}
& 0805 & RE0805FRE07330RL
\ addlinespace
1 & K1 & mytab{Relay SI{5}{volt} DC 1 Form C\(SPDT-NO, NC)}
& -- & ALQ105
\ addlinespace
1 & D6 & Fast Rectifier Diode SI{2.0}{ampere}
& mytab{SMB\ DO-214AA} & 512-ES2D
\ addlinespace
1 & TR2 & Triac 16 A 600 V & D2PAK & T1650-600G-TR
\ addlinespace
1 & LD4 & LED SMD Blue Water Clear & 0603 &
mytab{EL-19-21/\ BHC-AN1P2/3T}
\ addlinespace
1 & R24 & Resistencia SMD 680R 1/8W & 0805 & RC0805FR-07680RL
\ addlinespace
1 & U7 & Gate Drivers & PG-DSO-8-51 & 1EDI60N12AF
\ addlinespace
1 & U6 &
mytab{Isolated DC/DC Converters \ 1W 05Vin 12Vout 84mA}
& SMD & R1SE-0512/H2-R
\ addlinespace
1 & U8 & Board Mount Current Sensors & PG-TISON-8-1 & TLI4970D050T5XUMA1
\ addlinespace
1 & Q4 &
mytab{IGBT TRENCHSTOP\ SI{600}{volt} SI{80}{ampere}}
& TO-247-3 & IKW50N60DTPXKSA1
\ addlinespace
1 & D5 &
mytab{Rectifiers SI{50}{A} SI{600}{volt}\ Ultrafast Diode}
& TO-247-2 & RURG5060-F085
\ addlinespace
10 & mytab{C5, C7, C9, C10, \C13, C15, C10, \
C16, C18, C19} &
mytab{MLCC capacitor\ SI{16}{volt} SI{0.1}{microfarad} X7R}
& 0603 & C0603C104J4RAC
\ addlinespace
3 & C6, C11, C12 &
mytab{Capacitor electrolítico\ SI{16}{volt} SI{100}{microfarad}}
& Radial Leaded & ULD1C101MED1TD
\ addlinespace
1 & C14 &
mytab{MLCC Capacitor\ SI{25}{volt} SI{1}{microfarad} X7R}
& 0805 & C0805C105J3RACTU
\ addlinespace
2 & R29, R30 & Resistencia SMD 10R 1/2W & 1210 & RC1210JR-0710RL
\ addlinespace
1 & R25 & Resistencia SMD 1/8W 100k & 0805 & RC0805DR-07100KL
\ addlinespace
1 & R26 & Resistencia SMD 1/8W 47k & 0805 & RT0805BRD0747KL
\ addlinespace
1 & R41 & Resistencia SMD 1/8W 20k & 0805 & AT0805BRD0720KL
\ addlinespace
1 & D11 & TVS Diodes 600W 5.0V & SMB & SMBJ5.0A-TR
\ addlinespace
1 & J1, J2 &
mytab{CONN HEADER VERT\ 3POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S03-ST-BA}
\ addlinespace
1 & U2 & Op Amps Dual 2.7V & SOIC-8 & MCP602-I/SN
\ addlinespace
3 & JP1, JP2, JP5 &
mytab{2.54mm Hdr 3P Single\ Str Gold} & Straight Pin
& mytab{Pin: 61300311121\ Jumper: 382811-8} \ addlinespace
1 & U1 & Analog Dual Comparators & SOIC-8 & LM393MX/NOPB
\ addlinespace
1 & J3 &
mytab{CONN HEADER VERT\ 4POS SI{2.54}{millimeter}}
& Through Hole &
mytab{SWR25X-NRTC-\ S04-ST-BA}
\ addlinespace
2 & R19, R22, R27 &
mytab{Resistencia SMD\ 1/8W 100R} & 0805 & AT0805DRD07100RL
\ addlinespace
1 & Microcontrolador &
mytab{Development Boards & \Kits -- ARM STM32} & - & NUCLEO-L432KC
\ addlinespace
1 & U3 &
mytab{LVDS Interface IC\ Single Full-Duplex} & SOIC-8 150mil & SN65LVDS179DR
\ addlinespace
1 & C8 &
mytab{MLCC Capacitor\ SI{10}{volt} SI{1000}{picofarad}} & 0402 & C0402C102J8RACTU
\ addlinespace
1 & U5 &
mytab{Ethernet Connectors\ Female 8P Vertical} & Through Hole & 615008138021
\ addlinespace
1 & C17 &
mytab{MLCC Capacitor\
SI{16}{volt} SI{1}{microfarad} X7R} & 0603 &
mytab{C0603X105M4-\RACAUTO} \
end{longtable}
endgroup
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 29 '18 at 1:35

























answered Dec 28 '18 at 21:45









Mico

274k30370756




274k30370756












  • Amazing! Thank you!
    – Xavier Pacheco Paulino
    Dec 29 '18 at 1:43


















  • Amazing! Thank you!
    – Xavier Pacheco Paulino
    Dec 29 '18 at 1:43
















Amazing! Thank you!
– Xavier Pacheco Paulino
Dec 29 '18 at 1:43




Amazing! Thank you!
– Xavier Pacheco Paulino
Dec 29 '18 at 1:43


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467674%2fissues-with-longtable-environment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Сан-Квентин

Алькесар

Josef Freinademetz