프레임에 두 개의 텍스트 열 추가

프레임에 두 개의 텍스트 열 추가

저는 Latex와 Lyx를 처음 사용합니다. 저는 Lyx에서 2개의 열을 포함하는 프레임을 만들려고 합니다. 첫 번째 열은 JSON 형식의 텍스트이고 두 번째 열은 첫 번째 열의 줄에 대한 주석입니다. 지금까지 저는 JSON 텍스트에 다음과 같은 스타일을 추가하기 위해 minted를 사용하고 있습니다. 내가 가진 것 1 첫 번째 문제는 일부 줄이 너무 크다는 것입니다. 실제로는 필요하지 않기 때문에 대부분의 내용을 수동으로 잘라서 줄을 줄일 수 있습니다. 결과는 다음과 같습니다. 내가 가진 것 2 제가 정말로 만들고 싶은 것은 다음과 같습니다. 하지만 이 작업을 여러 번 수행해야 하기 때문에 수동으로 수행하지 않아도 됩니다. 내가 원하는 것 내가 요구하는 것이 LaTeX나 Lyx를 사용하여 가능한지 잘 모르겠지만 어떤 아이디어라도 정말 감사드립니다.

나는 본 적이이것게시했지만 해당 답변을 내 상황에 맞게 적절하게 사용하는 방법을 모르겠습니다.

답변1

minted어디에서나 줄 바꿈을 허용하도록 설정할 수 있습니다 . 그리고 빈 줄을 추가하여 양쪽 텍스트를 정렬하세요. 이것이 당신이 원하는 것인지 살펴보셨나요? 질문이 있으면 알려주세요.

\documentclass{beamer}
\usepackage{xcolor}
\usepackage{minted}

\begin{document}
\begin{frame}[fragile]{Frame Title}
\begin{columns}[t] % align text from top 
\begin{column}{0.5\linewidth}
\begin{scriptsize}
\begin{minted}[
bgcolor=lightgray!20, % add background color
breaklines, % allow line break
breakanywhere, % allow line break at anywhere
]
{c}
{
    "public_properties": {
        "name": "Name",
        "info": "Some Info Here",
        "value": 34.5
    },
    "private properties": {
        "id": "12",
        "authkey": "aVeryLongKeyThatItSProbablyTooLongToccupyOnlyOneLineAndINeedToShowOn"
        "timestamp": "20200101T23:00:00"


        "signedonclient": true
    }
}
\end{minted}
\end{scriptsize}
\end{column}
\begin{column}{0.5\textwidth}
\begin{scriptsize}
\begin{minted}[
bgcolor=lightgray!20, % add background color
breaklines, % allow line break
breakanywhere, % allow line break at anywhere
escapeinside=@@ % add empty lines using @@
]
{c}
@@
//Public properties
//This is the name
//This is a short information
//This is the actual value

//Private properties
//This is the ID
//This is a very long authentication key


//This is only the timestamp but I'm doing it very long on purpose so the line jump is noticed
//Indicates if the client is signed
@@
\end{minted}
\end{scriptsize}
\end{column}
\end{columns}
\end{frame}
\end{document}

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

관련 정보