Saturday, July 4, 2015

"Catatan Pinggir" pada Teks

Setelah saya ulas tentang cara menyoroti suatu teks, kali ini saya ajak Anda untuk memberikan "catatan", tanggapan/komentar, atau keterangan terhadap suatu teks, seperti tampak pada gambar di samping.

Cara yang saya tunjukkan di bawah ini dibuat oleh Peter Grill, seorang anggota forum. Meskipun cara ini (sebagaimana disebutkan sendiri oleh penulisnya) sangat tidak memuaskan, karena memerlukan terlalu banyak pengaturan (tweaking) pada paramaternya untuk menempatkan teks komentar, tetapi paling tidak cara ini cukup membantu dalam penggunaannya. 

Pada contoh dokumen di bawah ini, saya terapkan cara tersebut pada naskah carita pondok (carpon, bahasa Sunda) yang saya peroleh dari YasfiMaziya di sini.

Ada dua paket utama yang kita perlukan untuk hal ini, yaitu
\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{calc,fit, decorations.pathmorphing}
Langkah awal adalah membuat garis sebagai "goresan tangan" berbentuk kotak (persegi panjang) oleh makro
\makeatletter
% http://tex.stackexchange.com/questions/39296/simulating-hand-drawn-lines
\pgfdeclaredecoration{penciline}{initial}{
    \state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance,auto corner on length=1mm,]{
        \pgfpathcurveto%
        {% From
            \pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}
                            {\pgfdecorationsegmentamplitude}
        }
        {%  Control 1
        \pgfmathrand
        \pgfpointadd{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
                        {\pgfqpoint{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
                                        {\pgfmathresult\pgfdecorationsegmentamplitude}
                        }
        }
        {%TO 
        \pgfpointadd{\pgfpointdecoratedinputsegmentlast}{\pgfpoint{1pt}{1pt}}
        }
    }
    \state{final}{}
}
\makeatother
Kemudian menyiapkan perintah untuk menandai teks yang akan dikomentari.
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\CommentText}[3]{\tikzmark{#1}#3\tikzmark{#2}}
Terakhir, menyiapkan perintah untuk "menyisipkan" komentar itu di antara naskah utama (main body) pada dokumen.
\NewDocumentCommand{\CommentPar}{%
    O{}% #1 = draw options for the referenced word
    O{}% #2 = draw options for the comment
    O{}% #3 = draw options for the connecting line
    m  % #4 = left \tikzmark name
    m  % #5 = left \tikzmark name
    m  % #6 = comment
    }{%
    \begin{tikzpicture}[overlay,remember picture,decoration=penciline, thick]
        \node [shape=rectangle,inner sep=0, draw=blue, ,rounded corners=2pt, fit={(#4.south) ($(#5.north)+(0,0.75ex)$)}, decorate, #1] (Source) {};
        \node at ($(#4)!0.5!(#5)$) [blue, font=\itshape, rounded corners=5pt, decorate, #2] (Label) {#6};
        \draw [draw=red, decorate, #3] (Label) to (Source);
    \end{tikzpicture}
}
Bagaimana menggunakan cara ini pada dokumen? Berikut ini contoh dokumen yang saya buat.
Demikian semoga bermanfaat. 

Adjie Gumarang Pujakelana 2015
\documentclass[a4paper,10pt]{article}
%http://tex.stackexchange.com/questions/78979/how-can-i-put-real-notes-in-the-margin
\usepackage{geometry}
\geometry{left=20mm,right=20mm,top=25mm,bottom=20mm,%
  heightrounded,% better use it
}
\usepackage[svgnames,dvipsnames]{xcolor}
\usepackage[indonesian]{babel}
\usepackage{gentium}
\usepackage{ragged2e,url}
\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{calc,fit, decorations.pathmorphing}

\makeatletter
% http://tex.stackexchange.com/questions/39296/simulating-hand-drawn-lines
\pgfdeclaredecoration{penciline}{initial}{
    \state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance,auto corner on length=1mm,]{
        \pgfpathcurveto%
        {% From
            \pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}
                            {\pgfdecorationsegmentamplitude}
        }
        {%  Control 1
        \pgfmathrand
        \pgfpointadd{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
                        {\pgfqpoint{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
                                        {\pgfmathresult\pgfdecorationsegmentamplitude}
                        }
        }
        {%TO 
        \pgfpointadd{\pgfpointdecoratedinputsegmentlast}{\pgfpoint{1pt}{1pt}}
        }
    }
    \state{final}{}
}
\makeatother

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\newcommand{\CommentText}[3]{\tikzmark{#1}#3\tikzmark{#2}}

\NewDocumentCommand{\CommentPar}{%
    O{}% #1 = draw options for the referenced word
    O{}% #2 = draw options for the comment
    O{}% #3 = draw options for the connecting line
    m  % #4 = left \tikzmark name
    m  % #5 = left \tikzmark name
    m  % #6 = comment
    }{%
    \begin{tikzpicture}[overlay,remember picture,decoration=penciline, thick]
        \node [shape=rectangle,inner sep=0, draw=blue, ,rounded corners=2pt, fit={(#4.south) ($(#5.north)+(0,0.75ex)$)}, decorate, #1] (Source) {};
        \node at ($(#4)!0.5!(#5)$) [DodgerBlue, font=\itshape, rounded corners=5pt, decorate, #2] (Label) {#6};
        \draw [draw=Chocolate, decorate, #3] (Label) to (Source);
    \end{tikzpicture}
}


\begin{document}
\section*{Malem Lima Belas}

Cicing di lawang panto, ningali ka kulon katutupan ku wangunan. Ningali ka w\'{e}tan sarua k\'{e}n\'{e}h. Hanjakal baheula dijual, ari sugan t\'{e}h moal kieu. Sora \CommentText{A1}{B1}{tura\'{e}s}, sora uncuing geus arareuweuh \'{e}l\'{e}h ku sora \CommentText{A2}{B2}{baladna buta} mah. Kawas kieu \CommentText{A3}{B3}{ningan} malem lima belas t\'{e}h, teu kaciri caang bulan, \'{e}l\'{e}h ku caangna lampu wangunan. 
\CommentPar[draw=RosyBrown][draw=Salmon, shift={(1.0cm,1.7cm)}, rotate=20, text width=2.5cm, align=center][out=-65, in=5, distance=0.2cm,->]{A1}{B1}{Cik, apal henteu \\ka sato ieu?}
\CommentPar[RosyBrown][color=Tomato, shift={(0.75cm,-0.3cm)}, rotate=0][draw=none]{A2}{B2}{Naon maksudna?}
\CommentPar[RosyBrown][text width=4cm, color=SeaGreen, shift={(3cm,-.35cm)}, rotate=-2][Chocolate, out=185, in=-120, distance=0.6cm, ->]{A3}{B3}{Ti wewengkon mana ieu t\'{e}h?}

\vspace{.7cm}
``Akang, tutupan pantona, loba reungit,'' ceuk pamajikan nu keur di dapur.

\medskip
Ngahiliwir, seungit gor\'{e}ng cau, kawasna pamajikan t\'{e}h keur ngagor\'{e}ng cau, matak ieu kaambeu kieu seungitna. Tadina mah moal dijual ieu tanah t\'{e}h, geus sapakat jeung nu lainna. Kajeun {\em d\'{e}mo}, lamun maksa wa\'{e} mah, pokona mah tanah ulah nepi dijual. Ngan ti saprak aya kajadian Haji Udin jeung Kang Til\'{e} di kerewed ku pulisi, majarkeun ar\'{e}k ngahalangan kana \CommentText{A4}{B4}{pembangunan} jeung kamajuan d\'{e}sa, jadi warga t\'{e}h sarieuneun matakna diriungkeun. Tina riungan \'{e}ta t\'{e}h jadi loba nu satuju tanah dijual, kusabab tanah nu ayeuna r\'{e}k dijieun tempat {\em r\'{e}kr\'{e}asi}, urang dieuna bisa digaraw\'{e}, ngan \CommentText{A5}{B5}{pembayaran} tanahna di dua kalikeun, lamun ram\'{e} tempat r\'{e}kr\'{e}asina bakal aya leuwihanna. Ayeuna mah 30\% heula mayar {\em uang muka}na (DP), ceuk pangusaha nu r\'{e}k meuli tanah warga. 
\CommentPar[draw=OliveDrab][draw=CadetBlue, shift={(1.0cm,-1.75cm)}, rotate=-5, text width=2.5cm, align=center][out=70, in=-130, distance=0.2cm,->]{A4}{B4}{\color{SaddleBrown}pangwangunan}
\CommentPar[draw=CadetBlue][draw=RosyBrown, shift={(-.5cm,-.9cm)}, rotate=-5, text width=2cm, align=center][out=150, in=-175, distance=0.2cm,->]{A5}{B5}{pamayaran}

\vspace{.6cm}
Geus aya kana opat taunna can mayar wa\'{e}, ari ditagih t\'{e}h engk\'{e} deui, engk\'{e} deui \CommentText{A6}{B6}{w\'{e}h} jeung engk\'{e} deui. Mun ningali tempat r\'{e}kr\'{e}asina mah ram\'{e}, urang dieu og\'{e} aya nu digaraw\'{e} ngan digaraw\'{e}na t\'{e}h jadi tukang parkir jeung tukang beberesih. Kusabab \CommentText{A7}{B7}{kaluman} ditagih teu mayar wa\'{e}, warga indit ngabring ka kantor kacamatan b\'{e}b\'{e}ja y\'{e}n tanah t\'{e}h can dilunasan wa\'{e} nepi ka ayeuna, ngan jangji \CommentText{A8}{B8}{hungkul}. 
\CommentPar[RosyBrown][color=DodgerBlue, shift={(0cm,0.5cm)}, rotate=0][draw=none]{A6}{B6}{wa\'{e}}
\CommentPar[draw=RosyBrown][draw=DodgerBlue, shift={(1.0cm,-1cm)}, rotate=-5, text width=1.25cm, align=center][out=70, in=-10, distance=0.2cm,->]{A7}{B7}{\color{Sepia}bosen?}
\CommentPar[RosyBrown][color=DarkTurquoise, shift={(1.275cm,0.07cm)}, rotate=0][draw=none]{A8}{B8}{wungkul}

\vspace{.8cm}
Barang datang ka kantor kacamatan, Pa Camat som\'{e}ah pisan, ngabandungan naon naon wa\'{e} anu dicaritakeun ku warga. ``Nya engk\'{e} urang riungkeun perkawis ieu, mugi-mugi tiasa r\'{e}ngs\'{e} sa\'{e}nggalna,'' kitu pokna t\'{e}h Pa Camat nenangkeun warga anu {\em \'{e}mosi}. 

\medskip
Pag\'{e}tona kab\'{e}h warga, Pa Camat, Lurah, jeung pangusaha nu meuli tanah t\'{e}a ngariung di bal\'{e} d\'{e}sa. Basa nanyakeun s\'{e}sana duit, pangusaha nu meuli tanah ngomong, nanyakeun {\em sertifikat}na mana? Kab\'{e}h warga og\'{e} jaremp\'{e} sabari gigideug. Pa Camat satuju kana omongan pangusaha anu nanyakeun {\em sertifikat}. 

\medskip
``Naha mak\'{e} {\em sertifikat} sagala? Tong \CommentText{A9}{B9}{k\'{e}na-k\'{e}na} ka urang lembur, ari meulina mah teu ngomong-ngomong {\em sertifikat} man\'{e}h t\'{e}h euy!,'' ceuk Haji Jaka ngab\'{e}la warga. ``Heueuh, bener!,'' surak kab\'{e}h warga. \\
``Lamun euweuh {\em sertifikat} mah moal dibayar, sarua jeung tanah euweuh anu mikaboga. Aya tina hukumna og\'{e},'' ceuk pangusaha sabari nyengir. 
\CommentPar[draw=RosyBrown][draw=Salmon, shift={(6cm,.65cm)}, rotate=0, text width=1.15cm, align=center][out=172, in=5, distance=0.2cm,->]{A9}{B9}{p\'{e}dah}



\medskip
``Anu aya {\em sertifikat} kumaha?,'' ceuk Haji Jaka. 

\medskip
``Nya nu aya mah, dilunasan ayeuna k\'{e}n\'{e}h,'' ceuk pangusaha t\'{e}h. 

\medskip
``Pa Camat jeung simkuring mah satuju pisan kana anu dicarioskeun tadi, y\'{e}n tanah t\'{e}h kudu aya {\em sertifikat}na, \CommentText{A10}{B10}{m\'{e}h} engk\'{e}na teu jadi \CommentText{A11}{B11}{pisoalan} anu mamawa hukum,'' ceuk Lurah. 
\CommentPar[RosyBrown][color=Tomato, shift={(-.5cm,0.5cm)}, rotate=0][draw=none]{A10}{B10}{amb\'{e}h, ngarah}
\CommentPar[draw=RosyBrown][draw=SeaGreen, shift={(5.2cm,2cm)}, rotate=10, text width=2cm, align=center][out=160, in=5, distance=0.2cm,->]{A11}{B11}{\color{Sepia}pimasalaheun?}

\medskip
``Kab\'{e}h warga teu barogaeun {\em sertifikat}, tina bogana og\'{e} moal dibikeun,'' ceuk Haji Jaka bari ngal\'{e}os. Ti harita tanah t\'{e}h teu dilunasan deui nepi ka ayeuna. Pangusaha nu ngabogaan \'{e}ta tempat r\'{e}kr\'{e}asi jadi beunghar, beunghar ku jangji. Asa dibobodo ku maung, maung anu keur lapar n\'{e}angan hakaneun. Ngeclak cipanon, nutupkeun panto tina malem lima belas. 

\medskip\raggedleft
Sumber: {CARPON} dari {\bfseries YasfiMaziya} \url{https://www.scribd.com/doc/105875235/CARPON}
\end{document}




1 comment:

  1. Terima kasih tex nya Pak, langsung "jling" nih... luar biasa!

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...