KTUG마당은 KTUG를 방문하는 모든 이용자가 대화를 나누고 소식을 전하는 곳입니다.

  • 로그인 없이 자유롭게 글을 읽고 쓸 수 있는 철학은 처음과 같이 계속됩니다.
  • Team Blog의 글을 이곳 게시판의 "정보글"로 모았습니다. Team blog는 기고자가 올린 글에 질문을 받는 부담을 줄이기 위하여 댓글을 허용하지 않았습니다. 그러나 이곳 게시판으로 모으면서 댓글을 달 수 있습니다. 게시물을 작성하실 때 댓글을 원하지 않으시면 댓글을 허용하시지 않으시기를 바랍니다. 또한 불필요한 소모성 댓글을 달지 않도록 주의하여 주시기를 바랍니다.
  • TeX과 관련된 질문이나 답변은 QnA 마당을 이용하십시오. TeX과 관련된 질문은 지웁니다
  • MathJax를 이용한 수식조판을 사용하실 수 있습니다. 여기를 참조하세요.
  • 스팸 글을 막기 위하여 짧은 시간 내에 다시 글이 등록되는 IP를 막거나, 광고 글을 막기 위하여 금지어로 .com, .net 등을 설정하고 있습니다. 다소간의 불편함이 있으시더라도 양해 바랍니다.
    • 금지어에서 stackexchange, stackoverflow, ctan, overleaf, , github, google.com, gmail.com, .org, .io, sil.org, wiki.com, tistory.com등은 해제하였습니다.
  • 사용하는 편집기는 CKeditor입니다. 편집기에서 [enter]를 누르면 <p> 태그가 들어가고, 문단으로 생각하고 한줄을 비웁니다. 글줄만 바꾸려면 shift-enter 를 누르시면 <BR>가 들어가므로 용도에 맞게 나누어 쓸 수 있습니다.

자유글 minipage의 parskip이 tikz에 미치는 영향

2009.12.23 13:27

이호재 조회 수:39653

질문게시판에 올려야 할 듯하지만, 문제의 원인을 알았기 때문에 달리 회피하는 방법을 취하여 일단 문제를 해결하였습니다.

재미삼아 봐주십시오.


일전에 재미삼아 만든 원문자 매크로에서 

\abnormalparskip{.25\baselineskip} 등으로 minipage안에 \parskip을 달리 설정하여 주면 \tikz\node에 영향을 준다는 것을 알게 되었습니다.


파일 첨부가 안 되나요?

컴파일 해 보시고 각 단락에서 박스의 높이의 차이에 주목해 주시기 바랍니다.


\documentclass[openany,9pt,showtrims]{memoir} 
%\usepackage{hoze-style}
\usepackage{ifluatex}
\usepackage{xkeyval}
\usepackage{xifthen}
\usepackage{xcolor}
\usepackage{tikz}

\makeatletter
\newcommand\wrapnumfont{\wrapnumbf}
\newcommand\wrapnumbf{\bfseries}
\newcommand\wrapnumbase{}
\newlength\wrapnumwidth
\newlength\wrapsep
\setlength\wrapsep{1.5pt}
\newcommand\wrapbgcolor{black}
\newcommand\wrapfgcolor{white}

