LaTeX 접근 방식을 사용하여 LyX 문서를 만듭니다. (LaTeX 코딩 및 LyX로 가져오기)

LaTeX 접근 방식을 사용하여 LyX 문서를 만듭니다. (LaTeX 코딩 및 LyX로 가져오기)

구체적인 질문: 저는 사용해 본 적이 없지만 제가 가장 좋아하는 편집기(예 : 텍스트 편집기 등)를 사용하여 작업한 다음 특별한 형식 지정 명령 없이 내 코드를 LyX(참고문헌 등 포함)에 추가할 LyX수 있는지 알고 싶습니다. LyX를 사용하여 만든 것처럼 보이고 편집 가능한 LyX 문서 작업입니다.LaTeXemacs

더 많은 일반사항:LaTeX위의 접근 방식을 사용하여 LyX 문서를 생성하는 동안 무엇을 해야 하고 무엇을 주의해야 합니까? 나는 다음과 같은 것을 상상할 수 있다는 것을 의미합니다.

  1. 간단한 수식과 텍스트로 코드를 복사한 다음 키를 누르고 이를 LyX 환경의 코드로 가져오고 문서가 예상대로 나타날 때까지 기다릴 수 있습니다.

  2. 방정식의 경우 새 상자를 열고 다른 텍스트와 별도로 방정식 내용을 추가해야 합니다.

  3. 테이블에 대해 위와 동일한 작업을 수행합니다(상상할 수 있는 더 간단한 LaTeX 명령을 사용하여 형식을 지정해 봅니다).

  4. 파일을 LyX로 가져오고 .bib1단계에서 어떻게든 가져옵니다(텍스트 코드가 있거나 LyX의 일반적인 LaTeX 동작이 예상되는 경우) \cite{key1}.\citep{key1}

LyX추신: 몇 가지 기본 요소를 생성하기 위해 코드 샘플을 사용하여 첫 번째 단계로 빈 문서를 생성한 다음 위 단계를 수행하는 방법을 확인하기 위해 LaTeX로 내보내는 것을 상상할 수 있습니다 . (예를 들어, \(\)또는 ... 을 사용해야 \[\]하지만 LyX를 사용한 적이 없기 때문에 일반적인 LyX 문서를 얻는 올바른 접근 방식을 실제로 알지 못합니다.)

편집하다:LyX에서 문제 없이 가져올 수 있는지 테스트하고 싶은 간단한 문서는 다음과 같습니다.

