tabularx 환경에서 점선을 만드는 방법

tabularx 환경에서 점선을 만드는 방법

나는 이것을 조사해 왔으며 두 가지 주요 "해결책"을 발견했습니다.

\usepackage{arydshln}

설명된 대로여기.

그리고 이것:

\usepackage{dashrule}

에 설명된 대로이번 다른 포스팅.

그러나 다음 패키지를 로드 중이므로 다음과 같습니다.

\usepackage{array}
\usepaclage{tabularx}
\usepackage{longtable}
\usepackage{tabu}

arydshlnnor 도 사용할 수 없는 것 같습니다 dashline.

왜 이런 일이 발생하는지 아시나요? 내 내부에 점선 수평선을 어떻게 얻을 수 있습니까 tabularx?동시에-환경 내부 table?

이것이 내가 가진 것입니다:

\documentclass{article}

\usepackage{multirow}
\usepackage{array}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{tabu}


\begin{document}
Hello.

\begin{longtabu}{l p{0.8\linewidth}}
WHO                 &   \hspace{5mm} World Health Organization\\[1mm]
GDP                 & \hspace{5mm} Gross Domestic Product\\[1mm]
PPP                 & \hspace{5mm} Purchasing Power Parities\\[1mm]

\end{longtabu}

\begin{table}\tiny
    \caption{Muscles of the thigh}
    \newcolumntype{Y}{>{\raggedright\arraybackslash}X}
    \begin{tabularx}{\textwidth}{YYYYY}
        Muscle & Origin & Insertion& Nerve & Action \\
        \firsthline\\
            \textbf{Anterior Compartment}   & & &   &   \\[3mm]

            Quadriceps femoris                                                                                          &
            Rectus Femoris: anterior inferior iliac spine. Vastus Lateralis: greater trochanter and linea aspera of femur. Vastus Intermedius: body of femur.  Vastus Medialis: linea aspera of femur                &
            Patella and onto tibial tuberosity through patellar ligament        &
            Femoral                                                                                                                 &
            Extends knee; rectus femoris also flexes hip\\\\

            Sartorius                                                                                                               &
            Anterior superiro iliac spine                                                                       &
            Medial side of tibial tuberosity                                                                &
            Femoral                                                                                                                 &
            Flexes hip and knee; rotates thigh laterally and leg medially\\\\

            \hline\\% I want this line to be dashed
            \textbf{Medial Compartment} & & &   &   \\[3mm]

            Adductor brevis                                                                                                 &
            Pubis                                                                                                                       &
            Pectineal line and linea aspera of femur                                                &
            Obturator                                                                                                               &
            Adducts, laterally rotates thigh; flexes hip\\\\

            Adductor longus                                                                                                 &
            Pubis                                                                                                                       &
            Linea aspera of femur                                                                                       &
            Obturator                                                                                                               &
            Adducts, laterally rotates thigh; flexes hip\\\\

            \lasthline\\
    \end{tabularx}
    \label{tab:ThighMuscles2}
\end{table} 


\end{document}

\dashrule이제 where the is를 사용하면 \hline( dashrule물론 패키지를 로드한 후)정의되지 않은 제어 순서오류.

\hdashline(패키지의 ) 을 사용하면 arydshln내 문서의 다른 테이블을 가리키는 101 오류가 발생하므로 로드한 다른 패키지와의 비호환성과 관련이 있는 것으로 추측됩니다.

답변1

여기에 이미지 설명을 입력하세요

나에게는 오류 없이 작동했지만, 작동하지 않으면 문제를 보여주는 예제를 만들어야 합니다.

\documentclass{article}

\usepackage{multirow}
\usepackage{array}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{arydshln}

\begin{document}
Hello.

\begin{table}\tiny
    \caption{Muscles of the thigh}
    \newcolumntype{Y}{>{\raggedright\arraybackslash}X}
    \begin{tabularx}{\textwidth}{YYYYY}
        Muscle & Origin & Insertion& Nerve & Action \\
        \firsthline\\
            \textbf{Anterior Compartment}   & & &   &   \\[3mm]

            Quadriceps femoris                                                                                          &
            Rectus Femoris: anterior inferior iliac spine. Vastus Lateralis: greater trochanter and linea aspera of femur. Vastus Intermedius: body of femur.  Vastus Medialis: linea aspera of femur                &
            Patella and onto tibial tuberosity through patellar ligament        &
            Femoral                                                                                                                 &
            Extends knee; rectus femoris also flexes hip\\\\

            Sartorius                                                                                                               &
            Anterior superiro iliac spine                                                                       &
            Medial side of tibial tuberosity                                                                &
            Femoral                                                                                                                 &
            Flexes hip and knee; rotates thigh laterally and leg medially\\\\

            \hdashline\\% I want this line to be dashed
            \textbf{Medial Compartment} & & &   &   \\[3mm]

            Adductor brevis                                                                                                 &
            Pubis                                                                                                                       &
            Pectineal line and linea aspera of femur                                                &
            Obturator                                                                                                               &
            Adducts, laterally rotates thigh; flexes hip\\\\

            Adductor longus                                                                                                 &
            Pubis                                                                                                                       &
            Linea aspera of femur                                                                                       &
            Obturator                                                                                                               &
            Adducts, laterally rotates thigh; flexes hip\\\\

            \lasthline\\
    \end{tabularx}
    \label{tab:ThighMuscles2}
\end{table} 


\end{document}

업데이트된 예제에서는 다음 으로 longtabu변경하면 작동합니다. 패키지 에는 몇 가지 좋은 아이디어가 있지만 불행하게도 표준 라텍스 배열 패키지 구문을 잘못 정의합니다(이것은 버그가 아니라 의도적으로 문서화된 패키지 기능입니다). 기타 비호환성이 있습니다. , 그래서 종종 "금기의 방식"으로 가서 해당 패키지의 기능을 사용하거나 다음과 같은 패키지 조합을 사용해야 합니다.longtabulongtabletabu>{..}~이다동시에 사용할 때 협력하고 충돌하지 않도록 설계되었습니다.

관련 정보