diff options
author | ax006ho <j.hoffmann@fh-aachen.de> | 2020-01-29 10:47:33 +0100 |
---|---|---|
committer | ax006ho <j.hoffmann@fh-aachen.de> | 2020-01-29 10:47:33 +0100 |
commit | c0780b37456044da4968f4aaf65586261073ec9b (patch) | |
tree | 52753017e04d2b8bfae8531c6df928a293d0a626 | |
parent | 7418d4dda227c3a80a2f44fe98cb9df636d57828 (diff) | |
download | listings-c0780b37456044da4968f4aaf65586261073ec9b.tar.gz listings-c0780b37456044da4968f4aaf65586261073ec9b.tar.bz2 |
missing \lstget analogon to \lstset
-rw-r--r-- | issues/bubifengyun/how_about_add_lstget_in_listings_package.mbox | 91 | ||||
-rw-r--r-- | issues/bubifengyun/test_ifmathescape.tex | 77 |
2 files changed, 168 insertions, 0 deletions
diff --git a/issues/bubifengyun/how_about_add_lstget_in_listings_package.mbox b/issues/bubifengyun/how_about_add_lstget_in_listings_package.mbox new file mode 100644 index 0000000..b5baf99 --- /dev/null +++ b/issues/bubifengyun/how_about_add_lstget_in_listings_package.mbox @@ -0,0 +1,91 @@ +From bubifengyun@sina.com Fri Sep 21 06:39:51 2018 +Received: from fhex-w1-a.ad.fh-aachen.de (2002:8682:1ab1::8682:1ab1) by + fhex-s1-b.ad.fh-aachen.de (2002:8682:1ab2::8682:1ab2) with Microsoft SMTP + Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) + id 15.1.1531.3 via Mailbox Transport; Fri, 21 Sep 2018 06:39:51 +0200 +Received: from fhex-s1-b.ad.fh-aachen.de (2002:8682:1ab2::8682:1ab2) by + fhex-w1-a.ad.fh-aachen.de (2002:8682:1ab1::8682:1ab1) with Microsoft SMTP + Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) + id 15.1.1531.3; Fri, 21 Sep 2018 06:39:50 +0200 +Received: from mail-out-4.itc.rwth-aachen.de (134.130.5.49) by + fhex-s1-b.ad.fh-aachen.de (134.130.26.178) with Microsoft SMTP Server + (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id + 15.1.1531.3 via Frontend Transport; Fri, 21 Sep 2018 06:39:51 +0200 +Authentication-Results: mail-in-4.itc.rwth-aachen.de; dkim=none (message + not signed) header.i=none; spf=Pass smtp.mailfrom=bubifengyun@sina.com +Received-SPF: Pass (mail-in-4.itc.rwth-aachen.de: domain of + bubifengyun@sina.com designates 202.108.7.218 as permitted + sender) identity=mailfrom; client-ip=202.108.7.218; + receiver=mail-in-4.itc.rwth-aachen.de; + envelope-from="bubifengyun@sina.com"; + x-sender="bubifengyun@sina.com"; x-conformance=spf_only; + x-record-type="v=spf1" +IronPort-PHdr: + =?us-ascii?q?9a23=3AeTuMFBeTo/Ewt4znOmLIR74rlGMj4uSmDksu8pMi?= + =?us-ascii?q?zol2XOGm9pXmMlbY4Kw13kTIW4yd4PVB2bPb?= +X-IronPort-Anti-Spam-Filtered: true +X-IronPort-Anti-Spam-Result: + =?us-ascii?q?A0DvAgC2daRbh9oHbMpbHQIfBQeEJn8yg?= + =?us-ascii?q?2mkXoo/EB6EYoNLATgUAQMBAQEBAQEBARQBAQEIDQkIKSMMhS+BHQEEBQECGyM?= + =?us-ascii?q?EDR0lDCSDEAGBaAEBFhCGbZQThzQIgSyEKwE8ggEZDhmCYAWLBoIAhyYZAoReN?= + =?us-ascii?q?YImAoNZiw2OCQmGQ4MHBYZLFQ2BNYc5hjOLcokGAYFVgXZwgh2BIIIyg0+KXzJ?= + =?us-ascii?q?9jCSBHgEB?= +X-IPAS-Result: + =?us-ascii?q?A0DvAgC2daRbh9oHbMpbHQIfBQeEJn8yg2mkXoo/EB6EYoN?= + =?us-ascii?q?LATgUAQMBAQEBAQEBARQBAQEIDQkIKSMMhS+BHQEEBQECGyMEDR0lDCSDEAGBa?= + =?us-ascii?q?AEBFhCGbZQThzQIgSyEKwE8ggEZDhmCYAWLBoIAhyYZAoReNYImAoNZiw2OCQm?= + =?us-ascii?q?GQ4MHBYZLFQ2BNYc5hjOLcokGAYFVgXZwgh2BIIIyg0+KXzJ9jCSBHgEB?= +X-IronPort-AV: E=Sophos;i="5.54,283,1534802400"; + d="scan'208";a="19428858" +Received: from mail7-218.sinamail.sina.com.cn ([202.108.7.218]) + by mail-in-4.itc.rwth-aachen.de with SMTP; 21 Sep 2018 06:39:50 +0200 +Received: from webmail-14-98.pop3.fmail.dbl.sinanode.com (HELO + webmail.sinamail.sina.com.cn)([10.41.14.98]) by sina.com with SMTP id + 5BA4760F00007048; Fri, 21 Sep 2018 12:39:43 +0800 (CST) +X-Sender: bubifengyun@sina.com +X-SMAIL-MID: 656073394385 +Received: by webmail.sinamail.sina.com.cn (Postfix, from userid 495) + id 755FB5D00098; Fri, 21 Sep 2018 12:39:43 +0800 (CST) +Received: from bubifengyun@sina.com([223.104.217.112]) by m0.mail.sina.cn + via HTTP; Fri, 21 Sep 2018 12:39:43 +0800 (CST) +Reply-To: <bubifengyun@sina.com> +From: <bubifengyun@sina.com> +To: j.hoffmann <j.hoffmann@fh-aachen.de> +Subject: how about add lstget in listings package +X-MessageID: 5ba4760f1b74261_201809 +X-Originating-IP: [10.41.14.98] +X-Mailer: Sina WebMail 4.0 +Content-Type: multipart/alternative; + boundary="=-sinamail_alt_3772493340d1692def51221a1e21835c" +Message-ID: <20180921043943.755FB5D00098@webmail.sinamail.sina.com.cn> +Return-Path: bubifengyun@sina.com +X-MS-Exchange-Organization-Network-Message-Id: + 202f2b65-5828-4376-5a38-08d61f7c44eb +X-MS-Exchange-Organization-AVStamp-Mailbox: Sophos;-2016111358;0;PM +X-MS-Exchange-Organization-AuthSource: fhex-s1-b.ad.fh-aachen.de +X-MS-Exchange-Organization-AuthAs: Anonymous +X-MS-Exchange-Transport-EndToEndLatency: 00:00:00.4063074 +X-MS-Exchange-Processed-By-BccFoldering: 15.01.1531.003 +MIME-Version: 1.0 +Date: Fri, 21 Sep 2018 12:39:43 +0800 +X-Evolution-Source: 1379663227.1135.5@thinktwiceVII.tm2.fh-aachen.de + + +--=-sinamail_alt_3772493340d1692def51221a1e21835c +Content-Type: text/plain; charset="GBK" +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + +I find that some time, I need to get some state of listings, to produce some code, like in pandoc. + +https://github.com/jgm/pandoc/issues/4716 + +if there are some code like \lstget{mathescape}, it would be easy to solve such problem. thank you.来自新浪邮箱触屏版 +--=-sinamail_alt_3772493340d1692def51221a1e21835c +Content-Type: text/html; charset="GBK" +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + +<meta http-equiv="Content-Type" content="text/html; charset=gb2312">I find that some time, I need to get some state of listings, to produce some code, like in pandoc. <br><br>https://github.com/jgm/pandoc/issues/4716<br><br>if there are some code like \lstget{mathescape}, it would be easy to solve such problem. thank you.<p style="margin:1em 0;color:#666;">来自新浪邮箱触屏版</p> +--=-sinamail_alt_3772493340d1692def51221a1e21835c-- + diff --git a/issues/bubifengyun/test_ifmathescape.tex b/issues/bubifengyun/test_ifmathescape.tex new file mode 100644 index 0000000..d2b07a3 --- /dev/null +++ b/issues/bubifengyun/test_ifmathescape.tex @@ -0,0 +1,77 @@ +%%% test_ifmathescape.tex --- +% +%% Author: j.hoffmann@fh-aachen.de +%% Version: $Id: test_ifmathescape.tex 0 2018/09/21 12:23:46 ax006ho Exp $ + +\RequirePackage{ifpdf} +\RequirePackage{ifluatex} + +% \documentclass[12pt,a4paper,english,ngerman]{article} + +\documentclass[12pt,a4paper,english,ngerman]{scrartcl} +\usepackage{etex} +\makeatletter +\@ifclassloaded{article}{% + \usepackage{typearea} +}{} +\makeatother + +\ifluatex + \usepackage{fontspec} + \defaultfontfeatures{Ligatures=TeX} + \fontspec{Latin Modern Roman} +\else + \usepackage[utf8]{inputenc} + \usepackage[T1]{fontenc} + \usepackage{lmodern} +\fi +\usepackage{babel} + +\usepackage{listings} + +\begin{document} + +\begin{itemize} + \item Use mathescape local: \lstinline|$x_1$| + vs. \lstinline[mathescape]|$x_1$|. + + \item Use mathescape global in the current environment: + \lstset{mathescape=true}\lstinline|$x_1$| + vs. \lstinline[mathescape]|$x_1$|. + + But: \lstinline[mathescape=false]|$x_1$| + vs. \lstinline[mathescape]|$x_1$|. +\end{itemize} +Outside the environment: +\makeatletter +\lst@ifmathescape mathescape is true\else mathescape is false.\fi +\makeatother + +\lstset{mathescape=true} +And now after setting mathescape global again: +\makeatletter +\lst@ifmathescape mathescape is true\else \fi +\makeatother + +As macro one can write in \LaTeX: +\makeatletter +\newcommand{\ifmathescape}[2]{% + \lst@ifmathescape #1\else #2\fi +} +\makeatother + +and use it like \ifmathescape{mathescape is true.}{mathescape is false.} +\lstset{mathescape=false} or +\ifmathescape{mathescape is true.}{mathescape is false.} + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% TeX-engine: default +%%% TeX-source-correlate-mode: t +%%% mode: flyspell +%%% ispell-local-dictionary: "deutsch8" +%%% End: |