2013-08-11 2 views
1

최근 CSS에 대한 숭고한 텍스트 블록 설명을 계속하기 위해 훌륭한 스크립트를 사용하여 게시물을 발견했습니다. Here. 환경 고유의 키 바인딩 파일에 추가하면 매력처럼 작동합니다. 그러나 라텍스 설명과 함께 사용하려고 변경하면 (예 : *를 %로 대체) 작동하지 않습니다.라텍스 Sublime Text 2의 구문 특정 블록 주석

원본 코드 :

{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n * "}, 
"context": 
    [ 
     {"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
     "operand": "\\/\\*\\*$", "match_all": true} 
    ] 
}, 
{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n* "}, 
"context": 
    [ 
     //{"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
     "operand": "^[\t ]*\\*[^\\/]", "match_all": true} 
    ] 
}, 

내 코드 :

{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n % "}, 
"context": 
    [ 
     {"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
     "operand": "\\/\\%\\%$", "match_all": true} 
    ] 
}, 

{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n % "}, 
"context": 
    [ 
     //{"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
     "operand": "^[\t ]%\\%[^\\/]", "match_all": true} 
    ] 
}, 
+0

'작동하지 않음'을 정의하십시오. '*'는'선행하는 토큰을 0 번 이상 매치'하는 것을 의미하는 수량 화기이다. 그것은 또한 상당히 모호합니다. 나는이 스크립트가 무엇을 해야하는지를 의미합니다. 두 가지 경우에 대한 정보를 입력 할 수 있습니까? – HamZa

+0

블록 주석 섹션 내의 각 줄마다 %를 추가해야합니다. 즉, 주석 문자 (*에 css, %는 latex)가 있는지 확인합니다. 에 의해 작동하지 않는, 그것은 아무것도 추가 의미. 그러나 처음에는 *가 추가됩니다. – Nick

+0

라텍스의 의견은 무엇입니까? 그것은'/ % 이것은 주석/%입니까? '입니까? – HamZa

답변

1

좋아, 그래서 내가하려고했던 것과 두 가지 주요 결함이 있었다. 첫째, 실제로 정규 표현식에 실수를하고 너무 많은 것을 대체했습니다. 둘째, 원래의 코드 내가 머리글과 바닥 글로 (내장되지 않은)에 대한 블록을 한 거라고 라텍스 블록 주석의 스타일 반면

/* 
* 
* 
*/ 

스타일 의견을 차단할가 CSS를 위해이었다 주석의 한계를 정의하고이 포함 된 텍스트를 유지하는 것은 또한, 주석 될 예 :

%%%%%%%%%%%% Comment Section Start %%%%%%%%%%%% 
    %%% Comments here 
%%%%%%%%%%%% Comment Section Ends %%%%%%%%%%%% 

양쪽 라텍스 대해이 작업을 수행 할 수 있습니다 다음 R과 동등한을 수정할 수 있습니다 코멘트 할 수 있도록 신속하고 일관되게 추가 될 수 있습니다. 머리글과 바닥 글 섹션을 추가하는 스 니펫과 함께 사용합니다.

// 
{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n%%%\t"}, 
"context": 
    [ 
     {"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
     "operand": "\t*%%%.*$", "match_all": true} 
    ]}, 

{"keys": ["enter"], "command": "insert", "args" : {"characters": "\n%%%\t"}, 
"context": 
    [ 
     //{"key": "selection_empty", "operator": "equal", "operand": true}, 
     {"key": "preceding_text", "operator": "regex_contains", 
      "operand": "\t*%%%", "match_all": true} 
    ]}, 

유용한 의견을 주셔서 감사합니다 !!

관련 문제