chronosys 타임라인, "일 월 연" 대신 "월 일, 연" 및 전체 숫자 날짜 질문

chronosys 타임라인, "일 월 연" 대신 "월 일, 연" 및 전체 숫자 날짜 질문

다음의 경우:

\documentclass{article}
\usepackage{chronosys}
\catcode`\@=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or March\or April\or%
 May\or June\or July\or August\or September\or October\or November\or December\fi}

\begin{document}

    \startchronology[startyear=15,stopyear=16]

\chronoevent{15/03/15}{Assassination of Caesar} 

     \stopchronology 

\end{document}

생산물:

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

타임라인 이벤트를 월, 일, 연도 형식(예: 2015년 3월 15일)으로 하는 것이 가능합니까?

또한 이 타임라인에 2015년부터 2016년까지 반영할 수 없습니다. 대신 한쪽 끝에는 "15", 다른 쪽 끝에는 "16"이 붙어 있는 것 같습니다.

내가 사용하여 시도했을 때 :

    \startchronology[startyear=2015,stopyear=2016]

프로그램은 연대기에 날짜를 전혀 반영하지 않았습니다.

그만큼chronosys 패키지 문서, 나에게는 도움이되지 않는 것 같습니다.

감사합니다. 현재 패키지 자체에 따른 날짜 형식이 문제인 경우 해당 정보를 알려주시면 감사하겠습니다.

답변1

@JP-Ellis가 이미 완벽하게 답변했으므로 첫 번째 문제에 대해서는 언급하지 않겠습니다. 그러나 날짜 형식을 변경하기 위해 코드를 패치하는 것은 코드가 chronosys약간 지저분하기는 하지만 그다지 어렵지 않습니다. @JP-Ellis는 이미 올바른 파일과 줄을 알아냈으므로 여기에 날짜 형식을 변경하는 패치가 있습니다.

\documentclass{article}
\usepackage{chronosys}
\usepackage{etoolbox}

\makeatletter\catcode`\!=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or March\or April\or%
 May\or June\or July\or August\or September\or October\or November\or December\fi}

\patchcmd{\dochronoevent}{%
\if!chreventdate\hbox to\z@{%
  \hss \if!chreventifcolorbox \expandafter\!chreventcolorbox\fi
  {\!chr@eventdatestyle{%
    \if!chreventspecifiedday %
      {\!chr@eventdatesstyle{\!chreventday}}\!chr@eventdatesseparation
    \fi
  {\!chr@eventdatesstyle{%
    \if!chreventspecifiedmonth 
      \if!chreventconversionmonth\expandafter \chron@selectmonth
      \fi 
      \!chreventmonth
    \fi
    }%
  }%
  \if!chreventspecifiedmonth\if!chreventyear \!chr@eventdatesseparation\fi\fi 
  \if!chreventyear{\!chr@eventdatesstyle{\!chreventyear}}\fi%
  }}%
  \hss
}%
\fi
}{%
\if!chreventdate\hbox to\z@{%
  \hss \if!chreventifcolorbox \expandafter\!chreventcolorbox\fi
  {\!chr@eventdatesstyle{%
    \if!chreventspecifiedmonth 
      \if!chreventconversionmonth\expandafter\chron@selectmonth
      \fi 
      \!chreventmonth\!chr@eventdatesseparation%
    \fi
    }%
  {\!chr@eventdatestyle{%
    \if!chreventspecifiedday%
      {\!chr@eventdatesstyle{\!chreventday}},%
    \fi%
  }%
  \if!chreventspecifiedmonth\if!chreventyear\!chr@eventdatesseparation\fi\fi 
  \if!chreventyear{\!chr@eventdatesstyle{\!chreventyear}}\fi%
  }}%
  \hss
}%
\fi
}{%
\message{Patching chronosys successful.}%
}{%
\message{Patching chronosys failed.}%
}
\makeatother


\begin{document}