\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{natbib}
\begin{document}
This is a test file that we will try to import inside `LyX' document and we could or should expect the word ``LyX'' to be inside regular \LaTeX{} single and then double quotation marks. Also contains a variable $x_t$ with $t$ being the superscript.

\begin{table}
\begin{tabular}{|l|m{3cm}|c|p{4cm}|}
\hline
\textbf{No} & \textbf{Empty column}&\textbf{Centered}& \textbf{``Auto-Broken''}\\\hline
1 & &First row& This is a text that will span in two rows of $4\;cm$ maximum width\\\hline
2--3&\multicolumn{2}{c|}{\multirow{2}{*}{columns 3--3 centered}} & Text here not spaned\\\cline{4-4}
&\multicolumn{1}{c}{}&& Text here not spaned\\\hline
4& & Centered $F(x)$& Last spanned cell here with length of $4\;cm$\\\hline
\end{tabular}
\end{table}

According to citation~\cite{citation1} \citeauthor{citation2}, should have write that book~\citep{citation2} 

\bibliographystyle{apalike}
\bibliography{MyBib}

\end{document}

참고문헌 파일 MyBib.bib 사용:

@article{citation1,
author={Konstantinos Leledakis},
title={Nothing to say about it!},
year={2019},
journal={Never publishing\ldots}
}

@book{citation2,
author={Albert Einstein},
title={Never told this sh$\|$t!},
year={1920},
publisher={Should be published!}
}

출력은 그림과 비슷해야 합니다.

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

그리고 LyX 환경은 LyX 자체에서 생성된 것처럼 작동해야 합니다. 예를 들어, 표의 요소를 편집하거나 "변수"에서 실수로 "위 첨자"라고 명명한 아래 첨자를 변경할 수 있어야 합니다 x_t.

추신: multirow만약을 대비해 추가했지만... 문제가 발생하면 제거할 수 있습니다.

답변1

질문이 너무 많아서 완전한 답변은 아닙니다. :-)

따라서 시간이 지나면서 추가해야 할 수도 있습니다.

LyX는 Windows에서 레지스트리를 크게 가로채고 수정하며 GhostScript, dvipng, Perl 등과 같은 다른 구성 요소에도 많은 변형이 있기 때문에 작업 중인 TeX 시스템에 LyX를 설치하는 것을 조심해야 합니다.
synctex와 같은 기능 외에도 LyX에는 많은 차이점이 있습니다. 간단한 편집기가 작동하는 방식.

그러나 표준 텍스 조각의 경우\parbox:-) 여기에 이미지 설명을 입력하세요

TeX 가져오기는 즉시 생성됩니다.
여기에 이미지 설명을 입력하세요

93줄의 일반 텍스트 파일로 저장됩니다!! 설정의 전용 프리앰블과 유사하게 처음 75줄을 무시하면 마지막 몇 줄은 다음과 같습니다.

\end_header

\begin_body

\begin_layout Standard
\begin_inset Formula 
\[
q_{1}^{*}=\frac{\text{number of women who had their second birth in 1971}}{\text{\parbox{4.5cm}{\centering number of women who had their first birth in 1970}}-\text{\parbox{4cm}{\centering number of women had their second birth in 1970}}}
\]

\end_inset


\end_layout

\end_body
\end_document

따라서 이론적으로 매우 기본적인 독립 실행형 항목의 경우 작은 4라인 트레일러가 있는 사전 설정된 헤더를 추가하는 것이 쉬울 수 있습니다.

예를 들어 자체 설정이 있는 hyperref가 있는 더 복잡한 항목을 확인하는 유일한 방법은 사용자에게 가져오기를 시도하도록 제안한 다음 각 인터페이스 오류 상황을 천천히 해결하는 것입니다.


TeXworks를 통해 MWE를 실행하여 내 시스템이 작동하는지 확인하고 pdfLaTeX를 사용한 일반적인 첫 번째 단계에서는 bibtex 설정으로 컴파일해야 하며 PDF는 위의 예와 같습니다(다시 표시할 필요 없음) 참고 두 단계는 다음과 같습니다. 필수의.

템플릿 없이 LyX를 시작하고 단순히 tex 파일을 가져오면 이 보기가 생성되며 확장된 상자를 처리하는 데 약간의 잠재적인 차이가 있음을 알 수 있습니다. 여기에 이미지 설명을 입력하세요

그러나 확인 PDF를 얻으려면 보기를 한 번만 클릭하면 됩니다. 여기에 이미지 설명을 입력하세요  
 
테이블 속성 아이콘(Word/Excel에서와 마찬가지로)을 몇 번만 클릭하면 테이블 형식 출력을 수정하는 것이 매우 쉽습니다.

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

"라운드 트립"의 증거는 출력을 비교하는 것이며 LyX에는 여기에 표시된 대로 선택할 수 있는 여러 출력 선택 사항이 있습니다.

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

비교를 위한 적절한 선택으로 PdfLaTeX를 선택하면 이 새로운 TeX 파일을 얻게 됩니다.

%% LyX 2.3.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass{article}
\usepackage[latin9]{inputenc}
\usepackage{array}
\usepackage[authoryear]{natbib}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{multirow}
\usepackage{array}

\makeatother

\begin{document}
This is a test file that we will try to import inside `LyX' document
and we could or should expect the word ``LyX'' to be inside regular
\LaTeX{} single and then double quotation marks. Also contains a variable
$x^{t}$ with $t$ being the superscript.

\begin{table}
\begin{tabular}{|l|m{3cm}|c|p{4cm}|}
\hline 
\textbf{No}  & \textbf{Empty column} & \textbf{Centered} & \textbf{``Auto-Broken''}\tabularnewline
\hline 
1  &  & First row & This is a text that will span in two rows of $4\;cm$ maximum width\tabularnewline
\hline 
2--3 & \multicolumn{2}{c|}{\multirow{2}{*}{columns 3--3 centered}} & Text here not spaned\tabularnewline
\cline{1-1} \cline{4-4} 
 & \multicolumn{1}{c}{} &  & Text here not spaned\tabularnewline
\hline 
4 &  & Centered $F(x)$ & Last spanned cell here with length of $4\;cm$\tabularnewline
\hline 
\end{tabular}
\end{table}

According to citation~\citet{citation1} \citeauthor{citation2},
should have write that book~\citep{citation2}

 \bibliographystyle{apalike}
\bibliography{MyBib}

\end{document}

모든 일반 라텍스 옵션을 테스트하지 않고 이것이 최선인지는 알 수 없지만 표준 2패스 실행 후 매우 신뢰할 수 있는 출력을 생성하는 TeXworks에서 수정이 잘 작동합니다. 내가 알 수 있는 한, 렌더링된 표 형식 위치는 위의 수정된 PDF와 동일해야 합니다.

관련 정보