From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22678 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jesse Rosenthal Newsgroups: gmane.text.pandoc Subject: Re: docx writer: using styles from reference document Date: Mon, 6 May 2019 15:36:36 +0000 Message-ID: <87v9ynr3wc.fsf@jhu.edu> References: <0c37bc1d-ea10-4945-98a8-b169997ac437@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="37277"; mail-complaints-to="usenet@blaine.gmane.org" To: Alan McLachlan , pandoc-discuss Original-X-From: pandoc-discuss+bncBDF7DMU574PBBCNJYHTAKGQE527DTPY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon May 06 17:36:43 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vs1-f60.google.com ([209.85.217.60]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hNffW-0009Yo-RW for gtp-pandoc-discuss@m.gmane.org; Mon, 06 May 2019 17:36:43 +0200 Original-Received: by mail-vs1-f60.google.com with SMTP id o15sf255687vsr.20 for ; Mon, 06 May 2019 08:36:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1557157001; cv=pass; d=google.com; s=arc-20160816; b=yUHlv5Fd7Rjy8lwanZ147c9aez6OFwOh//gWEr6+U9qYafbNz25ZURSqUbG99XxXpy uaozfAPkQ6gJze06pRDjB4a1A4Bbrtgr45X9p8IeLm+Tx7iIXNKLa+q7GVFcOCveINQh IezRAGXwwzoeyXoRt2xXeVePlUocQvY8A6WVxCh8tN/ky5+3kAZx8o13Ggn9q3ZK6UwY 8xbZDe93ZDQhBAUCHPIy+bMxLlJSTbt/57miccNeYmvEe9xp+eQ0045UR65+6HFdrVQs UW5d5QvqvrQ2ueVEqPK5BZIM4q/D8NTKCKqwc50zk5DiCuocLpq3XlS1hrD9sOFYO07S DCIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:ironport-phdr :ironport-sdr:sender:dkim-signature; bh=I8pFMekrONBLTIV2TqpBY2FQ5pQG7+QlzcBxHWTe/UU=; b=tHqC6Dt5AJKkpof1THk0OkshvyPF7bSzhYjx/5dNcbJ2wUnqmnW5+WvGlnhut8YRV1 eEdnDbCQG6rgBB/zPS0ZUzMbSHrVGYLZ7bByNokOHE8lbcSrtbHcHU0G1VtvPEMuscC7 mMMcIQuXd6dhPgPX5Xcq8VMBrcSEjbmVgICKrPPPlXgpMDEzeToag19yhMjLAtIeUOSE +cKKYguiHClaLSTAjhw2lHTsf4Xm1i0GoeiYNzupMFudiP7ZC8JK5WhQIzdL8r6pYIGw L5vcXsu5pjCzb6iJmjs5fn6RsLBlncmmzhmTJm/XolECVyKLLlAm0HV2jqmklhqOTJY4 7kPQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@jhu.edu header.s=jhuiron header.b=C87IS1JE; dkim=pass header.i=@livejohnshopkins.onmicrosoft.com header.s=selector1-jhu-edu header.b="Azbpu1P/"; spf=pass (google.com: domain of prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org designates 162.129.199.180 as permitted sender) smtp.mailfrom="prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=jhu.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-phdr:from:to:subject:thread-topic :thread-index:date:message-id:references:in-reply-to:accept-language :content-language:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=I8pFMekrONBLTIV2TqpBY2FQ5pQG7+QlzcBxHWTe/UU=; b=H++KmP+qBjvkoZc88NDZWlgsFZR7UAMewPoOx2ynNPoMdAY3SAayNCisghM2W4OtvZ sTplaNN5x791B2eqAXxZStgd/bRLvngpmKR7YoI2zvBFQUC3WKUDzhGbaYG9cvY3FEgs 1GmuHO7GEOBa1GkVjY02RRtGy3hxbkewAFNGNafWnSaWVbaTdoPIKwZjPzsduVKo0veZ OjuJn9vPMfypOUWkv1WgXOwl/XILvqmSjP4ntqHBFSGHT8sblmzo6uRfO/gkn4a/598w za9sy9hGlYb8tMy6xqvuzvqGZA7W+3BK+wrMic9ETteg7mlQD X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-phdr:from:to :subject:thread-topic:thread-index:date:message-id:references :in-reply-to:accept-language:content-language:mime-version :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=I8pFMekrONBLTIV2TqpBY2FQ5pQG7+QlzcBxHWTe/UU=; b=rz0WvOXeYLvOm682td36DnyrOBszbwC6jhVIaG1BDfyoV5XVJElawEVzxCd2trBYi3 quvFScTGkMwY88F003EOV6PR0wfBjd/h/+W8xdLwi6xYrrWPHzpaF+vFJ5Jrr6rRgkBU YMuGE9DpDLsYGVQdy5CwIy2AGy4ebiNZhrd4VYDxu3rSMqje2z7OIsvCLUchiv/QWhGm StyjrEIpnQz24aSwm731pQ7RRvDrCsTavtepONx2HlQ4pKaT3yb1bNiASJA4Xhfw15G+ svmb Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVP0DBsWL2sE7bXTDs/TsiYNtGqhMkRNnmcZyJuyeCj3vTR9rlS nVZLL7JVo4PZBw3swSPPrOY= X-Google-Smtp-Source: APXvYqxqKdKXRbciqvmPSFE0cZZj09oMc06hYuXAWCJAye92bhjt9zYiW8y8j5FDwdX4zR8SqQBNwg== X-Received: by 2002:a67:fbc4:: with SMTP id o4mr3275355vsr.30.1557157001712; Mon, 06 May 2019 08:36:41 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a67:82cb:: with SMTP id e194ls1198428vsd.15.gmail; Mon, 06 May 2019 08:36:41 -0700 (PDT) X-Received: by 2002:a67:ba13:: with SMTP id l19mr2671742vsn.129.1557157000982; Mon, 06 May 2019 08:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557157000; cv=none; d=google.com; s=arc-20160816; b=wuBsm6qmEvDnfhfL5BWIn7Tyon9zIIKmj78krRSxGtYFk2OXR9LQ1hMiWQFQ1flpgP B3b///h3HOa7CkhCEgJ9dAjdt90CF17MLSRidzN6LB2CBJ24tGf8c32hoU6bldCxukDS GC1unyNxUp28Om4S4M/A82jHrSPyyhijWdlHSF1dOkLssdI4v2HIRkXnL8Y0093ApOjE ObEzNWS4fTwd3G3Xp7eJIGjSh1Uq7dS6y0PlDJl12aUAlb1V7LOVm1Ww7mRxsWViZZ5T tDCAiemHGnOkJLyyFlLvWg8lXy56Ganl4KygwN9taSwJSGqicjlVfH1Zosr+MZr63pgN JDLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from:dkim-signature:ironport-phdr :ironport-sdr:dkim-signature; bh=OMUafs9VqBpa9rXDO1S8rqjfr6yRM4S7OPju3BHq/7U=; b=NU9bqGhLyXGpwf4p8Cz4L8JHC/T8ZttPAKABl3CAJdmztr6zjYhZ0cpVZpV9w4N1+j qQv4U0jnfvKgSp+eRjxMNH6+KfCvhyLbw9B8ngVB5n16DTI7/sCYbQuVedsHgeMpynV7 J6u+P+xJxs59s+0wBAhUiQIlCshviwPi94XYtsOaGvstNtYr4VhradhRywQKMiokKxHj 0RXwt7prdhosXB1fYrCZnG50Rn37KfK1wF97Zgj+wRKe8GcodNBvsNS506lZt6sac/sM 1sEH1T/94yPJG40YFkTCp1FctscK1u0OCWXnS0mNc7zQ7kInaAw/Z8yDkKkbKmyj/ZA9 KKrA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@jhu.edu header.s=jhuiron header.b=C87IS1JE; dkim=pass header.i=@livejohnshopkins.onmicrosoft.com header.s=selector1-jhu-edu header.b="Azbpu1P/"; spf=pass (google.com: domain of prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org designates 162.129.199.180 as permitted sender) smtp.mailfrom="prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=jhu.edu Original-Received: from IronEB8.johnshopkins.edu (ironeb8.johnshopkins.edu. [162.129.199.180]) by gmr-mx.google.com with ESMTPS id r138si516818vke.1.2019.05.06.08.36.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 08:36:40 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org designates 162.129.199.180 as permitted sender) client-ip=162.129.199.180; IronPort-SDR: oIMcSlei+jFm25Pe1Yl0D05ztEbqhaQvjxo964lIDRVqE8FLEvpEC1/Zl61ub3Mst6dJWQ/fd2 pmb4g3QaxVDjxRJW/j2u7Mf2hjkcYr7FPkohimB0fjqInKLYBwfXSZqnt94ym4Dp7/yoBL3erS Z9l5DIT16GFrXKSutyZLOUzIOMfPs5PEcZCiB7dxLNbJuBHbLh7AWX/zzcyn5mViLxismpdHpS citL+wIg2rX8RrDXxVP+vqQAAwV7ePfWSbeBM8eRPRyzab4ufwaLbxrntEgWFZPEgmPlJe/I5m Wlg= IronPort-PHdr: =?us-ascii?q?9a23=3A9DQqIhdOUG9y5TcR2PBKNbzElGMj4e+mNxMJ6p?= =?us-ascii?q?chl7NFe7ii+JKnJkHE+PFxlwGQD57D5adCjOzb++D7VGoM7IzJkUhKcYcEFn?= =?us-ascii?q?pnwd4TgxRmBceEDUPhK/u/bTY9B8lESF9s+1m5MVUTFcrjNBXf?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FzBQASVNBc/+kZtQpmHQEBBQEHBQG?= =?us-ascii?q?BZYE+UGx1BDMKhAaDSo8BgleJPo1mglIDGDwBDgEjCgKBAoM8AheCIDgTAQM?= =?us-ascii?q?BAQEEAQEBAQICAmkcDIJ4TTkxAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBAQUCDSYFOQEBAQIBEhERDAEBOAQLAgEIGgIFIQICAg0BERE?= =?us-ascii?q?VEAIEARIigwGBagMODwECDKBpikJxgS+CeQEBBXWBUoI2DQtAAQcKgTwJCQG?= =?us-ascii?q?BASeLZYFAP4QjPoIaRwMBgV+DCoI2IotKgguZKDkJgguGGIheg2qCb5JZjBu?= =?us-ascii?q?GTIFLiQKDUAIEAgQFAhWBZiKBVk0lgzoJggaDb4QIgQyFP0AyTluOdQGBIAE?= =?us-ascii?q?B?= X-IPAS-Result: =?us-ascii?q?A2FzBQASVNBc/+kZtQpmHQEBBQEHBQGBZYE+UGx1BDMKh?= =?us-ascii?q?AaDSo8BgleJPo1mglIDGDwBDgEjCgKBAoM8AheCIDgTAQMBAQEEAQEBAQICA?= =?us-ascii?q?mkcDIJ4TTkxAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?QUCDSYFOQEBAQIBEhERDAEBOAQLAgEIGgIFIQICAg0BEREVEAIEARIigwGBa?= =?us-ascii?q?gMODwECDKBpikJxgS+CeQEBBXWBUoI2DQtAAQcKgTwJCQGBASeLZYFAP4QjP?= =?us-ascii?q?oIaRwMBgV+DCoI2IotKgguZKDkJgguGGIheg2qCb5JZjBuGTIFLiQKDUAIEA?= =?us-ascii?q?gQFAhWBZiKBVk0lgzoJggaDb4QIgQyFP0AyTluOdQGBIAEB?= X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Original-Received: from esgmwexec3.win.ad.jhu.edu ([10.181.25.233]) by IronEB8.johnshopkins.edu with ESMTP/TLS/ECDHE-RSA-AES256-SHA384; 06 May 2019 11:36:39 -0400 Original-Received: from ESGMTWEX11.win.ad.jhu.edu (10.181.25.251) by ESGMWEXEC3.win.ad.jhu.edu (10.181.25.233) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 May 2019 11:36:38 -0400 Original-Received: from NAM03-BY2-obe.outbound.protection.outlook.com (10.173.97.244) by ESGMTWEX11.win.ad.jhu.edu (10.181.25.251) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 6 May 2019 11:36:38 -0400 Original-Received: from BN8PR01MB5523.prod.exchangelabs.com (20.179.96.141) by BN8PR01MB5506.prod.exchangelabs.com (20.179.96.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Mon, 6 May 2019 15:36:36 +0000 Original-Received: from BN8PR01MB5523.prod.exchangelabs.com ([fe80::1996:53c3:2963:1cc]) by BN8PR01MB5523.prod.exchangelabs.com ([fe80::1996:53c3:2963:1cc%5]) with mapi id 15.20.1856.012; Mon, 6 May 2019 15:36:36 +0000 Thread-Topic: docx writer: using styles from reference document Thread-Index: AQHVBB6akrwPlgA0hEydJlh/S1NMrqZeOryA In-Reply-To: <0c37bc1d-ea10-4945-98a8-b169997ac437-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Accept-Language: en-US Content-Language: en-US x-clientproxiedby: BN7PR11CA0005.namprd11.prod.outlook.com (2603:10b6:406:a8::18) To BN8PR01MB5523.prod.exchangelabs.com (2603:10b6:408:ba::13) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [128.220.159.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd4946c8-155f-42ee-fb25-08d6d238a02c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020);SRVR:BN8PR01MB5506; x-ms-traffictypediagnostic: BN8PR01MB5506: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0029F17A3F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(366004)(346002)(396003)(39860400002)(376002)(189003)(199004)(446003)(11346002)(6512007)(26005)(186003)(6306002)(99286004)(476003)(52116002)(76176011)(6486002)(6246003)(36756003)(478600001)(2616005)(86362001)(486006)(786003)(316002)(53936002)(2906002)(88552002)(6116002)(75432002)(3846002)(966005)(14454004)(25786009)(5660300002)(66066001)(7736002)(229853002)(6506007)(386003)(102836004)(68736007)(305945005)(64756008)(71200400001)(66446008)(66556008)(66476007)(6436002)(66946007)(73956011)(71190400001)(110136005)(8936002)(81166006)(81156014)(8676002)(256004);DIR:OUT;SFP:1102;SCL:1;SRVR:BN8PR01MB5506;H:BN8PR01MB5523.prod.exchangelabs.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: syX5/58spSJSqCSiXyRb16ZDOrKm9QKNFX1aJhELA8m59Xm95lXGjjJUujrXpdi/rYqgBi/mku7JlNvO/38Zx2Ttc3lcvJYbn6TvdG86AWDnp3uWOGK/ORFr9dRem7ovxdsvzPOFXSir1v77flFMgPzN+kcoSalIIno9eqEscLbRXZMYZKplfMv4a5RReqrbpFhMYZbAhn1c/YLIvfEs4K9E5PZkio8S3HLNr1Cxr5OcOrCoXzsk79x7kKzOPx1WIz0hBUvw5lI9E9qBZgMUBNizg0VtDa2Na1qZ+U3wcSfx7oN82kYylNQwEkSU50sCzez4rQg5MLTPCegePZaasHLhb+WzPxP9dKqhduS81D6RSW/IIPoX93rNC9kMrDcH8JOW50HKWrPG5zRui6MvVLrN2mdm1gsllOzCnbgi8aA= X-MS-Exchange-CrossTenant-Network-Message-Id: cd4946c8-155f-42ee-fb25-08d6d238a02c X-MS-Exchange-CrossTenant-originalarrivaltime: 06 May 2019 15:36:36.8986 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9fa4f438-b1e6-473b-803f-86f8aedf0dec X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR01MB5506 X-OriginatorOrg: jhu.edu X-Original-Sender: jrosenthal-4GNroTWusrE@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@jhu.edu header.s=jhuiron header.b=C87IS1JE; dkim=pass header.i=@livejohnshopkins.onmicrosoft.com header.s=selector1-jhu-edu header.b="Azbpu1P/"; spf=pass (google.com: domain of prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org designates 162.129.199.180 as permitted sender) smtp.mailfrom="prvs=022a8069a=jrosenthal-4GNroTWusrE@public.gmane.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=jhu.edu Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:22678 Archived-At: Alan McLachlan writes: > pandoc today generates the paragraph text set to "Normal" > style, I want it to use "My Style 1" instead of Normal. This is a job for custom-styles: https://pandoc.org/MANUAL.html#custom-styles So, one (not particularly user-friendly) way to do it would be to wrap ever paragaph in a div, to give it a custom style ~~~ ::: {custom-style="My Style 1"} Here is a paragraph. ::: ::: {custom-style="My Style 1"} Here is another. ::: ~~~ But you probably don't want to do that -- instead, it would be nice to just write as normal: ~~~ Here is a paragraph. Here is another. ~~~ and then have paragraphs converted on the fly. To do that, you'd use a pandoc filter (https://pandoc.org/lua-filters.html): ~~~ function Para(blk) local attr = pandoc.Attr() attr.attributes["custom-style"] = "My Style 1" return pandoc.Div({blk}, attr) end ~~~ That will convert all plain paras into a styled div. Save that in a file (`style.lua`), and then run it on the simple markdown file: `pandoc input.md --lua-filter=styler.lua -o output.docx`