\startchronology[startyear=2015,stopyear=2016]
\chronoevent{15/03/2015}{Assassination of Caesar} 
\stopchronology 

\end{document}

산출:

크로노시스

답변2

chronosys위의 댓글에서 언급했듯이 날짜를 수정하는 방법은 제공되지 않는 것으로 보이 므로 날짜 수정이 어려울 것 같습니다 . 결과적으로 이 작업을 수행하는 유일한 방법은 패키지 자체의 일부를 수정하는 것입니다. (내가 알 수 있듯이 날짜 인쇄는 의 513번째 줄에서 시작되지만 chronosyschr.tex나에게는 불필요하게 복잡해 보입니다.)

이제 나타나지 않는 이벤트와 관련하여 패키지가 전체 1년을 예상하기 때문인 것 같습니다. 즉, 15/03/2015그렇지 않으면 날짜를 15년으로 등록할 것으로 예상합니다.

\documentclass{article}
\usepackage{chronosys}

\makeatletter
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or March\or April\or%
  May\or June\or July\or August\or September\or October\or November\or December\fi}

\begin{document}
\startchronology[startyear=2010,stopyear=2016]
  \chronoevent{4/7/2012}{Discovery of the Higgs boson}
\stopchronology
\startchronology[startyear=10,stopyear=16]
  \chronoevent{19/8/14}{Augustus, the first Roman emperor, dies and is declared to be a god}
\stopchronology 
\end{document}

산출

답변3

에 대한 자세한 내용은 다음 chronos에서 확인할 수 있습니다.이 답변.

크로노스의 현재 버전은 다음에서 구할 수 있습니다:
https://tex.stackexchange.com/a/342699/ (2016-12-06)

그만한 가치가 있으므로 chronos이제 이 작업을 보다 쉽게 ​​수행할 수 있습니다.

      date format={ B d, Y},

형식의 각 문자는 날짜 형식의 요소로 변환되거나 있는 그대로 전달됩니다. 여기에는 구두점과 공백이 포함됩니다. (매크로가 토큰별로 분류되어 '번역'되므로 여기서는 매크로 등이 작동하지 않습니다.)

형식 코드는 대부분 GNU date명령에서 제공하는 형식 코드의 하위 집합이며 GNU와 관련되지 않은 몇 가지 추가 항목이 있습니다.

  • a짧은 요일 이름(예:Mon
  • A전체 요일 이름(예:Monday
  • b짧은 월 이름(예:Jan
  • B전체 월 이름 예:January
  • d해당 월의 날짜 예:23
  • E시대 예 BCE: 또는CE
  • m월 번호 예:01
  • q연도가 BCE인 경우 빼기
  • Q연도가 BCE이면 빼기;
  • y연도의 마지막 두 자리 예:66
  • Y연도 예:1066

기본적으로 이는 이벤트 날짜를 조판하는 데 사용되는 코드를 사용자 정의합니다. 이 형식의 축소 버전을 사용하여 타임라인 자체의 연도 레이블 모양을 사용자 정의할 수도 있습니다. 연도를 포함 CE하거나 BCE연도를 포함하는 혼란을 피하기 위해 타임라인의 각 끝에 시대 레이블을 추가할 수도 있습니다 .

따라서 타임라인은 다음과 같이 조판될 수 있습니다:

\begin{tikzpicture}
  [
    chronos={%
      start date=2015-01-01,
      end date=2016-01-01,
      timeline height=2.5mm,
      timeline width=100mm,
      timeline line={shorten >=-10mm, -{Triangle Cap[length=10mm]}},
      timeline years=above,
      date format={ B d, Y},
    }
  ]
  \chronosevent{2015-03-15}{Assassination of Caesar}
\end{tikzpicture}

생산하다

타임라인

기본적으로 더 이상 0년이 없지만 필요한 경우 를 사용하여 복원할 수 있습니다 year zero.

관련 정보