From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0L41O8t6VGB3DwAA0tVLHw (envelope-from ) for ; Fri, 19 Mar 2021 10:19:55 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OCceN8t6VGB1DQAA1q6Kng (envelope-from ) for ; Fri, 19 Mar 2021 10:19:55 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 3B028182B2 for ; Fri, 19 Mar 2021 11:19:55 +0100 (CET) Received: from localhost ([::1]:58790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNCEU-0007HH-4o for larch@yhetil.org; Fri, 19 Mar 2021 06:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNC8i-0001Wh-L7 for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 06:13:58 -0400 Received: from tempel.uberspace.de ([185.26.156.63]:59470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNC8g-0000Ju-ID for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 06:13:56 -0400 Received: (qmail 29465 invoked from network); 19 Mar 2021 10:13:44 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by tempel.uberspace.de with SMTP; 19 Mar 2021 10:13:44 -0000 References: User-agent: mu4e 1.5.5; emacs 28.0.50 From: Christine =?utf-8?Q?K=C3=B6hn?= To: =?utf-8?B?WGlhbndlbiBDaGVuICjpmYjotKTmlocp?= Subject: Re: Exam LaTeX class In-reply-to: Date: Fri, 19 Mar 2021 11:13:23 +0100 Message-ID: <87pmzvo3i4.fsf@chark.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.26.156.63; envelope-from=christine@chark.eu; helo=tempel.uberspace.de X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.157 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616149195; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FT5MrmGSI/upn9n1WGRe+zLIwL55vIdsjUt0x61duZs=; b=KlpkX31ucDOu8LonXh7cjmHNvPlndqI88U+lmXc+awUYb/Uoa3Zd1tAjLitRMAEZbeDslz Cbba1xZFlzb4JdtE84PxgYQ35q2ETYg0P+57Qc8BfCnvRBCNiJ6OIuxhVmXQVyFMTJf2SD 3jNp48u1WpBEo/yOmTUkg/J5xy7H1u552JmGwSUkIKuIA0+xQ5bMkJfgj7p5Rv4klnDYNd U2KrIJUWBRYWSvMU4y3jhrBxV/s0z89gW84vOjeAFu8SdcHwCByYo6/3jRqNR5HgN70Qjp lZEwUer8UvTDknYHAQjqoQzCM+1lfr3Y+vpqp+XzgeUsHlUTTZgZ0VDUuwVkFw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616149195; a=rsa-sha256; cv=none; b=RcZyg8yVukQnwKzuswKhWPs6qPNXWnEvC1Tmj25ZSuev6Iy+h67e4dp+wDHiBQJiEPNkr4 y076s8y/G4SkWNyOh44+GDrZYCao3vvSvVe1SXZN6Cv0NgDRKaGCxE6Cgj61cyxo4GLb+N sCJvcRMH70GHPhP9fAHreYUh+HqnxIl8YlAcnMM6d010rzAZ5NzOAFcRktptMUMuH7+S/C o3m1nILcYNUoXgyqCSg0PgiOVMBBOtiDL5Eq29I+ocXto1FKpnQFJP4A1BXmgXNq3hTq62 c8uQ6KHQ+AYumMCDEqMtptOvIZbTU64Qp1kY0fQI4r/bguYBveobhWe4PFhY9A== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=none; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.41 Authentication-Results: aspmx2.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 3B028182B2 X-Spam-Score: -2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: YHSB1PfDBIAU Hi Xianwen, Xianwen Chen (=E9=99=88=E8=B4=A4=E6=96=87) writes: > Does someone have experiences with the exam LaTeX class:=20 > http://www-math.mit.edu/~psh/exam/examdoc.pdf? Yes, but I haven't useid it with orgmode. > The next step I'm trying to do, but don't know how, is to ask LaTeX=20 > exporter to create two exports to PDF. > I guess one way is to modify the org-latex-export-to-pdf function, so=20 > that when the document class is exam, the exporter first export without=20 > solutions, and then export to an other PDF file (such as=20 > foo-with_solutions.pdf). Here is one way to do the latex part. You could pass a jobname to latex. I have this \IfEndWith*{\jobname}{withsolution}{% \usepackage{todonotes} \printanswers }{\usepackage[disable]{todonotes}} in a myexam.sty file to switch between modes (with or without solutions and todo notes) and use it in the latex file with \usepackage{myexam} You could add your own latex class to org-latex-classes and add this line there. The jobname has to be passed to latex with something like -jobname withsolution if you want it to be with solutions. I use a Makefile for this purpose which calls latexmk latexmk -pdf -pdflatex=3D"pdflatex --interaction=3Derrorstopmode" -use-make and adds -jobname=3D$(basename $@) if asked to create a pdf ending with withsolution.pdf. I can send you the Makefile if you're interested. To use the jobname from within orgmode, you'll have to change org-latex-pdf-process to use the jobname if needed. I think one way to achieve this is to add a new export backend which is derived from latex (see org-export-define-derived-backend) and which sets org-latex-pdf-process accordingly (and resets it afterwards). Hope this helps. Best, Christine