\newcommand\cirnum[1]{%  
   \raisebox{-.25\baselineskip}{
   \tikz\node[%
   circle, draw=\wrapfgcolor, thin, inner sep=.1\wrapsep,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}


\newcommand\ovalnum[1]{%  
   \raisebox{-.15\baselineskip}{
   \tikz\node[%  
   rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
   rounded corners=3pt,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}

\newcommand\recnum[1]{%  
   \raisebox{-.15\baselineskip}{
   \tikz\node[%
   rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}

\define@key{wrapnum}{base}{%
\renewcommand\wrapnumbase{#1}%
\setwrapnumwidth%
}
\define@key{wrapnum}{font}{%
\renewcommand\wrapnumfont{\wrapnumbf#1}%
\setwrapnumwidth%
}

\newcommand\setwrapnumwidth{%
\settowidth\wrapnumwidth{\wrapnumfont\wrapnumbase}%
}

\define@key{wrapnum}{type}[circle]{%
\ifthenelse{\equal{#1}{circle}}{\let\wrapnum\cirnum}{}%
\ifthenelse{\equal{#1}{rectangle}}{\let\wrapnum\recnum}{}%
\ifthenelse{\equal{#1}{oval}}{\let\wrapnum\ovalnum}{}%
}

\define@key{wrapnum}{background}{
\renewcommand\wrapbgcolor{#1}
}

\define@key{wrapnum}{foreground}{
\renewcommand\wrapfgcolor{#1}
}

\define@key{wrapnum}{color}{%
\ifthenelse{\equal{#1}{white}}{%
\renewcommand\wrapbgcolor{white}%
\renewcommand\wrapfgcolor{black}%
\renewcommand\wrapnumbf{}%
}{}%
\ifthenelse{\equal{#1}{black}}{%
\renewcommand\wrapbgcolor{black}%
\renewcommand\wrapfgcolor{white}%
\renewcommand\wrapnumbf{\bfseries}%
}{}%
}

\define@key{wrapnum}{wrapseparate}{%
\setlength\wrapsep{#1}%
}

\newcommand\setwrapnum[1]{%
\setkeys{wrapnum}{#1}%
}

\setwrapnum{%
type=rectangle,
base=99,
}

\ifluatex
\newcommand\wrapchar[2][]{%
  \setwrapnum{#1}
  \@wrapchar#2|%
}
\def\@wrapchar#1|{%
 \directlua{%
    local utf8 = unicode.utf8
    str = "#1"
    for i=1, utf8.len(str) do
     char=utf8.sub(str, i, i)
     if char==' ' then
     macro = "\string\\hspace{0.25em}"
     else
     macro = "\string\\wrapnum{"..char.."}\string\\hspace{-0.25em}"
     end
     tex.print(macro)
    end
 }%
}
\fi
\makeatother

\begin{document}

\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\bigskip

\abnormalparskip{.25\baselineskip}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\abnormalparskip{2ex}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\end{document}

번호 제목 글쓴이 날짜 조회 수
286 자모에 색 입히기 [4] file yihoze 2019.02.13 7702
285 오늘 발표한 hmltotex 관련 자료입니다. [9] file hmltotex 2019.02.16 10480
284 논문쓰실 때 LaTex 이용하시는 분들 괜찮은 워크샵이 있는 것 같아서 공유드려요! [5] 소미 2019.02.18 7840
283 팀블로그 게시판 권한에 대하여 [2] Kriss 2019.02.18 6833
282 [expl3] 살아온 날은 며칠? [3] file noname 2019.02.26 7792
281 임명장 템플릿 [2] file yihoze 2019.03.06 7833
280 파이데이 이야기 [1] file noname 2019.03.14 42049
279 이분.. 양반은 못되시는듯 합니다... [1] 불량양파 2019.03.23 7817
278 최현배 한글 풀어쓰기 [21] file Tzetachi 2019.04.13 27270
277 [Expl3] 소인수분해 [3] file noname 2019.04.28 7689
276 TexLive 2019 릴리즈 [7] Dennis 2019.05.02 14543
275 TeX Live 2019와 xindex [3] file noname 2019.05.04 7124
274 [소식] lshort korean 2019 릴리스 [6] noname 2019.05.08 7826
273 grruby와 "선언서" [2] file noname 2019.05.17 7296
272 루비 [5] file noname 2019.05.22 7144
271 parallel pages, parallel columns, and progress [7] file noname 2019.05.30 6744
270 LuaLaTeX을 활용한 고서적 조판 [8] file 옛한글 2019.06.13 7304
269 stackexchange.com sourceforge.net 등의 도메인은 게시물에 사용하실 수 있습니다. 관리자 2019.07.10 6773
268 TeX Template 제작이 가능한 분을 찾고 있습니다. (완료) [2] 윤세은 2019.07.15 6095
267 메무아 매뉴얼 서문의 1890년대풍 번역 [4] file noname 2019.07.16 6834



XE Login