From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SLqpCGbz+GO1QAAAbAwnHQ (envelope-from ) for ; Fri, 24 Feb 2023 18:27:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SJiFCGbz+GN9OwEAauVa8A (envelope-from ) for ; Fri, 24 Feb 2023 18:27:02 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CE1C1561E for ; Fri, 24 Feb 2023 18:27:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVbpT-0005ob-N8; Fri, 24 Feb 2023 12:25:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVbpQ-0005nf-SR for emacs-orgmode@gnu.org; Fri, 24 Feb 2023 12:25:53 -0500 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVbpO-0008O2-Pk for emacs-orgmode@gnu.org; Fri, 24 Feb 2023 12:25:52 -0500 Received: by mail-lf1-x136.google.com with SMTP id s22so35001lfi.9 for ; Fri, 24 Feb 2023 09:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=suMRD8P+2px1fAzf9IyPBED6P27utnQ1NlzXVyue7B8=; b=Vg6SVOE8k5j+Q5y5lVTiPk3SVTgrN04N7sI/pDY0a4c/DfBoc6L0oz4p+oJJAgA32J mmtMamW96/Zo1P/fXVQB4inz/ZHwiZj17mMHSwjhHrrTv1XzB8Hd5wmdv0yQG0pkPwc1 ofq6boocA2+NywUs9q8JntK1gfJUfIPUse2mThckP0Zo8vYrnQbF6oE0Q7VOTwoGFuBj gqoIb7wy1yMgXBs6aDDIUYUbEoTsFP/2p1qhCqM+3n8yf2uh7HaIBvNjZyYbRVXmNDIy WM0ipi/BP8bFrM5U3dR/GhnIuUdZNvPuVpkvRNYWZQJjvPloOSCQFwWykixiQf/K1Nfq NsgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=suMRD8P+2px1fAzf9IyPBED6P27utnQ1NlzXVyue7B8=; b=i3lAQl377IgZWmAsMI6DMwx/m+FRWxKUNpeiMJ1srT1b33SAN6Ym4JWbfdPDjNtNlD W5U6A3Z58NdmUHJTMgUSoObOH/ovWXeGy5LgEZyJFTyFjj1Czz8R3+ciul3j+83LSfVp hdwnW4BzCdUcj7Kk1dKRdSkcM2qAYo/vEP3OOpV2mcLOqWEQ8PbjrKjFwLfC+O1yEg9t fYFiMC55DTOOw1IFQqpIk9ZJKhCmDD/TvXR2ucs/JTJVYDDuS9ZwRbY0AkwTtqVThmEz jxa+tv2xBoYEM5QCvRW+1mGTZG5ZMV26KuD4dJHKUeQG9zq+dMdgawutoLUwf4emyUea p5HQ== X-Gm-Message-State: AO0yUKW5X+bfjIIPrqXvSYrkFZBek4vmvoWDpDdsF3XpwhXDtGeScpoT tJ66LexamLS54F/suzLffV7Zei0xgC4= X-Google-Smtp-Source: AK7set8yiwjsA4AhVb7n3EZKvGpc3QAgiajJirl1vL9rGGXihIG5Kki+WCVFkpJI4OsGIJu+ZFQWDw== X-Received: by 2002:a19:f00e:0:b0:4d2:c97e:6762 with SMTP id p14-20020a19f00e000000b004d2c97e6762mr5285287lfc.0.1677259546068; Fri, 24 Feb 2023 09:25:46 -0800 (PST) Received: from pluto.localnet (alagny-155-1-32-78.w83-200.abo.wanadoo.fr. [83.200.85.78]) by smtp.gmail.com with ESMTPSA id f25-20020ac25339000000b004d865c781eesm1646824lfh.24.2023.02.24.09.25.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 09:25:45 -0800 (PST) From: chris To: emacs-orgmode@gnu.org Subject: [BUG] org-latex-preview with custom sty file Date: Fri, 24 Feb 2023 18:25:42 +0100 Message-ID: <3485389.iIbC2pHGDl@pluto> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=inkbottle007@gmail.com; helo=mail-lf1-x136.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677259621; a=rsa-sha256; cv=none; b=mJyEybLejX+fAjOR6Yhd9G9235vF96JDCDHAc1eE+5o+YbJcqT48lcs5gjBZliZkNwGA58 dGh5k7tQbqTzcf8H0jp/igpT8uj/VHl7MGZSk1JRYGlz1dnhd/0txO9hGZgh1TbCYyJKe8 0gKSN4zYChXRvwxZeYkFkab9HWeZqxoFBSnWXeWsYUtporLJYFCd63VVosm0ahcIfJZr+u v4Ygt5T82L98GJDF+S+lzMHzACERVDzy9nAYgnC2r4JWECWOlgIRZLmlqR0oWYVRbgjFVW xAAG0zBi7YsW5ciApD57swmr4P/HbJ+6MjbAe8w9fRGlXCc2ptzK/FEsuiV4tw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Vg6SVOE8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677259621; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=suMRD8P+2px1fAzf9IyPBED6P27utnQ1NlzXVyue7B8=; b=ADgFK2sf84apQkmiQKtsAgq3VYNlVrFlvPQC4tutarhITqwrmhnZwPmkbVScVkjgIqnKlV dDwFwulD3fyjYUgsJ7gVutTDndmQQ80nr9SBfVT14kYfQkLCXfRJKj92QgHEvYF1weXUht cAv3WzG4crEV5ugvm97W42YWPRpoCXmeku1d6cHQ+DZU6VGLuuiT5fltx1H0tr2asmlac9 LnTMDC5JlNvg/2109V2QwC2x0T1ArXRwizVEsZP9LbhFmD5okRL+qLkGWJI0i8hLe/FNT4 ufqrXn2Mbpl3JIH/rXc8R3yuJTqq3PzLUsvXWZhVfGrGa5ghf+jpiYk37AdDCA== X-Migadu-Queue-Id: CE1C1561E X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Vg6SVOE8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.90 X-Spam-Score: -3.90 X-TUID: kQo5vPeOdNZw Dear all, How to do it: My org-latex-preview related config: ``` (with-eval-after-load 'org (add-to-list 'org-latex-packages-alist '("" "stmaryrd" t)) (add-to-list 'org-latex-packages-alist '("" "tikz-cd" t)) (add-to-list 'org-latex-packages-alist '("" "thisisastupidtestfile" t)) (setq org-latex-create-formula-image-program 'dvisvgm) (setq org-format-latex-options (plist-put org-format-latex-options :scale 0.80))) ``` in some org file (`hello.org`), add this latex formula: `\(\calT \llbracket \tau_H \rrbracket \)` Invoke `org-latex-preview` (`C-c C-x C-l`). Open `thisisastupidtestfile.sty` which is situated in the same directory as our `hello.org` file. Change the definition of: `\newcommand{\calT}{\mathcal{T}}` to `\newcommand{\calT}{\mathcal{K}}` and invoke `org-latex-preview`. Result: There is no way you can have the image regenerated. Analysis: the image is associated to the latex input through some hash function (see below). Editing `thisisastupidtestfile.sty` doesn't change the arguments of the hash function, consequently the image isn't regenerated. I understand org-latex-preview images are associated to latex expression through some hash function: ``` (sha1 (prin1-to-string (list org-format-latex-header org-latex-default-packages-alist org-latex-packages-alist org-format-latex-options forbuffer value fg bg))) ``` Now if I edit my custom sty file, the output of the hash function won't change, and therefore the generated image won't change neither. Note: I haven't been able to compute the return value of the hash function for my latex expression, because I can't figure out what the arguments actually are, specifically `forbuffer`, `fg` and `bg`, but the above reasoning seems sound. Note: Removing specifically the images looking like the image associated with the latex expression that refuses to be regenerated, using some file manager, and then invoking `org-latex-preview`, does the trick, but it's impractical. Best, Chris